• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Teleport. Switch.

Status
Not open for further replies.
Level 24
Joined
May 9, 2007
Messages
3,563
Why does this not work?

  • Switch
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Switch
    • Actions
      • Set TempPoint1 = (Position of (Casting unit))
      • Set TempPoint2 = (Position of (Target unit of ability being cast))
      • Unit - Move (Triggering unit) instantly to TempPoint2
      • Wait 0.01 seconds
      • Unit - Move (Target unit of ability being cast) instantly to TempPoint1
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: call RemoveLocation(udg_TempPoint2)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Hm
Set the target of the ability to a variable so that u can use it after the wait.
And note that the triggering unit will "bump" at the targeted unit.
Preventing this requires you to move one of the units somewhere else, move second unit, move first.
Or turn pathing off for one of the units.
I would suggest not using the wait, there is no point in it. But if you want to have an wait, use a polled wait.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Well when you use set a=b you set b to a variable or that is how I say it ;)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
He's trying to say that to swap two variables, a and b, you do

var c = a
a = b
b = c

Though how it has relevance here is beyond me.

It has none whatsoever.
And no.
I will paraphrase -
set a=b
You store b in a variable. I just said set, which is somewhat different but hey it is not a big deal ;)
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Hm
Set the target of the ability to a variable so that u can use it after the wait.

You did not get what I said at the first place, so I explained.

P.s. If you still think you do not get something(which would be untrue) just forget it :D
 
Level 24
Joined
May 9, 2007
Messages
3,563
If you look at my trigger.

Switch
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Switch
Actions
Set TempPoint1 = (Position of (Casting unit))
Set TempPoint2 = (Position of (Target unit of ability being cast))
Unit - Move (Triggering unit) instantly to TempPoint2
Wait 0.01 seconds
Unit - Move (Target unit of ability being cast) instantly to TempPoint1
Custom script: call RemoveLocation(udg_TempPoint1)
Custom script: call RemoveLocation(udg_TempPoint2)

You'll note that i do set it to a varialbe (TempPoint2).

It has always been this way.

But anyways. It was the order that the units moved in that was the problem. Thanks.

+rep for no rep!
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Store the target of the ability in a variable.
You store the location ;)
And I really do not see where this is going. After all you are done with that spell?
 
Last edited:
Status
Not open for further replies.
Top