Hey all, does anyone know of a way to track the amount healed by a unit?
I have a couple of abilities, one that channels healing and one that instant heals a chunk of life, but would like to be able to track this via triggers. I can kinda track the channelled healing in a round about way, but the instant heal seems a bit more difficult, particularly because I need to know the actual amount healed.
Thanks, but I also wouldn't be able to determine who did the healing.
To clarify, I have a hero unit with multiple heal abilities. I need to track how much healing the Hero does to other units. There doesn't seem to be a simple way to do this, it is possible but is a bit of mucking around, was hoping for something similar.
There is a trigger event somewhere to detect when a units hitpoints (property) changes. What I suppose you could do is have every healing ability add an invisible behavior to the unit it healed. In the event the hitpoint is changed, check the unit for heal flag behaviors and determine the source of the behavior?
But this would also detect regeneration.. and it lags the game like mad. Maybe add the behavior, then do a periodic check for the behaviors and their sources?
(Not sure if theres a way to track behavior source though)
I think there was also an event for, detect when unit becomes target of spell. That would probably be a better bet if it exists.
Thanks, currently I'm detecting when hitpoints change. I've disabled regeneration on the majority of units so it might not lag too much, and I have conditionals that should break it out of the trigger pretty early. I can also just turn this trigger on/off just when someone uses a particular spell if the lag is an issue.
But yeah that's pretty much how I've done it with behaviours for one of them, not necessary for the channel healing though. Couldn't see an event to detect when a unit was the target of a spell unfortunately.
Is there any way to tell if it will be laggy? Some debug monitoring?
What I noticed is that the lag usually comes as a result to events triggering very quickly when the debugger is open. Its not so noticeable when you're full screen in game, but there is still a risk of it happening. You can press Ctrl+F in game, it turns on the game framerate. As long as framerate is refreshing greater than 60, there shouldn't be any visual lag. Anything less and it appears choppy.
Like you say, A possible way to solve it is to have the trigger turn on and off according to spell. Wouldn't know til i actually try though.
Yeah I don't think that is correctly defined as lag though, there is a massive overhead when running a debugger that you don't get when running the game without it.
I'm mostly concerned about latency lag I guess, I'm not 100% sure how the client-server is setup for SC2.
Why not just aggregate the amount you heal in some variable and deal with it later?
The direct spell is easy to do - just add the amount healed to the variable.
The aura is more complicated, albeit doable - do you have access to the aura details? Can you plant some code in what happens to units in the aura? If so, it's just a matter of planting the same code you have in a direct spell in there. Concerning lag and aura-updating: you can set the update to happen not every time but every few times the units gets healed by the aura. That way the local aggregator for the aura would be updated without causing any kind of net traffic (unless I have the running model wrong) and only when you update the "global" aggregator will anything be transferred to other players. I know it won't be EXACTLY what you're looking for, but it's a reasonable compromise that will give you the approximate same behaviour.
How is the direct spell easy to do? What if your spell heals for 50, but the unit only needs 10 health healed. I need to record that 10 health was healed and not 50. Is there a way to determine how much was actually healed by the spell?
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey all, does anyone know of a way to track the amount healed by a unit?
I have a couple of abilities, one that channels healing and one that instant heals a chunk of life, but would like to be able to track this via triggers. I can kinda track the channelled healing in a round about way, but the instant heal seems a bit more difficult, particularly because I need to know the actual amount healed.
@KratsAU: Go
You could add a periodic check for hitpoints, however this would also detect the unit's natural regeneration.
Thanks, but I also wouldn't be able to determine who did the healing.
To clarify, I have a hero unit with multiple heal abilities. I need to track how much healing the Hero does to other units. There doesn't seem to be a simple way to do this, it is possible but is a bit of mucking around, was hoping for something similar.
There is a trigger event somewhere to detect when a units hitpoints (property) changes. What I suppose you could do is have every healing ability add an invisible behavior to the unit it healed. In the event the hitpoint is changed, check the unit for heal flag behaviors and determine the source of the behavior?
But this would also detect regeneration.. and it lags the game like mad. Maybe add the behavior, then do a periodic check for the behaviors and their sources?
(Not sure if theres a way to track behavior source though)
I think there was also an event for, detect when unit becomes target of spell. That would probably be a better bet if it exists.
Thanks, currently I'm detecting when hitpoints change. I've disabled regeneration on the majority of units so it might not lag too much, and I have conditionals that should break it out of the trigger pretty early. I can also just turn this trigger on/off just when someone uses a particular spell if the lag is an issue.
But yeah that's pretty much how I've done it with behaviours for one of them, not necessary for the channel healing though. Couldn't see an event to detect when a unit was the target of a spell unfortunately.
Is there any way to tell if it will be laggy? Some debug monitoring?
@KratsAU: Go
What I noticed is that the lag usually comes as a result to events triggering very quickly when the debugger is open. Its not so noticeable when you're full screen in game, but there is still a risk of it happening. You can press Ctrl+F in game, it turns on the game framerate. As long as framerate is refreshing greater than 60, there shouldn't be any visual lag. Anything less and it appears choppy.
Like you say, A possible way to solve it is to have the trigger turn on and off according to spell. Wouldn't know til i actually try though.
Yeah I don't think that is correctly defined as lag though, there is a massive overhead when running a debugger that you don't get when running the game without it.
I'm mostly concerned about latency lag I guess, I'm not 100% sure how the client-server is setup for SC2.
Why not just aggregate the amount you heal in some variable and deal with it later? The direct spell is easy to do - just add the amount healed to the variable. The aura is more complicated, albeit doable - do you have access to the aura details? Can you plant some code in what happens to units in the aura? If so, it's just a matter of planting the same code you have in a direct spell in there. Concerning lag and aura-updating: you can set the update to happen not every time but every few times the units gets healed by the aura. That way the local aggregator for the aura would be updated without causing any kind of net traffic (unless I have the running model wrong) and only when you update the "global" aggregator will anything be transferred to other players. I know it won't be EXACTLY what you're looking for, but it's a reasonable compromise that will give you the approximate same behaviour.
How is the direct spell easy to do? What if your spell heals for 50, but the unit only needs 10 health healed. I need to record that 10 health was healed and not 50. Is there a way to determine how much was actually healed by the spell?