• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Teleport. Switch.

Status
Not open for further replies.
Level 24
Joined
May 9, 2007
Messages
3,561
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)
 
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.
 
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 ;)
 
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
 
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!
 
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.
Back
Top