As some of you may be aware, the Auto Turret Timed Life behavior is able to fire periodic effects. I need to catch these events somehow and fire off a trigger.
I've searched the Wiki but maybe i overlooked something because I can't find such an event.
Either that or I would need to somehow catch the event that the timed life expires (but this would mean i have to keep readding the behavior which is really annoying.)
The question is, Is there a way to catch an event when a Unit comes under a specific effect?
If not, are there any workarounds to catching the event that a unit comes under a behavior or effect?
Use a new damage effect with 0 damage. Apply it as periodic effect for the behavior (or whereelse you need it).
Then you can catch it with the Unit Takes Damage by X Effect event.
I believe i got ya on this one. I have a UI which uses single buttons to do all sorts of stuff. One of the hurdles i had to overcome was to make it so abilities could be turned on and turned off via a single ability. Rather than make the ability have to change in some way, or get crazy in the data editor (which would have been pretty complex) i actually give the unit a dummy ability along with the regular abilities. Cloak for instance, would be assigned to hotkey 1. When you hit it, it puts a dummy cloak behavior on the unit. A trigger with the event (unit gains behaviour) registers the cast, and then detects the current state of the unit (is cloaked, or isnt cloaked). Whatever the case, it applys the opposite effect. Using this, all of my turn on, turn off abilities can be controlled by a single ability tied to a trigger.
I would look to a dummy behaviour to trigger the event of a trigger. Then you simulate the ability being cast via a trigger. If this isnt what your asking, let me know.
That sound's like exactly what I'm looking for. Will test it out when i'm able.
Not quite what I'm looking for coronbale, but thats very informative, thanks for sharing that info.
What I actually intend to do is to have my unit grow in size whenever the effect occurs. Indefinitely until the unit is highlighted, then i remove the unit. Thus I need a behavior with a periodic effect. Can anyone tell me if I'm on the right track if i build my dummy behavior off auto-turret timed life? Because i'm not too sure if its possible to have timed life that never expires.
You can. My leveling system uses behaviors that have a 0 duration, and are basically on the unit full time. Didnt like the built in ones. Anywhoose, if you are trying to scale up the size of something through dummy behaviors, heres how you can do it. Have the behavior put on the unit. Once on the unit, a trigger fires, detecting that the behavior was put on the unit. Have the trigger increase the size of the unit, and remove the behaviour. If the behavior is put on again, the same trigger fires, and the unit is increased in size again and the behavior is removed again. Same trigger is used, so same increment occurs. Then a highlight trigger to remove the unit.
That does sound like it would work, but would I not need a periodic trigger in galaxy/gui to re-add the behavior each time? Is it possible to have a behavior with a periodic effect that occurs once every 0.01 seconds? If so, would this be a heavy load on the processor?
I currently have 2 triggers:
A: Unit Growth, Needs to grow from a scale of 100% to 7000% with increments of 100% (Currently uses a while loop, 70 iterations)
B: Hit Test
The issue faced is that the while loop in Trigger A seems to locks up the processor, preventing trigger B from performing it's actions until it's too late. The current workaround I have in mind is to have a behavior with a periodic effect (based off auto-turret) instead and to change Trigger A so it only scales once per periodic event firing off the behavior. Since the trigger would then only need to perform a few instructions (That is, scaling the unit up once), as opposed to an entire while loop, it should theoretically be much faster and still allow hit tests to fire on time.
Quote:
You can. My leveling system uses behaviors that have a 0 duration, and
are basically on the unit full time.
Almost forgot to ask, how did you accomplish this? Are you actually re-adding the behaviors? Or does it just somehow stay there and fire up whenever you check if the unit has a behavior?
Behavior with 0 duration will be on the unit permanently until disabled otherwise. A periodic effect on that behavior will fire everytime. Even if the period is set to 0.001 i think it still rescale back to 1/32s or so
As some of you may be aware, the Auto Turret Timed Life behavior is able to fire periodic effects. I need to catch these events somehow and fire off a trigger. I've searched the Wiki but maybe i overlooked something because I can't find such an event.
Either that or I would need to somehow catch the event that the timed life expires (but this would mean i have to keep readding the behavior which is really annoying.)
The question is, Is there a way to catch an event when a Unit comes under a specific effect? If not, are there any workarounds to catching the event that a unit comes under a behavior or effect?
Use a new damage effect with 0 damage. Apply it as periodic effect for the behavior (or whereelse you need it).
Then you can catch it with the Unit Takes Damage by X Effect event.
I believe i got ya on this one. I have a UI which uses single buttons to do all sorts of stuff. One of the hurdles i had to overcome was to make it so abilities could be turned on and turned off via a single ability. Rather than make the ability have to change in some way, or get crazy in the data editor (which would have been pretty complex) i actually give the unit a dummy ability along with the regular abilities. Cloak for instance, would be assigned to hotkey 1. When you hit it, it puts a dummy cloak behavior on the unit. A trigger with the event (unit gains behaviour) registers the cast, and then detects the current state of the unit (is cloaked, or isnt cloaked). Whatever the case, it applys the opposite effect. Using this, all of my turn on, turn off abilities can be controlled by a single ability tied to a trigger.
I would look to a dummy behaviour to trigger the event of a trigger. Then you simulate the ability being cast via a trigger. If this isnt what your asking, let me know.
@s3rius: Go
+1, this is a really useful 'hack' to translate effect's callings to something you can then anticipate and react to with triggers.
@s3rius: Go
That sound's like exactly what I'm looking for. Will test it out when i'm able.
Not quite what I'm looking for coronbale, but thats very informative, thanks for sharing that info.
What I actually intend to do is to have my unit grow in size whenever the effect occurs. Indefinitely until the unit is highlighted, then i remove the unit. Thus I need a behavior with a periodic effect. Can anyone tell me if I'm on the right track if i build my dummy behavior off auto-turret timed life? Because i'm not too sure if its possible to have timed life that never expires.
@FuzzYD: Go
You can. My leveling system uses behaviors that have a 0 duration, and are basically on the unit full time. Didnt like the built in ones. Anywhoose, if you are trying to scale up the size of something through dummy behaviors, heres how you can do it. Have the behavior put on the unit. Once on the unit, a trigger fires, detecting that the behavior was put on the unit. Have the trigger increase the size of the unit, and remove the behaviour. If the behavior is put on again, the same trigger fires, and the unit is increased in size again and the behavior is removed again. Same trigger is used, so same increment occurs. Then a highlight trigger to remove the unit.
Hope this helps
@coronbale: Go
That does sound like it would work, but would I not need a periodic trigger in galaxy/gui to re-add the behavior each time? Is it possible to have a behavior with a periodic effect that occurs once every 0.01 seconds? If so, would this be a heavy load on the processor?
I currently have 2 triggers:
The issue faced is that the while loop in Trigger A seems to locks up the processor, preventing trigger B from performing it's actions until it's too late. The current workaround I have in mind is to have a behavior with a periodic effect (based off auto-turret) instead and to change Trigger A so it only scales once per periodic event firing off the behavior. Since the trigger would then only need to perform a few instructions (That is, scaling the unit up once), as opposed to an entire while loop, it should theoretically be much faster and still allow hit tests to fire on time.
Almost forgot to ask, how did you accomplish this? Are you actually re-adding the behaviors? Or does it just somehow stay there and fire up whenever you check if the unit has a behavior?
@FuzzYD: Go
Behavior with 0 duration will be on the unit permanently until disabled otherwise. A periodic effect on that behavior will fire everytime. Even if the period is set to 0.001 i think it still rescale back to 1/32s or so
@progammer: Go
Thanks for clearing that up. Coronbale's method makes sense to me now. Also, Thanks for all the feedback everyone. =)