Hey i made channeling ability with trigger with following setup:
Unit Using Abil
while current order = abil
do stuff
wait 2 seconds
However if i cancel my abil and then use it again while my trigger waits this 2 seconds i'm getting like duplication of this periodic events, so my "stuff" doing twice and so on. Can i somehow break this loop during this "wait" duration or maybe i need some other approach for doing this kind of abil? The stop trigger action is not the option because i have many units which using this trigger
Turn off function will turn off all copies of current trigger ? Or only for current unit? Because i have many units that may use this abil at the same time.
Also, tell us exactly, what you want to achieve with this trigger, otherwise we are just guessing here. There is probably an alternative solution to your problem.
In general, the event shouldn't fire multiple times per ability cast and unit, unless you didn't specify a stage it should fire at. Also, for executions on other units to affect another instance of the trigger, you would need to use global variables of some sort.
Hey man, here are two maps "abil" is the trigger for my abil and thor (uses raynor model) is my unit. SO first map represents issue that i've described and in second map i tried to fix this stuff but it sometimes lauhces two effects again :/. I'm rly dumb at this just want somebody guide me to the right way in making such kind of triggers. Help will be appreciated (if that isn't obvious :D)
I think the problem lies with the event. The stage is set to "Effect4 - Channel" which means this will fire if a unit starts to channel a ability. If you set it to "Effect5 - Finish" it will fire when it has finished the channel stage.
Thanks man for time you spent on this but i'd like something similiar to my second map, just so i can change targets quick and freely. Just need some attention from skilled triggerers so they can like check my homework on mistakes and give some advises. Just want my trigger spells to be optimised and polished.
I believe I see the problem. While the first trigger is waiting, you use the ability again causing a second trigger to run. After the waiting is done on the first trigger all the condition checks will still see that the unit is using the ability still and will keep running. My idea is to set a variable to a random real number, set this random number to the units custom value, and each time you do the condition checks check the units custom value for this random number. If a second trigger was to start while the first one is waiting the second trigger would change the units custom value to a new random number and the first trigger would see the incorrect number and stop.
Make the channeling ability spawn a unit periodically for the casting player (via data), then run the trigger using the Unit Is Created event. Immediately remove the created unit, then run your actions. The trigger unit should only be created while the casting unit is channeling. You can use "owner of created unit" to find the casting player.
The actions won't duplicate and will be much simpler to design.
Make the channeling ability spawn a unit periodically for the casting player (via data), then run the trigger using the Unit Is Created event. Immediately remove the created unit, then run your actions. The trigger unit should only be created while the casting unit is channeling. You can use "owner of created unit" to find the casting player.
The actions won't duplicate and will be much simpler to design.
Magnifico! Learning new things all the time. But doesn't this count as cheating since its data and not triggers? :)
Data sucks. I want period duration depends on weapon cooldown, including all bonuses for attack speed that unit might have. Data fails to make such kind of functionality. Thats why im trying to use it only for visuals (actors).
That should be simple enough to do with a combination of data and triggers. You can modify the period of an ability using the Catalog Field Value Set function. Do this in triggers and adjust the period based on the unit's weapon. Or you can apply a stacking incremental upgrade.
If you have multiple units owned by the same player using this ability, you can apply a stacking buff which incrementally modifies the casting unit's timescale. It will take a little experimentation to get it to scale the way you would like, but this should get you the effect you're looking for. Make sure you remove the buffs when the unit finishes casting.
The third alternative is to make the period for the casting behavior very short and, in your Unit Is Created trigger, remove the unit and add 1 to an integer variable. When that variable exceeds the casting unit's weapon period, execute the desired actions. Although simple, I would advise against using this for a large quantity of units since it would involve rapidly firing many events over a (potentially) short period of time. There are ways around even this, but they're a little more complex than I'd like to get into at this time.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey i made channeling ability with trigger with following setup:
Unit Using Abil
while current order = abil
do stuff
wait 2 seconds
However if i cancel my abil and then use it again while my trigger waits this 2 seconds i'm getting like duplication of this periodic events, so my "stuff" doing twice and so on. Can i somehow break this loop during this "wait" duration or maybe i need some other approach for doing this kind of abil? The stop trigger action is not the option because i have many units which using this trigger
Post trigger please.
There is a function called "break", which will stop the loop process. And you can't stop a built-in function once it has started.
How about adding a "Turn current trigger off" at the beginning and "Turn current trigger on" at the end of your trigger?
Turn off function will turn off all copies of current trigger ? Or only for current unit? Because i have many units that may use this abil at the same time.
Also, tell us exactly, what you want to achieve with this trigger, otherwise we are just guessing here. There is probably an alternative solution to your problem.
In general, the event shouldn't fire multiple times per ability cast and unit, unless you didn't specify a stage it should fire at. Also, for executions on other units to affect another instance of the trigger, you would need to use global variables of some sort.
Hey man, here are two maps "abil" is the trigger for my abil and thor (uses raynor model) is my unit. SO first map represents issue that i've described and in second map i tried to fix this stuff but it sometimes lauhces two effects again :/. I'm rly dumb at this just want somebody guide me to the right way in making such kind of triggers. Help will be appreciated (if that isn't obvious :D)
I think the problem lies with the event. The stage is set to "Effect4 - Channel" which means this will fire if a unit starts to channel a ability. If you set it to "Effect5 - Finish" it will fire when it has finished the channel stage.
Edit: Ok nvm that.
Thats not the case..... i think i need kueken or bashar teg here :) or miles he is pro ...
@abvdzh: Go
Here try this
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Thanks man for time you spent on this but i'd like something similiar to my second map, just so i can change targets quick and freely. Just need some attention from skilled triggerers so they can like check my homework on mistakes and give some advises. Just want my trigger spells to be optimised and polished.
I believe I see the problem. While the first trigger is waiting, you use the ability again causing a second trigger to run. After the waiting is done on the first trigger all the condition checks will still see that the unit is using the ability still and will keep running. My idea is to set a variable to a random real number, set this random number to the units custom value, and each time you do the condition checks check the units custom value for this random number. If a second trigger was to start while the first one is waiting the second trigger would change the units custom value to a new random number and the first trigger would see the incorrect number and stop.
Make the channeling ability spawn a unit periodically for the casting player (via data), then run the trigger using the Unit Is Created event. Immediately remove the created unit, then run your actions. The trigger unit should only be created while the casting unit is channeling. You can use "owner of created unit" to find the casting player.
The actions won't duplicate and will be much simpler to design.
Magnifico! Learning new things all the time. But doesn't this count as cheating since its data and not triggers? :)
@zandose: Go
Ah but my map was the only real all trigger solution he could do. Data would actually be a much better way to create this ability.
Still alive and kicking, just busy.
My guide to the trigger editor (still a work in progress)
Data sucks. I want period duration depends on weapon cooldown, including all bonuses for attack speed that unit might have. Data fails to make such kind of functionality. Thats why im trying to use it only for visuals (actors).
@abvdzh: Go
That should be simple enough to do with a combination of data and triggers. You can modify the period of an ability using the Catalog Field Value Set function. Do this in triggers and adjust the period based on the unit's weapon. Or you can apply a stacking incremental upgrade.
If you have multiple units owned by the same player using this ability, you can apply a stacking buff which incrementally modifies the casting unit's timescale. It will take a little experimentation to get it to scale the way you would like, but this should get you the effect you're looking for. Make sure you remove the buffs when the unit finishes casting.
The third alternative is to make the period for the casting behavior very short and, in your Unit Is Created trigger, remove the unit and add 1 to an integer variable. When that variable exceeds the casting unit's weapon period, execute the desired actions. Although simple, I would advise against using this for a large quantity of units since it would involve rapidly firing many events over a (potentially) short period of time. There are ways around even this, but they're a little more complex than I'd like to get into at this time.