I have pretty much given up on creating this in the data editor, what i want is an ability that (when active) the unit loses energy instead of health.
I made a simple trigger for this (I posted the picture below) but there are still problems with it that i can't figure out.
the problems are that if the unit takes more damage than he has health he dies before the trigger actually activates
I tried some death prevention stuff in the data editor but then the unit doesn't take enough damage, for example if my unit has 2 hp and gets hit for 50 he will not lose 50 energy
edit: figured it out just used the damaging unit weapon damage instead of triggering damage amount and changed the behavior to make each hit (if fatal) to do 0% fractional damage put the trigger below if anyone is interested
I expanded on this a bit for my game. I wanted the mana shield to only absorb 90% of incoming damage so this is what i did:
First, i added a validator to the mana shield skill in the data editor so that the skill would be automatically turned off when you run out of energy (see image below).
Second, i changed the value called "modify fraction" found in behavior->buff->combat:damage response to 0.0. This allows me to make multiple levels of the ability - each with a different value for "modify fraction".
Third, i made a function that returns different "damage ratio" based on the level of the ability.
Fourth, I changed the trigger a little bit (see image below).
note: idk why but "leftover damage" always comes out negative.
edit: ok nvm it's because i put modify variable instead of set veriable.
Since the trigger using weapon damage, wouldn't it not able to absorb spell damage or damage from other (or consume energy according weapon damage instead of spell/non weapon damage)?
This can be done in a few ways. You can create a behavior ability and then attach 2 different validators for the damage effects of different abilities.
The first validator attached to the normal damage effect would check to see whether the mana shield behavior is active at the unit.
The second validator would be attached to a secondary modify unit effect (That removes energy) in which will only effect units with the mana shield ability active.
other then this I would have to play around with this because the leech energy from damage taken effect wont work if you disable health damage dealt. There may be a simpler work around but this may accomplish the desired effect that you have to apply to every ability in your game :3
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have pretty much given up on creating this in the data editor, what i want is an ability that (when active) the unit loses energy instead of health.
I made a simple trigger for this (I posted the picture below) but there are still problems with it that i can't figure out.
the problems are that if the unit takes more damage than he has health he dies before the trigger actually activates
I tried some death prevention stuff in the data editor but then the unit doesn't take enough damage, for example if my unit has 2 hp and gets hit for 50 he will not lose 50 energy
edit: figured it out just used the damaging unit weapon damage instead of triggering damage amount and changed the behavior to make each hit (if fatal) to do 0% fractional damage put the trigger below if anyone is interested
I expanded on this a bit for my game. I wanted the mana shield to only absorb 90% of incoming damage so this is what i did:
First, i added a validator to the mana shield skill in the data editor so that the skill would be automatically turned off when you run out of energy (see image below).
Second, i changed the value called "modify fraction" found in behavior->buff->combat:damage response to 0.0. This allows me to make multiple levels of the ability - each with a different value for "modify fraction".
Third, i made a function that returns different "damage ratio" based on the level of the ability.
Fourth, I changed the trigger a little bit (see image below).
note: idk why but "leftover damage" always comes out negative. edit: ok nvm it's because i put modify variable instead of set veriable.
Since the trigger using weapon damage, wouldn't it not able to absorb spell damage or damage from other (or consume energy according weapon damage instead of spell/non weapon damage)?
This can be done in a few ways. You can create a behavior ability and then attach 2 different validators for the damage effects of different abilities.
The first validator attached to the normal damage effect would check to see whether the mana shield behavior is active at the unit. The second validator would be attached to a secondary modify unit effect (That removes energy) in which will only effect units with the mana shield ability active.
other then this I would have to play around with this because the leech energy from damage taken effect wont work if you disable health damage dealt. There may be a simpler work around but this may accomplish the desired effect that you have to apply to every ability in your game :3