Hi, I'm working with a friend on creating a mod - we've been trying to figure out how to force the Zealot to complete his attack animation before being able to move, similarly to how they acted in BW. In SC2 if you attack a target with a Zealot, you can instantly issue a move command without the animation completing. Neither of us are experienced with the editor so forgive me if this is a very simple problem.
We've tried changing the damage point, the random attack delay, the period values of his attacks but we can't get it to act how we want it to..
No apology needed. This is somewhat tricky to solve because of how the Zealot attack is coded. It creates a persistent on the target, leading it to taking the damage correctly. Normally the animation would line up with this, but obviously you can move and end the animation.
What you will need to do is alter the persistent to apply a behavior to the zealot at the start of the attack that renders him immobile, and once the attack is complete, remove the behavior, freeing the Zealot up to move.
You will need to create a behavior and set it to be hidden (Flags: Hidden). Set its Modification - Modify Flags - Suppress Movement filed to Enabled.
Then you will want to create an apply behavior effect. This effect should have the Unit: Value field set to Caster (so it places the behavior on the Zealot). Then create a remove behavior effect, also set its Unit: Value field to Caster. Both of these effects should reference the Behavior you created before (Behaviors field in Remove Behavior effect, Behavior field in Apply Behavior effect).
Finally, place the apply behavior effect in the Initial Effect of the Zealot - Psi Blades effect (its a Create Persistent effect). Place the Remove Behavior effect in the Final effect field.
The add/remove behavior effects both are linked to the behavior, and the Effect: Unit value is set to caster but ingame the Zealot can still freely move.
I haven't looked at everything, but what I noticed is that you definitely need to set the behavior type to buff instead of attribute. Also it is advisable to set the "hidden" flag only once you are sure that the behavior is applied and removed correctly.
One question: whilst the Zealot is attacking he is unable to be issued move commands, is there a way to modify so that I can issue a move command that he will follow after completing his attack?
Default sc2 backswings cancel when a unit goes out of another units range slop. Increase that to ensure he finishes his attack.
If you want a non-cancelable backswing for a unit to act more like BW, here is the method I've used many times in the past and it works great.
Make a set effect that includes both an apply behavior and your damage or launch missile effect.
Next, make the our first buff behavior that AP is calling. We'll name it backswing for now.
Change Behavior: Modification: Unified Movement Speed Factor to -0.99. This will stop it from turning or going anywhere any time fast.
The duration of .8 on this behavior felt pretty good to me.
Lastly, with short duration behaviors you have to set another apply behavior that cancels out the first one so the modification to the unit doesn't stick around past its welcome.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi, I'm working with a friend on creating a mod - we've been trying to figure out how to force the Zealot to complete his attack animation before being able to move, similarly to how they acted in BW. In SC2 if you attack a target with a Zealot, you can instantly issue a move command without the animation completing. Neither of us are experienced with the editor so forgive me if this is a very simple problem.
We've tried changing the damage point, the random attack delay, the period values of his attacks but we can't get it to act how we want it to..
No apology needed. This is somewhat tricky to solve because of how the Zealot attack is coded. It creates a persistent on the target, leading it to taking the damage correctly. Normally the animation would line up with this, but obviously you can move and end the animation.
What you will need to do is alter the persistent to apply a behavior to the zealot at the start of the attack that renders him immobile, and once the attack is complete, remove the behavior, freeing the Zealot up to move.
You will need to create a behavior and set it to be hidden (Flags: Hidden). Set its Modification - Modify Flags - Suppress Movement filed to Enabled.
Then you will want to create an apply behavior effect. This effect should have the Unit: Value field set to Caster (so it places the behavior on the Zealot). Then create a remove behavior effect, also set its Unit: Value field to Caster. Both of these effects should reference the Behavior you created before (Behaviors field in Remove Behavior effect, Behavior field in Apply Behavior effect).
Finally, place the apply behavior effect in the Initial Effect of the Zealot - Psi Blades effect (its a Create Persistent effect). Place the Remove Behavior effect in the Final effect field.
Thanks for the response!
I've tried the add/remove behavior effect but it doesn't seeming to be having any effect, I've probably made an error somewhere..
Here's what I have:
http://i.imgur.com/6i4JhgW.png?1
http://i.imgur.com/28bOuNK.png?1
http://i.imgur.com/hgUhtrW.png
The add/remove behavior effects both are linked to the behavior, and the Effect: Unit value is set to caster but ingame the Zealot can still freely move.
I haven't looked at everything, but what I noticed is that you definitely need to set the behavior type to buff instead of attribute. Also it is advisable to set the "hidden" flag only once you are sure that the behavior is applied and removed correctly.
Ah, thank you, now it works. :)
One question: whilst the Zealot is attacking he is unable to be issued move commands, is there a way to modify so that I can issue a move command that he will follow after completing his attack?
You can set the "backswing" of the zealot's animation to fit the time in which he needs to finish his animation.
Default sc2 backswings cancel when a unit goes out of another units range slop. Increase that to ensure he finishes his attack.
If you want a non-cancelable backswing for a unit to act more like BW, here is the method I've used many times in the past and it works great.
Make a set effect that includes both an apply behavior and your damage or launch missile effect.
Next, make the our first buff behavior that AP is calling. We'll name it backswing for now. Change Behavior: Modification: Unified Movement Speed Factor to -0.99. This will stop it from turning or going anywhere any time fast.
The duration of .8 on this behavior felt pretty good to me.
Lastly, with short duration behaviors you have to set another apply behavior that cancels out the first one so the modification to the unit doesn't stick around past its welcome.