• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Why doesn't this work?

Status
Not open for further replies.

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
Unit - Pause Phase_Unit
Wait 2 seconds
Unit - Unpause Phase_Unit

I'm trying to make a Phase Shift spell like puck, I have tried using a dummy and stun the unit but its not as responsive as i like.
Ofc im gonna add:
Unit - Make Phase_Unit Invulnerable
Unit - Make Phase_Unit Vulnerable
later, and some effects
 
Level 23
Joined
Oct 12, 2008
Messages
1,783
Don't use wait, use timer instead and make this spell MUI.

Although good advice, its irrelevant to his problem.
If his trigger isn't working with the above setup, it wouldn't work even if you used timers.

It would be easier to help if you posted the entire trigger, event, conditions and all.
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
VanishWorgen
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Vanish
Actions
Set Vanish_Unit = (Casting unit)
Unit - Make Vanish_Unit Invulnerable
Unit - Pause Vanish_Unit
Wait 2 seconds
Unit - Unpause Vanish_Unit
Unit - Make Vanish_Unit Vulnerable


that's all I've got, I thought that would work
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
VanishWorgen
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Vanish
Actions
Set Vanish_Unit = (Triggering unit)

Unit - Make Vanish_Unit Invulnerable
Unit - Pause Vanish_Unit
Wait 2.00 game-time seconds
Unit - Unpause Vanish_Unit
Unit - Make Vanish_Unit Vulnerable

Still doesn't work, he never "unpauses"
 
Pausing unit is usually not a good way to code, try avoiding it.

After the "Wait 2 seconds" your unit variable may be overwritten. Or you use TriggeringUnit after the wait or you reset your variable.

If you pause a unit, it's order will ordered after unpaused I think.

So it unpauses --> immediatly try to cast spell again --> pause again. (loop)

Try to use this after you pause unit: (and before the wait)
  • Custom script: call IssueImmediateOrder(udg_Make Vanish_Unit, "stop")
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
Thanks for the response!
Yes the invulnerable part works.
Icemann, with your custom script, the ability works, but the user can "interrupt" the ability by giving the unit a command. The ideal thing would be if he "stunned" himself for 2 sec.
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
I've done that but its a second delay after you command the unit to cast the ability, but i think that's the only solution i have atm. And the stun conflicts with the invulnerable part . so i they wont be simultaneously. Hmm this was a lot harder than i thought
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
Never used GUI or Jass or anything so I think i have to make another spell
 

eid

eid

Level 2
Joined
Sep 15, 2013
Messages
11
I just move the unit instant to the corner of the map and then wait 2 sec and then return him back
 
Status
Not open for further replies.
Top