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

    Hmm...your config there SHOULD work...D'oh. Reading my old code, looks like the proper syntax for spawn-routine binom is prepended with an "if.". Hmm. Try using "if.binom.#asdf"

    As for your idea of effectively tagging entities, I actually really, really like it. There are a few concerns regarding persistence and garbage collection...I'd just have to think about some sort of implementation for that. But it actually would be really easy to integrate into calculations. I'm already coding an aliasing system for items that users can override manually, and am considering doing such for mob types/player groups, too. Perhaps something akin to:

    Code:
    Offensive:
        global:
            melee:
                - 'binom.10':
                    - 'targeteffect.tag.FragileSkeleton'
    Defensive:
        global:
            mob:
                _FragileSkeleton: #We would denote a label with an underscore, for various reasons.
                       - '8'
    
    Of course, with 0.9.5 it would have to look like:

    Code:
    Damage:
        - 'switch.targettype.mob':
            - '_FragileSkeleton':
                - '8'
            - 'Skeleton':
                - 'binom.10':
                    - 'targettag.FragileSkeleton'
    
    And...if I have those dynamic labels in place, it'd be a snap to simply spawn mobs with labels already applied. :D Ohgawl. I'm in love. Made yet another issue here. Daggum. ANOTHER feature. :p

    Entity healing was coded in 0.9.4, but I don't even know it it'll work at this point. Syntax reference is at the wiki. Wanna test for me? :p
     
  3. Offline

    ClonedInsanity

    Sorry is this is the wrong place to post this or if I've missed some key point but i can't seem to get groups working, this be my current config:
    Code:
    Offensive:
        global:
            generic:
                nature:
                mob:
                armor:
                ranged:
                humans:
                melee:
                animal:
            nature:
                blockexplosion:
                lightning:
                lava:
                explosion:
                fall:
                void:
                suffocation:
                burn:
                fire:
                drowning:
                cactus:
            mob:
                ZombiePigman:
                    - 'set.2'
                Creeper:
                    - 'set.2'
                Spider:
                    - 'set.2'
                Giant:
                    - 'set.10'
                Zombie:
                    - 'set.4'
                Slime:
                    - 'set.6'
                Skeleton:
                    - 'set.3'
                Ghast:
                    - 'set.7'
            ranged:
                snowball:
                bow:
                egg:
                fireball:
            armor:
            groups:
                Overlord:
                    item:
                        other:
                        pickaxe:
                        fist:
                        spade:
                        hoe:
                        axe:
                        sword:
                    melee:
                        - 'attacker.light.lessthanequals.7':
                            - 'mult.5'
    but for some reason Overlord's don't get any damage bonus and the plugin states that no groups are defined when i type /md check.
     
  4. Offline

    KoryuObihiro

    Well...I can tell you the problem right now. You can't just put things under the melee node - you have to use the nodes that you have (for some reason) under "item", and then define calculation strings from there, or...use a generic node, in this case. Did you read the wiki?

    Try this:
    Code:
    Offensive:
        global:
            mob:
                ZombiePigman:
                    - 'set.2'
                Creeper:
                    - 'set.2'
                Spider:
                    - 'set.2'
                Giant:
                    - 'set.10'
                Zombie:
                    - 'set.4'
                Slime:
                    - 'set.6'
                Skeleton:
                    - 'set.3'
                Ghast:
                    - 'set.7'
            groups:
                Overlord:
                    generic:
                        melee:
                            - 'if.attackerlight.lessthanequals.7':
                                - 'mult.5'
    
     
  5. Offline

    ClonedInsanity

    Oh wow thanks, and yes I did read the wiki and at one point I had what you gave me, except I used
    Code:
    - 'attacker.light.lessthanequals.7':

    instead of
    Code:
    - 'if.attackerlight.lessthanequals.7':
    Thanks again, I'm going to have a lot of fun with this =D
     
    KoryuObihiro likes this.
  6. Offline

    KoryuObihiro

    @ClonedInsanity
    :) Glad to hear that this is useful for you! It's only gonna get better. I just wonder how the crap I'm going to have time to implement the crazy features I'm adding to MD.

    For instance, a MD command string API, which lets programmers add their own calculations to MD, or aliasing for items/mobs/animals, which lets those configuring MD make their own categories. Hoooo boy.
     
  7. Offline

    lucent

    I tried replacing that line with 'if.binom.10', but to no avail. It still returned "Invalid string" when trying to load the node.

    Huzzah!! In addition to EntityAltitude, would it be tough to add EntityX and EntityZ conditional strings? Would be pretty neat to have full control over what spawns where :)

    I'll play with it, but it's just an effect, isn't it? Or is there a way to link it in with conditionals to use in the damage/defense calculations?

    Unrelated question: what does EntitySetFireTicks do? I tried using it in hopes of lightning foes on fire, but it didn't seem to do anything.
     
  8. Offline

    KoryuObihiro

    Sadness. :(

    I don't see why not. Objections, anyone? **opens the issue tracker again**

    Most effects should have nestable input calculation...i.e., get a random explosion size with:
    Code:
     - 'targeteffect.explode':
        - 'roll.3'
    
    Again, this is untested. Becaaaaause...I was an egghead this last week. :x

    Ticks are rapidly decremented when set, so try something that looks relatively high like a value of 200 (watch closely), or perhaps 2000. I haven't actually messed with it...yet. Again...testing. :<
     
  9. Offline

    lucent

    Great! I'm happy to play around with testing stuff as I get more familiar with the configuration.

    Regarding the ticks, I'll toy with that. People always talk about ticks, but it never occurred to me to put it together with what I know of the /time command to reason that there were 24000 ticks in a day (is this the case?).

    Question about features: in your matchArmorElement static, you have all the types of armor... I was wondering if there is a way to check for "nothing" as an armor element (or armor set)? For example, if you wanted to make a group that was the "Monk" class which gets defensive bonuses for wearing no armor or something else where you wanted to check for, e.g., 'targetis.wearing.NO_HELMET'.

    Also, related to this, there is the [entity]is.wearing.$armor... But can you invert conditionals to make it 'not' instead of 'is'? As in, something like '[entity]is!wearing.$armor'?
     
  10. Offline

    KoryuObihiro

    You are one of my favorite testers thus far. And not because you're one of the few. :p

    Armor set comparison is pretty rough right now, and I might take that idea into consideration. Something else to pile on, I suppose.

    To invert a conditional: change "if" to "if_not". :p

    EDIT: Just noticed:
    Looking at code? How much do you know about Java?
     
  11. Offline

    lucent

    Sadly, I know nothing of Java. In fact, my programming experience is pretty pathetic (though I'm perpetually interested in it)- all I ever do is write perl parsing scripts for large sets of data as part of the work I do. In the end, all I can really do with any code is read the flow of the logic.

    Speaking of which, however, this is a nice segue. I played more with fire ticks, and I think I wasn't noticing this before since I had debugging mode set to verbose and it got lost in the wash, but the setFireTicks event nodes aren't loading for me. Within DamageCalculationAllocator:

    Code:
    if(args[0].equalsIgnoreCase("attackerEffect") || args[0].equalsIgnoreCase("targetEffect"))
    {
    	boolean forAttacker = args[0].equalsIgnoreCase("attackerEffect");
    	if(args[1].equalsIgnoreCase("heal")) 				return new EntityHeal(forAttacker, Integer.parseInt(args[2]));
     	else if(args[1].equalsIgnoreCase("explode"))		return new EntityExplode(forAttacker, Integer.parseInt(args[2]));
    	else if(args[1].equalsIgnoreCase("setAirTicks"))	return new EntitySetAirTicks(forAttacker, Integer.parseInt(args[2]));
    	else if(args[0].equalsIgnoreCase("setFireTicks"))	return new EntitySetFireTicks(forAttacker, Integer.parseInt(args[2]));
    	else if(args[1].equalsIgnoreCase("setHealth"))		return new EntitySetHealth(forAttacker, Integer.parseInt(args[2]));
    	else if(args[1].equalsIgnoreCase("setItem"))
    
    If I'm not mistaken, there's a typo, and the elsif that catches setFireTicks should be looking at args[1] instead of args[0], right? It seems like it would be hard for the parsed string to have both attackerEffect/targetEffect and setFireTicks as the first element...
     
  12. Offline

    KoryuObihiro

    0_o

    Dang. Thought @ricochet1k fixed all that nonsense.

    Well, certainly not blocking to MD...I don't think it'd be worth the effort to rerelease for just that. I'm having too much fun refactoring everything for a calculation API with regexs. :p

    EDIT: LOL, the allocators were merged with CalculationUtility since 0.9.4 release...you might be interested in looking at my current source on my indev branch.
     
  13. Offline

    lucent

    This is where my lack of coding experience gets me... The indev seems a little more complex/nebulous, so I'll have to stare at it for longer. My guess is that it is fixed already? :)

    Anyway, going to back to this:
    I went ahead and did this:
    Code:
    Offensive:
        worlds:
            world1:
                global:
                    melee:
                        other:
                        - 'if_not.attackeris.wearing.DIAMOND_CHESTPLATE':
                            - 'if_not.attackeris.wearing.DIAMOND_HELMET':
                                - 'if_not.attackeris.wearing.DIAMOND_LEGGINGS':
                                    - 'if_not.attackeris.wearing.DIAMOND_BOOTS':
                                        - 'if_not.attackeris.wearing.IRON_CHESTPLATE':
                                            - 'if_not.attackeris.wearing.IRON_HELMET':
                                                - 'if_not.attackeris.wearing.IRON_LEGGINGS':
                                                    - 'if_not.attackeris.wearing.IRON_BOOTS':
                                                        - 'if_not.attackeris.wearing.GOLD_CHESTPLATE':
                                                            - 'if_not.attackeris.wearing.GOLD_HELMET':
                                                                - 'if_not.attackeris.wearing.GOLD_LEGGINGS':
                                                                    - 'if_not.attackeris.wearing.GOLD_BOOTS':
                                                                        - 'if_not.attackeris.wearing.LEATHER_CHESTPLATE':
                                                                            - 'if_not.attackeris.wearing.LEATHER_HELMET':
                                                                                - 'if_not.attackeris.wearing.LEATHER_LEGGINGS':
                                                                                    - 'if_not.attackeris.wearing.LEATHER_BOOTS':
                                                                                        - 'if_not.attackeris.wearing.CHAINMAIL_CHESTPLATE':
                                                                                            - 'if_not.attackeris.wearing.CHAINMAIL_HELMET':
                                                                                                - 'if_not.attackeris.wearing.CHAINMAIL_LEGGINGS':
                                                                                                    - 'if_not.attackeris.wearing.CHAINMAIL_BOOTS':
                                                                                                        - 'if.attackeris.wielding.282':
                                                                                                            - '25'
    
    It's a monstrously ugly node... It looks to me like ASCII art one would see at the welcome screen of an old MUD, or something. Anyway, it works! Monks with their bowls of stew are effective, with it :). I wonder, though, do conditional strings support booleans? e.g., 'if_not.attackeris.wearing.LEATHER_HELMET&&LEATHER_LEGGINGS', of something of that ilk?. Anyway, going back to a completely different issue...
    I went ahead and tagged 'attackereffect.heal.1' onto the end of that damage node. It had some strange effects... Upon hitting a monster, I was healed, but not by one - rather, completely full. Not only that, but it made me immortal - I would take hits from monsters (knockback, healthbar flashes), but not take damage. Reloading MD, reloading the server, stopping and restarting the server... All had no effect. The only thing that seemed to clear it was to use the /kill command on myself. At which point, normal behavior would return (until I made that attack again).

    EDIT: Oh wait, I just figured out the last part by using a Scan node. Putting that tag at the end was causing my strikes with the soup bowl to heal me by 27, rather than 1. I guess it was adding everything up: punch(1) + node(25) + heal(1) to determine the heal amount, and was giving me significant overheal. Any advice on how to bypass that effect?
     
  14. Offline

    KoryuObihiro

    Armor sets are another roughness that needs to be polished for next release. Currently, you can use armorsets the way you're using, and not for much else. If the person configuring merely wanted to compare for a whole armor set, then they'd just do something like:
    Code:
     - 'if.attackeris.wearing.DIAMOND_HELMET*IRON_CHESTPLATE*GOLD_LEGGINGS*LEATHER_BOOTS':
    Which is nasty, and it's limited because while an armor set string doesn't require the equipment to be in order (the ArmorSet class organizes it), attempting to compare armor sets that have empty slots might not work - some edge cases I hadn't considered until after release.

    The next item about "booleans" is technically something that's already being done - except that conditionals are geared towards individual execution right now, and I hadn't given much thought to logical operation in and of itself. I have implemented classes that will act as switch statements...but that's rather gimmicky if I'm trying to use that to substitute good ol' conditionals programmers would be familiar with. Thinking about it, I guess I'll just have to code a wrapper class for conditionals that will check conditions provided by the some sort of statement class and its subclasses, and also execute the calculations stored with it (which would be delimited by logical operators :D). Another problem, though...what about parentheses? Oh boy.

    You have discovered a limitation that I've been thinking about for awhile. Currently the MC GUI only shows up to 10 hearts to the player - after that, it still just looks like you have 10 hearts. There are inherent flaws with attempting to use the preexisting GUI, which I don't mind going into detail right now but currently it's just another feature in the pile for me.
     
  15. Offline

    lucent

    Actually, I had been aware of that :) The effect I was wondering if you knew how to bypass was to make it so healing in a damage node only heals the attacker, say, by 1, while not adding the heal amount to damage dealt (like if someone wanted to make a lifedraining weapon that wasn't overpowered).

    As regards the limitation in the GUI, I agree that it is pretty unfortunate. It would be pretty cumbersome for any server admin anywhere to expect all of their users to patch the client side of things just to connect to their server... My only (perhaps naive) hope is that once Notch starts letting Modders see source code, someone will write a "server connect" utility that temporarily applies client side patches (as dictated by the server) before loading MC (sort of like UO connect did/does, if you ever happened to play Ultimate Online and free shards ;) )
     
  16. Offline

    KoryuObihiro

    The solution I had thought of was to just use static max-health assignment for individual mobtypes/aliases, and then override by tracking actual health on the plugin and merely sending proportional health changes to the player. But I don't know how feasible that is.
     
  17. Offline

    TheSquishyDitto

    This is an amazing plugin and its concept opens up worlds of possibilities for shenanigans on my server. :)

    I'm having a small issue, though. I've been testing the existing effects a bunch by punching things with a cactus, and the only two effects that don't seem to work for me are SetFireTicks and SetAirTicks. When I attempt to use those two specifically, ModDamage ignores them as well as anything else under the same trigger.

    Code:
    Offensive:
        global:
            melee:
                other:
                     - 'if.attackeris.wielding.CACTUS':
                         - '3'
                         - 'effect.reflect.1'
    This works perfectly.

    Code:
    Offensive:
        global:
            melee:
                other:
                     - 'if.attackeris.wielding.CACTUS':
                         - '3'
                         - 'effect.reflect.1'
                         - 'targeteffect.setfireticks.1000'
    This not only doesn't set the victim on fire, but it also dismisses the 3 extra damage and the recoil, and simply tells me the command string is invalid in the console.

    Another quirk, is that when I use the SetItem effect, it doesn't let me use the item names, and when I use the item ID in its stead, it replaces my held item with the new item, but the new stack's size is equal to its ID.

    Code:
    Offensive:
        global:
            melee:
                other:
                     - 'if.attackeris.wielding.TNT':
                         - 'targeteffect.explode.2'
                         - 'attackereffect.setitem.289'
    So when I smack something with TNT, I end up with what seems to be 289 gunpowder. <_<
    (It looks like 33, but you can keep tossing it with Q for a pretty good while.) Also, attempting to replace the item with nothing by using ID 0 crashes the client.

    I'm using CraftBukkit 953 and version 0.9.4.2 of ModDamage. Other than that so far things seem pretty cool. :D
     
    KoryuObihiro likes this.
  18. Offline

    KoryuObihiro

    Oh man. Points to you for giving me this info up front. :) Another amazing tester taking the time to post!

    So, as @lucent pointed out earlier, I made a programming mistake - it's literally impossible to use the setFireTicks calculation string. right now, because my parser checks the exact same place for "[entity]effect" and "setFireTicks". Stupid, right? ;_; Oh, how far testing would have gone... As for your bug with the EntitySetItem string...that's kind of scary. A good thing to document on the thread, I think. Fortunately, I've already refactored it to use a static material and then the quantity is calculated with other nodes, so with 0.9.5 this same problem shouldn't be present. I appreciate your feedback, in the meantime it's awesome to hear that you like MD otherwise!

    In other news, I would like to announce that ModDamage will have an API that lets programmers make their own calculations! I'm currently converting all of my old calculation classes to use this new API method, so there will be plenty of examples if one is interested in either learning intermediate Java or just making crazy new stuff for MD. Hooking in should be pretty easy, and information about events is very, very accessible.
     
  19. Offline

    TheSquishyDitto

    Yay, glad to know you have things under control. :p

    Would it be possible in 0.9.5 to not only compare values with the conditional calculation strings, but to have variables similar to them that return values? Like, right now you have conditionals for light levels, falling, altitude and such, but it's difficult/cumbersome to actually do mathematical calculations based on those. I had an idea for a group that would have been called something like Dark Lords, whose power would inversely correlate to how much light they were getting, but right now that would be a pain to set up without using a whole bunch of comparisons denoting how much strength they have at all 15 light levels. Could also potentially use such variables for like crazy bonuses to jumping attacks or making defenses change the more/less health you have. :)
     
  20. Offline

    KoryuObihiro

    If you're familiar with switch statements, I shall be implementing those in 0.9.5, and this should streamline what you're asking for a bit.

    I'm currently considering making calculations more dynamic in the way you describe, but it'd be tricky...then again, this entire plugin has been a delightful puzzle. It's something to think about. **chucks the idea on the huge pile he already has**
     
  21. Offline

    Rheves

    I was looking to use this mod just to prevent creepers from damaging land blocks, but leave in their player damage. Is that possible using this configuration:

    Offensive: worlds: world: global: mob: Creeper: - 'set.0'

    Defensive: global: generic: humans: mob: Creeper: - '-6' #By the way, what is creeper normal damage?
     
  22. Offline

    KoryuObihiro

    ModDamage doesn't change the explosion mechanics of a Creeper attack currently - just lets you manipulate the damage event value (in addition to other stuff :p). However, being able to manipulate that wouldn't be a bad idea...
     
  23. Offline

    TheSquishyDitto

    Note: It is extremely ill-advised to make explosion damage cause more explosions, particularly when you make creepers cause natural explosions on top of their normal ones. Server freezes. >_>
     
  24. Offline

    lucent

    So I think this might be tied to the same subroutine that I pointed out earlier about setFireTicks. If you look at line 131 of DamageAllocationCalculator:
    Code:
    							else if(args[1].equalsIgnoreCase("setItem"))
    							{
    								Material material = Material.matchMaterial(args[2]);
    								if(material != null) return new EntitySetItem(forAttacker, material, Integer.parseInt(args[2]));
    							}
    
    It looks (to me) like the third argument being passed to the new EntitySetItem is the material ID, and looking at EntitySetItem appears to use that value as the quantity. Would it perhaps make to tag in an extra line that looks like this?
    Code:
    if (args[3] = null)    int quant = 1;
    else int quant = Integer.parseInt(args[3]);
    
    Again, I don't know java syntax, but the idea being that configuration of EntitySetItem would become '[entity]effect.setitem.$material.#quantity'

    Maybe this is irrelevant with 0.9.5, but I figured I would report what I found :)
     
  25. Offline

    KoryuObihiro

    Err...who said anything about that? What about just modifying the explosion the creeper makes...?

    Your fix would be a valid one. :p
     
  26. Offline

    TheSquishyDitto

    Another quirk; it seems dispenser-thrown ranged objects (or at least snowballs) don't properly trigger ModDamage.
     
  27. Offline

    KoryuObihiro

    Oooh....haven't thought about that. I'll put it on the checklist for this next release. Perhaps I should add an attacker type for dispenser, too?
     
  28. Offline

    TheSquishyDitto

    That would probably be ideal. :p

    Also, amongst the mobs, Monsters (the hostile human dudes) aren't listed, and ModDamage ignores them entirely since they are immune to my exploding cactus punch and any other damage relationships. lol

    I'm starting to feel bad for pointing out all of these things. D:
     
  29. Offline

    KoryuObihiro

    Monsters? o_o Err...never heard of that mob before. Unless you've disabled default damage ingame, you're seeing normal MC behavior with damage events. And I can tell you that with about 90% certainty.

    It's people like you that help make this plugin awesome, dude. No worries! :D I'm thinking of putting together a list of people to send a test 0.9.5 JAR when the time comes - interested?

    I'd also like to extend that invitation to others, too - post here or PM if interested.
     
  30. Offline

    lucent

    I'd be happy to test the JAR, of course :)

    I think he's referring to the actual human mobs, which some plugins like Citizens or MobArena make use of. I've been playing a lot with both this mod and MobArena lately, and I too have noticed that humans seem to be immune to the melee offensive nodes.

    As long as we're on issues, the following node or any of its form doesn't work as one might want it to:
    Code:
    Offensive:
        global:
            ranged:
                bow:
                    - 'if.attackeris.wearing.GOLDEN_HELMET':
                        'targeteffect.explode.1'
    
    In particular, something about that type of conditional isn't working with ranged events. Is it possible that the entity that is the attacker is being assigned as the arrow or something?
     
  31. Offline

    TheSquishyDitto

    Monsters are basically just hostile versions of the default Minecraft character, and you have to spawn them like you would giants (with plugins, like lucent said) :p

    I'm not too much of an expert at this plugin yet, since I'm having difficulty getting the group system to work, but I can test simple things and some calculation stuff. :D
     
    KoryuObihiro likes this.

Share This Page