I've got a unit that spawns other units that act as projectiles. I'd like to have it when they explode they heal the shooting unit like a form of lifetap. However i can't figure out through the data editor or through triggers how to pull this off.
In the data editor i could simply add an extra effect to their explosion that heals a specific unit, but there's no way to link the unit i want to heal: the unit that spawned these units who explode. In the data editor it's VERY easy to initiate the heal, but seems impossible to target the correct target. I'm having the opposite problem in the trigger editor.
In the trigger editor it's hard setting up the right event that triggers the heal. I've found a trigger that fires when a unit uses a specific action, but their detonation is triggered by a behavior, not an action. I looked into the event "any unit that dies", but couldn't find a unit condition that would isolate these projectiles, I tried putting them into a unit group, but there's no blanked "unit is from unit group" condition, instead there are more precise "unit is X unit in unit group".
It's so frustrating bouncing between the data editor and the trigger editor. They seem like they should be 2 pieces to the puzzle that fit perfectly, but there's this giant wall between them.
If global variables were usable from the trigger editor in the data editor, this editor would be FAR more powerful.
Pretty jaded right now, spent a long time today trying to figure out many other issues, this is just one of them. Any help is appreciated!
Damage Effects have a field called "Leech Fraction" while I haven't played with the field I expect that this will give you the desired effect. It is a fraction of the damage dealt, so 0(default) is nothing and 1 would leech an amount equal to the damage done, 0.5 would be half the damage done.
i see your dilema, the way i would currently go about this through the data editor only (im still learning a lot of workarounds from within the data editor so this may be a barbaric method) but possibly you could give the unit that shoots the projectile a buff, say one that lasted -1 (forever duration) then make it when the projectile explodes it does a search and targets only the units with the buff and does a healing effect. you could group this up with the damaging effect in a set from the projectile.
the fallback would be if multiple units (of the 'mother' class) were around, then they would all get healed. as well as a possible range factor depending on how far you wanted to make the search for buffed unit to heal effect reach.
to possibly further this one to 'lower' errors (but the errors will become more chaotic, just fewer) would be if when the projectile was launched, it applied the buff to the mother unit, then when the projectile died, it did the search/heal, and removed the buff from the mother unit, to try to lower the number of 'mother' units around that could recieve the healing buff. if only we could assign specific/unique 'buff tags' (kinda like local variables) it would help with some stuff.... other than that the good ol trigger editor;
with a trigger editor i would make it when the unit is created (spawned etc... or missile is created etc..) then give it a custom value associated with the specific unit that 'created' it through triggers. then when it explodes make another trigger that event detects it and conditions (mother/custom tagged unit is alive) then to heal it for x life. (or just set unit property w/e)
not the best way but its a way, albeit possibly crappy. i hate doing stuff with triggers, even custom scripting, i dont like it. gotta keep pushing into the data editor i say! but, i dont know how to target specific units through the data editor either. though i saw some fields that played with that idea in the interceptor ability. when its launched its issued an order to attack the same unit the carrier is attacking i believe. so there is a link between effects / other units. but it may be quite limited, at least from what i know.
but i gotta be honest with you, i dont like ANY of the above methods. the trigger way seems the most accurate, but triggers fuckin blow imo-
Thanks for the thoughts guys, thought it was a tough nut to crack. Gonna think about it at a later date, if i find a solution i'll be sure to post it here.
Are you spawning the projectiles via a Create Unit effect or a Launch Missile effect?
If the latter it should be very simple, just set the Leech Fraction field in the Damage effect. If it's the former, you might want to consider why you're doing it that way instead of using Launch Missile.
Ahh, that would 'splain it, thanks for the info Riley. Yeah i was using a highly modified baneling as a missile (dumb I know), about time i reconstruct this sucker and try this out, thanks again.
Hmm, this is turning out to be more work than anticipated, can a fired projectile fire straight out like a unit with a movement command with a behavior to check for enemies in real time (a seek behavior)? The original unit i was spawning is the stereotypical bullet seen in many mods that's a unit that's ordered to run straight out with a seek behavior.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I've got a unit that spawns other units that act as projectiles. I'd like to have it when they explode they heal the shooting unit like a form of lifetap. However i can't figure out through the data editor or through triggers how to pull this off.
In the data editor i could simply add an extra effect to their explosion that heals a specific unit, but there's no way to link the unit i want to heal: the unit that spawned these units who explode. In the data editor it's VERY easy to initiate the heal, but seems impossible to target the correct target. I'm having the opposite problem in the trigger editor.
In the trigger editor it's hard setting up the right event that triggers the heal. I've found a trigger that fires when a unit uses a specific action, but their detonation is triggered by a behavior, not an action. I looked into the event "any unit that dies", but couldn't find a unit condition that would isolate these projectiles, I tried putting them into a unit group, but there's no blanked "unit is from unit group" condition, instead there are more precise "unit is X unit in unit group".
It's so frustrating bouncing between the data editor and the trigger editor. They seem like they should be 2 pieces to the puzzle that fit perfectly, but there's this giant wall between them.
If global variables were usable from the trigger editor in the data editor, this editor would be FAR more powerful.
Pretty jaded right now, spent a long time today trying to figure out many other issues, this is just one of them. Any help is appreciated!
Damage Effects have a field called "Leech Fraction" while I haven't played with the field I expect that this will give you the desired effect. It is a fraction of the damage dealt, so 0(default) is nothing and 1 would leech an amount equal to the damage done, 0.5 would be half the damage done.
i see your dilema, the way i would currently go about this through the data editor only (im still learning a lot of workarounds from within the data editor so this may be a barbaric method) but possibly you could give the unit that shoots the projectile a buff, say one that lasted -1 (forever duration) then make it when the projectile explodes it does a search and targets only the units with the buff and does a healing effect. you could group this up with the damaging effect in a set from the projectile.
the fallback would be if multiple units (of the 'mother' class) were around, then they would all get healed. as well as a possible range factor depending on how far you wanted to make the search for buffed unit to heal effect reach.
to possibly further this one to 'lower' errors (but the errors will become more chaotic, just fewer) would be if when the projectile was launched, it applied the buff to the mother unit, then when the projectile died, it did the search/heal, and removed the buff from the mother unit, to try to lower the number of 'mother' units around that could recieve the healing buff. if only we could assign specific/unique 'buff tags' (kinda like local variables) it would help with some stuff.... other than that the good ol trigger editor;
with a trigger editor i would make it when the unit is created (spawned etc... or missile is created etc..) then give it a custom value associated with the specific unit that 'created' it through triggers. then when it explodes make another trigger that event detects it and conditions (mother/custom tagged unit is alive) then to heal it for x life. (or just set unit property w/e)
not the best way but its a way, albeit possibly crappy. i hate doing stuff with triggers, even custom scripting, i dont like it. gotta keep pushing into the data editor i say! but, i dont know how to target specific units through the data editor either. though i saw some fields that played with that idea in the interceptor ability. when its launched its issued an order to attack the same unit the carrier is attacking i believe. so there is a link between effects / other units. but it may be quite limited, at least from what i know.
but i gotta be honest with you, i dont like ANY of the above methods. the trigger way seems the most accurate, but triggers fuckin blow imo-
@ezbeats: Go
Thanks for the thoughts guys, thought it was a tough nut to crack. Gonna think about it at a later date, if i find a solution i'll be sure to post it here.
Bump bump, anyone know by now?
Are you spawning the projectiles via a Create Unit effect or a Launch Missile effect?
If the latter it should be very simple, just set the Leech Fraction field in the Damage effect. If it's the former, you might want to consider why you're doing it that way instead of using Launch Missile.
@RileyStarcraft: Go
Ahh, that would 'splain it, thanks for the info Riley. Yeah i was using a highly modified baneling as a missile (dumb I know), about time i reconstruct this sucker and try this out, thanks again.
Hmm, this is turning out to be more work than anticipated, can a fired projectile fire straight out like a unit with a movement command with a behavior to check for enemies in real time (a seek behavior)? The original unit i was spawning is the stereotypical bullet seen in many mods that's a unit that's ordered to run straight out with a seek behavior.