Inactive [MECH/ADMN] ModDamage - Change damage mechanics on the fly!

Discussion in 'Inactive/Unsupported Plugins' started by KoryuObihiro, May 20, 2011.

  1. Offline

    KoryuObihiro

    ModDamage
    We've moved to BukkitDev!
     
  2. Offline

    KoryuObihiro

    Would inserting a dash at the beginning of your explode node do anything? :p And...no, there's no reason it shouldn't behave identically to melee attacks.

    Ohhhhhhh, okay. I'd been unaware of them before this point. I can certainly add them. :D I'd just have to diffrentiate between players and humans from that point.
     
  3. Offline

    lucent

    Oops! The lack of dash was purely accidental. I didn't copy and paste, but just wrote it out. It doesn't work, even with the dash.

    EDIT: Wait, scratch that. I just checked again, and it does actually work. How odd. I guess it could've been a mod conflict - earlier when I was noticing it was on a live server, and just now when it worked was on a stripped-down localhost. Sorry for the false report!

    Notably, however, using this node:

    Code:
    Offensive:
        worlds:
            world1:
                global:
                    ranged:
                        bow:
                        - 'set.8'
                        - 'if.attackeris.wearing.CHAINMAIL_HELMET':
                            - 'binom.50':
                                - 'targeteffect.explode.2'
    
    Is yielding this response, from the server whenever there's an explosion:

    Code:
    2011-07-13 16:20:36 [SEVERE] Could not pass event ENTITY_DAMAGE to ModDamage
    java.lang.NullPointerException
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Effect.Entity.EntityExplode.calculate(EntityExplode.java:35)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.Handler.calculateDamage(Handler.java:419)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.Handler.runRoutines(Handler.java:389)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.WorldHandler.doDamageCalculations(WorldHandler.java:279)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.ServerHandler.doDamageCalculations(ServerHandler.java:47)
    	at com.KoryuObihiro.bukkit.ModDamage.ModDamage.handleDamageEvent(ModDamage.java:325)
    	at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:14)
    	at org.bukkit.plugin.java.JavaPluginLoader$55.execute(JavaPluginLoader.java:628)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    	at net.minecraft.server.Explosion.a(Explosion.java:130)
    	at net.minecraft.server.World.createExplosion(World.java:1458)
    	at net.minecraft.server.WorldServer.createExplosion(WorldServer.java:145)
    	at org.bukkit.craftbukkit.CraftWorld.createExplosion(CraftWorld.java:438)
    	at org.bukkit.craftbukkit.CraftWorld.createExplosion(CraftWorld.java:446)
    	at org.bukkit.craftbukkit.CraftWorld.createExplosion(CraftWorld.java:442)
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Effect.Entity.EntityExplode.calculate(EntityExplode.java:35)
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Conditional.ConditionalDamageCalculation.makeCalculations(ConditionalDamageCalculation.java:16)
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Conditional.ConditionalDamageCalculation.calculate(ConditionalDamageCalculation.java:21)
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Conditional.ConditionalDamageCalculation.makeCalculations(ConditionalDamageCalculation.java:16)
    	at com.KoryuObihiro.bukkit.ModDamage.CalculationObjects.Damage.Conditional.ConditionalDamageCalculation.calculate(ConditionalDamageCalculation.java:21)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.Handler.calculateDamage(Handler.java:419)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.Handler.runRoutines(Handler.java:389)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.WorldHandler.doDamageCalculations(WorldHandler.java:249)
    	at com.KoryuObihiro.bukkit.ModDamage.Backend.Handlers.ServerHandler.doDamageCalculations(ServerHandler.java:47)
    	at com.KoryuObihiro.bukkit.ModDamage.ModDamage.handleDamageEvent(ModDamage.java:325)
    	at com.KoryuObihiro.bukkit.ModDamage.ModDamageEntityListener.onEntityDamage(ModDamageEntityListener.java:14)
    	at org.bukkit.plugin.java.JavaPluginLoader$55.execute(JavaPluginLoader.java:628)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:321)
    	at net.minecraft.server.EntityHuman.damageEntity(EntityHuman.java:423)
    	at net.minecraft.server.EntityPlayer.damageEntity(EntityPlayer.java:179)
    	at net.minecraft.server.EntityArrow.m_(EntityArrow.java:185)
    	at net.minecraft.server.World.entityJoinedWorld(World.java:1190)
    	at net.minecraft.server.WorldServer.entityJoinedWorld(WorldServer.java:48)
    	at net.minecraft.server.World.playerJoinedWorld(World.java:1172)
    	at net.minecraft.server.World.cleanUp(World.java:1102)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:447)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    Does my node have a typo I'm not seeing, by chance?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  4. Offline

    KoryuObihiro

    @lucent No, if you're getting to the calculation class itself, then I doubt you typed it incorrectly, which is corroborated by the fact that it looks pretty darn good just eyeballing it.

    I wonder what the deal is. I'll have to investigate it....later...**yawn**
     
  5. Offline

    TheSquishyDitto

    Oh, didn't notice you responded to that earlier. Well, last night I was messing around and didn't think that I could modify the block damage of creeper explosions, so I just made them cause another, stronger explosion right after the first (and like a jerk, I made it originate at the victim, lol). This seemed fine other than the morals behind it, though it did seem to actually kill the creepers before they disappeared from their own explosions, since gunpowder was all over the place. But then I was having a little fun and noticed I could modify explosion damage, and like a mischievous devil, made explosions cause more small explosions upon hitting something. Unfortunately, the chain reaction seemed to take place in hyper speed, bouncing explosions back and forth between enemies instantly and infinitely and freezing the server with a torrent of error messages flooding the console rapidly. It was surreal. o_o

    Also, no matter how I seem to configure groups or mess with the syntax, I can't seem to get this to work.
    Code:
    Offensive:
        worlds:
            Tutorial:
                groups:
                    Subjugglator:
                        item:
                            axe:
                                - 'mult.2'
    This was my latest attempt. I also tried putting it under the server-wide global group and messing around with spacing and everything... D:
     
  6. Offline

    KoryuObihiro

    "item" -> "melee"

    ;)
     
  7. Offline

    TheSquishyDitto

    Ohhhh, thanks. :)

    I kept using item because the Firebreathers example on the tutorial had swords under the items category in this part:

    Code:
                    FireBreathers:
                        item:                   # allows calculation strings to be applied to tool types and to specific items
                            sword:
                                - '2'
                            DIAMOND_SWORD:
                                - '3'            # This has an incredible damage output! 11 + 2 + 3 = 16 = 8 hearts
    Anywho, works now. :D
     
  8. Offline

    KoryuObihiro

    D: Saywhat

    Fixing that NOW.

    EDIT: Fixed. Dang, wonder how I missed that.
     
  9. Offline

    TheSquishyDitto

    Been thinking about it, and it seems this plugin is just some customizable messages and a few variables away from allowing users to create their own super flexible RPG if they wish.

    Might be an interesting goal for the long term. :p
     
  10. Offline

    KoryuObihiro

    Aliasing and message calculations, my friend. ;)

    Message calculation strings would be relatively easy to do compared to the API work I've been doing.

    I've actually considered expanding the interpreter portion of MD so it can be used with other plugins - this could be used for other events. I feel like it's more than flexible enough (with some programming to make it truly independent) to apply to just a few other major events in Minecraft, but I don't know who'd care enough to attempt using it.

    Thoughts, anyone?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 15, 2016
  11. Offline

    TheSquishyDitto

    That sounds like a good idea, as well as potentially allowing for damage relationships that run commands from other plugins. Could have some group called Jumpers or something that get teleported using Multiverse or Commandbook or something to different locations when hit, or cause lightning to strike something when attacking with specific weapons! :D

    Not entirely sure if that's what you mean by usage with other plugins, though. <_<
     
  12. Offline

    KoryuObihiro

    OOooh, your post reminds me...I should implement some nodes for item consumption/evaluation. :p

    Anyway, the point of making an engine independent of MD would be to allow other coders to use systems of configuration similar to what 0.9.5 configuration looks like right now - they can define their own implementation of the system I use for ModDamage's routine caching, and do whatever the hell they want with it. Of course, it still abstractly geared towards handling damage events, but...**thinks of viable examples**

    I'll think of some eventually. Don't worry. :p

    As for an API for MD itself, I could always make hooks for other plugins to tap into (throw thisHook, plugin gets activated and does something), and for functionality like dynamically tagging entities (which definitely isn't planned for 0.9.5, but is currently what I'm thinking the focus of 0.9.6 will be)
     
  13. Offline

    TheSquishyDitto

    Not sure if this would help, but bShortcut ( http://forums.bukkit.org/threads/misc-bshortcut-1-1-0-define-shortcuts-for-commands-953.15174/ ) taps into other plugins to do its thing (which is almost its whole point, lol).

    Also, I have some other ideas/questions. Would it be possible to alter the knockback from an attack? As well, could the strength of the actual explosions (not just their damage) from creepers and ghasts be modified? And for the item consumption thing, would you be able to configure how much of a stack is consumed at once and maybe tie it into the item replacement effect?

    One more thing, in the configuration reference on the wiki...
    Code:
    EntityLightLevel[comparison]: - '[entity]light.[comparison].#value' - Compares to an entity's altitude.
    Sorry for throwing so much at you! D:
     
  14. Offline

    lucent

    I'm not exactly sure what you mean by the mod interaction, either... Do you mean linking into other plugins' hooks? So, like, if you had a mod, "ManaMod" that kept track of user mana and regeneration, could define damage nodes something like this?

    Code:
    Hooks:
        ManaMod:
            getMana(Player);
            subtractMana(Player, Int);
    Offensive:
        global:
            ranged:
                snowball:
                    - 'if.getMana(attacker).greaterthan.4':
                        - 'attacker.subtractMana(attacker,5)'
                        - '3'
                        - 'targeteffect.explode.2'
    
    Or am I missing the idea, completely, here?

    EDIT: changed the code block a little to make it clearer what my hypothetical "ManaMod" hooks would be...
     
  15. Offline

    KoryuObihiro



    That pretty much sums it up. The biggest feature to that engine would be interoperability - you can send commands to other plugins, or even strings like the ones in MD (except...they'd make their own. :D)
     
  16. Offline

    tassox33

    I updated to 9.4.2 and changed my spacing, still no change in dmg. Is global permissions just not supported?
     
  17. Offline

    KoryuObihiro

    No, global should work just fine... :confused: Can I see your config?
     
  18. Offline

    TheSquishyDitto

    May I ask that the negativeheal configuration be kept? I have an idea to make an armor set convert damage to health very easily. :D
     
  19. Offline

    tassox33

    Sure Koryu
     

    Attached Files:

  20. Offline

    KoryuObihiro

    @tassox33 What's /md check look like? Does MobHealth seem to be loading fine?
     
  21. Offline

    TheSquishyDitto

    I must say, global groups don't seem to be working for me either. I tested the same group configuration between global and per-world and only the latter worked. There was no error for global for me, it just didn't even acknowledge I had anything there. D:
     
  22. Offline

    gsand

    Hi,

    Is there a way to make it so that a specific group and a mob can't damage each other at all?

    I've tried changing and trying different nodes together and I cant't get it to work.


    Thanks
     
  23. Offline

    TheSquishyDitto

    Might be able to use something like this...
    Code:
    Offensive:
        worlds:
            yourworld:
                groups:
                    MCHammer:
                        mob:
                            Zombie:
                                - 'set.0'
    
    Defensive:
        worlds:
            yourworld:
                groups:
                    MCHammer:
                        mob:
                            Zombie:
                                - 'set.0'
    Not entirely certain if that would work though. :oops:
     
    KoryuObihiro likes this.
  24. Offline

    KoryuObihiro

  25. Offline

    TheSquishyDitto

    Yay. :)

    By the way, been setting up a bunch of offensive classes each having their own special abilities, but when I got to this part, ModDamage tells me the targetedbyother line is an invalid command string:
    Code:
    Offensive:
        worlds:
            Tutorial:
                groups:
                    Swordsman:
                        melee:
                            GOLD_SWORD:
                                - 'if.attackeris.targetedbyother':
                                    - 'targeteffect.sethealth.0'
    Was just trying to make it so only attacks where an enemy noticed you can murder them. lol
     
  26. Offline

    KoryuObihiro

    "targetedbyother" command string is definitely not tested. I'm sad to hear that. However, keep in mind that targeting can only be tested for non-players. "Is that Zombie targeting me currently?"

    Right now I view 0.9.5 and the next Bukkit RB release as a race. If another RB comes out, I'll fix the known bugs and release 0.9.4.3, but in the meantime I'd really like to get 0.9.5 finished.

    I figured out switch statement formatting today! It'll be something like this:

    Code:
    SomeNode:
        - 'switch.something':
            - firstcase:                 #Here's a case.
              - 'someString'
              - 'maybeSomeConditional?":
                  - 'anotherBaseString'
              secondCase:             # And here's another.
    
    It's a little confusing, but a tutorial should go a long way. Basically, command strings nested under a switch case are only offset by 2 spaces, instead of 4, and while the first case must be denoted by a dash, subsequent cases must NOT have a dash.

    If you're confused as to what a switch statement is, try looking at the following example:
    Code:
    Damage:
        - 'switch.attackerType':
            - human:
              - '2'  # Because we don't like just being pink and squishy.
              - 'binom.10' # We DO miss occasionally.
              HugeSlime:
              - '16' #Jellyblob of DOOM.
              Slime:
              - '8' # This catches every other case of Slimes.
              Wolf:
              - '-2' # Bad dog.
              AngryWolf:
              - 'binom.99' #This never gets executed, because a Wolf case has already been caught.
              mob:
              - 'set.1' # Catches every other mob type.
              dispenser: 'set.5' #Single-line configuration. :D
    
    Thoughts, questions, concerns, etc. gogogo.
     
  27. Offline

    TheSquishyDitto

    Will the old configuration still function or are switch statements going to be mandatory?
     
  28. Offline

    tassox33

    @Kory its doing the same thing as a week ago, "no config file found, are you sure you blah blah"

    If global Isnt supported just let me know, and ill redo my entire perms.
     
  29. Offline

    lucent

    Hey tassox33,

    One thing I noticed with your config file: the MobHealth nodes should have a slightly different syntax. For example, where you have:
    Code:
    MobHealth:
        worlds:
            Earth:
                global:
                    Creeper:
                        - '20'
    
    It should just be:
    Code:
    MobHealth:
        worlds:
            Earth:
                Creeper:
                    - '20'
    
    whereas if you just want to apply a global effect to creepers aside from world, you would go '-MobHealth:global:Creeper[20]'.

    Anyway, I'm not sure if that's intentional since the Configuration Wiki says otherwise, but if I watch my console with debugging: verbose, the former does not load the mobhealth nodes whereas the latter does.
     
    KoryuObihiro likes this.
  30. Offline

    gsand

    Hmm, it doesn't seen to work
    Below are my group nodes and plugin info.

    Thanks!

    Code:
    
    --------------------------------
    ModDamage Config
    --------------------------------
    
    Offensive:
        worlds:
            Island:
                groups:
                    Jailed:
                        mob:
                            Zombie:
                                - 'set.0'
    
    Defensive:
        worlds:
            Island:
                groups:
                    Jailed:
                        mob:
                            Zombie:
                                - 'set.0'
    debugging: normal
    
    
    --------------------------------
    Server Info
    --------------------------------
    
    Craftbukkit Version      : git-Bukkit-0.0.0-904-g9277096-b953jnks (MC: 1.7.2)
    Free memory         : 3809 MB
    Max memory          : 8187 MB
    Total memory        : 4112 MB
    
    
    Groups             : Jailed, Visitor, Regular, Mod, Admin
    
    
    
    
    DeathNotifier      : 0.7
    Permissions        : 3.1.6
    JSONAPI            : 1.8.1
    ModDamage          : 0.9.4.2
    WorldEdit          : 83-9d47696
    SlowHealth         : 3.2.0
    CommandSigns       : 0.9
    PermissionsPlus    : 3.2
    nChat              : 0.4
    AngryWolves        : 0.8
    WorldGuard         : 5.2.3-SNAPSHOT
    RemoteToolkitPlugin: 0.45b
    OtherBlocks        : 0.9.8
    CommandBook        : 66-f6a45e4
    CommandHelper      : 3.0.2
    NoCheat            : 1.09b
     
  31. Offline

    tassox33

    @ lucent, weird I didn't add global in there, it came with the auto create config.
    I'll check it out.
     

Share This Page