Compared to WC3, a stun in SC2 is rather... tedious.
A stun is usually achieved by applying a behavior with the Disable Abilities flag set, possibly with added Suppress Movement flag.
In WC3, you would stun a unit; it would become immovable and unable to cast spells, but you were able to queue any order you want, and it would be executed instantly, after the stun wears off.
In SC2, handling a stunned unit becomes a nuisance. After the stun wears off, the unit has no order whatsoever. You cannot select an order beforehand, so there will be a small delay after the stun, where the unit does as it wishes.
Issuing a move order via right-click might be just fine, but casting a spell as fast as possible gets further delayed, because you cannot select the button beforehand.
Also all order attempts will be cancelled when being stunned, the order queue gets deleted etc etc.
I would like to be able to use a WC3-like stun in SC2, but afaik, there is not a known possibility to do so (correct me, if I am wrong).
Now I discovered, making a unit dance using the /dance command does exactly, what I want: It "stuns" the unit; you cannot issue any orders, but no abilities are really disabled and you can still queue orders. Perfect!(except spells flagged as transient can still be casted, and the animation, of course ;) )
So, how do I make use of it? I did not see any behavior/ability or trigger action to force a unit to dance; also at its current state, it does only work with models utilizing a dance animation.
Is dancing completely hardcoded? Can we somehow make use of it? Or is there another way to re-create a WC3 stun?
So just make an ability that has the unit do nothing for X time and it can't do anything while casting? That would work!
Hmm, we would need to give this ability to all units, which should be stunnable. Would even provide an easy way to make a unit immune to stuns. Just deactivate the ability or don't give it to that unit...
It needs to be uninterruptible, and for varying durations, I could try to use a channeled behavior. Also we will need to see, if it cancels other uninterruptible abilities...
Unfortunately, it does not fit my requirements. Transient spells can still be casted, and the system is broken by spells marked as uninterruptible, which I usually do at least for some phases of my spells.
But a nice idea, nonetheless. Without the spell cast times it works just like I want it. So anyone, who does not use the uninterruptible flag for his spells can use this (I probably won't stop using it, because without it I think the feeling of casting spells is terrible - most likely, because I am used to WC3, where you could not cancel a spell with a move command, once casted).
€ I will try to disable abilities for a split second, maybe this will work...
€€ seems to work, however I need to keep the ministun for 2 game ticks (.125 seconds) in order to cancel ability casting. Also transient abilities are still unaffected and the order queue is lost.
They can't do anything, orders are remembered, you can kill them as normal.
It does remember orders? I naturally assumed, it would not. I should not judge based on WC3 experience that much ;)
Testing that as well :D
€ okay, pausing seems to act like setting the time scale to 0: It seems to freeze regenerations, behaviors, cast times... also not exactly, what I want.
The cancelation of the move/attack orders is caused by disabling the move and attack abilities. Could you consider only disabling specific abilities/weapons and reducing the movement speed to 0. Maybe you could replace the buttons for the other abilities with one that applies a buff that issue orders the unit to use the ability once the stun wears off.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
I tried that, works okay-ish, still breaks queued ability commands besides attack and move. No big deal.
However, then I tried an instant pause/unpause via trigger without time delay, and that works even better. It cancels abilities without the need to disable them for a time frame and it keeps any queued ability order, including the order, which was just cancelled. Also, without the need to keep the pause up for a time, all of the negative effects of pausing should be irrelevant.
If I do not find any other bugs, the one and only remaining problem would be, that casting transient abilities is still possible, while you are stunned; however this could probably be circumvented by using validators, or by just allowing/ignoring it; it should not be a big deal.
And once again, data and triggers in combination claim the victory ;) (so far)
This would be my current solution; besides the transient issue I did not find any flaws yet.
I used a data behavior stack to handle stun durations of overlapping stuns. Currently, always the longest remaining stun should prevail.
I added example spells, and useable behaviors for stuns from 1 to 5 seconds. With my current approach, you will need a specific behavior for each duration, but these can be created easily by just copying one of the base behaviors and changing the duration.
The order is done via trigger (caused problems when executed in data), would need to be checked for bnet delay (I doubt, this would be a problem).
One could probably create most of the system via trigger, and create a StunUnitTimed - function.
Anyway, in case someone needs a similar system, I attached it.
Hey.
Compared to WC3, a stun in SC2 is rather... tedious.
A stun is usually achieved by applying a behavior with the Disable Abilities flag set, possibly with added Suppress Movement flag.
In WC3, you would stun a unit; it would become immovable and unable to cast spells, but you were able to queue any order you want, and it would be executed instantly, after the stun wears off.
In SC2, handling a stunned unit becomes a nuisance. After the stun wears off, the unit has no order whatsoever. You cannot select an order beforehand, so there will be a small delay after the stun, where the unit does as it wishes.
Issuing a move order via right-click might be just fine, but casting a spell as fast as possible gets further delayed, because you cannot select the button beforehand.
Also all order attempts will be cancelled when being stunned, the order queue gets deleted etc etc.
I would like to be able to use a WC3-like stun in SC2, but afaik, there is not a known possibility to do so (correct me, if I am wrong).
Now I discovered, making a unit dance using the /dance command does exactly, what I want: It "stuns" the unit; you cannot issue any orders, but no abilities are really disabled and you can still queue orders. Perfect!(except spells flagged as transient can still be casted, and the animation, of course ;) )
So, how do I make use of it? I did not see any behavior/ability or trigger action to force a unit to dance; also at its current state, it does only work with models utilizing a dance animation.
Is dancing completely hardcoded? Can we somehow make use of it? Or is there another way to re-create a WC3 stun?
@Kueken531: Go
So just make an ability that has the unit do nothing for X time and it can't do anything while casting? That would work!
Hmm, we would need to give this ability to all units, which should be stunnable. Would even provide an easy way to make a unit immune to stuns. Just deactivate the ability or don't give it to that unit...
It needs to be uninterruptible, and for varying durations, I could try to use a channeled behavior. Also we will need to see, if it cancels other uninterruptible abilities...
Testing.
Unfortunately, it does not fit my requirements. Transient spells can still be casted, and the system is broken by spells marked as uninterruptible, which I usually do at least for some phases of my spells.
But a nice idea, nonetheless. Without the spell cast times it works just like I want it. So anyone, who does not use the uninterruptible flag for his spells can use this (I probably won't stop using it, because without it I think the feeling of casting spells is terrible - most likely, because I am used to WC3, where you could not cancel a spell with a move command, once casted).
€ I will try to disable abilities for a split second, maybe this will work...
€€ seems to work, however I need to keep the ministun for 2 game ticks (.125 seconds) in order to cancel ability casting. Also transient abilities are still unaffected and the order queue is lost.
What about the Pause/Unpause Unit trigger action?
They can't do anything, orders are remembered, you can kill them as normal.
It does remember orders? I naturally assumed, it would not. I should not judge based on WC3 experience that much ;)
Testing that as well :D
€ okay, pausing seems to act like setting the time scale to 0: It seems to freeze regenerations, behaviors, cast times... also not exactly, what I want.
The cancelation of the move/attack orders is caused by disabling the move and attack abilities. Could you consider only disabling specific abilities/weapons and reducing the movement speed to 0. Maybe you could replace the buttons for the other abilities with one that applies a buff that issue orders the unit to use the ability once the stun wears off.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
I tried that, works okay-ish, still breaks queued ability commands besides attack and move. No big deal.
However, then I tried an instant pause/unpause via trigger without time delay, and that works even better. It cancels abilities without the need to disable them for a time frame and it keeps any queued ability order, including the order, which was just cancelled. Also, without the need to keep the pause up for a time, all of the negative effects of pausing should be irrelevant.
If I do not find any other bugs, the one and only remaining problem would be, that casting transient abilities is still possible, while you are stunned; however this could probably be circumvented by using validators, or by just allowing/ignoring it; it should not be a big deal.
And once again, data and triggers in combination claim the victory ;) (so far)
This would be my current solution; besides the transient issue I did not find any flaws yet.
I used a data behavior stack to handle stun durations of overlapping stuns. Currently, always the longest remaining stun should prevail.
I added example spells, and useable behaviors for stuns from 1 to 5 seconds. With my current approach, you will need a specific behavior for each duration, but these can be created easily by just copying one of the base behaviors and changing the duration.
The order is done via trigger (caused problems when executed in data), would need to be checked for bnet delay (I doubt, this would be a problem).
One could probably create most of the system via trigger, and create a StunUnitTimed - function.
Anyway, in case someone needs a similar system, I attached it.
Thanks for your help.
Can't read this map :/. Could you reupload this map? Thank you (:
So this is a necrobump but I found this thread while looking up solutions for my own problems with stun. I also solved them the same day.
Stuns are really easy to do, just mimic Graviton Beam. It's a stun.
They have since added a stun flag for buffs...
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg