• 🏆 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!

Target will change position with caster

Status
Not open for further replies.
Level 12
Joined
Mar 26, 2005
Messages
790
simple spell, caster and target of spell will change their positions

I have this triger

  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Exchange
  • Actions
    • Unit - Create 1 DUMMY UNIT for Neutral Passive at (Position of (Casting unit)) facing Default building facing degrees
    • Unit - Move (Casting unit) instantly to (Position of (Target unit of ability being cast))
    • Unit - Move (Target unit of ability being cast) instantly to (Position of (Last created unit))
    • Wait 2.00 seconds
    • Unit - Remove (Last created unit) from the game
caster will move to the position of target, but target will stay there.
 
Level 12
Joined
Mar 26, 2005
Messages
790
ok, nevermind, instead of creating dummy on caster, move caster to target and move target to dummy I created dummy on target, move target to caster, and move caster to dummy and it works


you can close this thread
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
You, know there is a variable of type Location (or maybe point).
P.s. This leaks. Search for tutorial on leaks.
 
Level 11
Joined
Apr 6, 2008
Messages
760
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Exchange
  • Actions
  • Set TempUnit = (Triggering Unit)
  • Set TempUnit2 = (Target unit of ability being cast)
  • Set TempPoint = (Position of (TempUnit))
  • Set TempPoint2 = (Position of (TempUnit2))
  • Unit - Move TempUnit instantly to TempPoint2)
  • Unit - Move TempUnit2 instantly to TempPoint)
  • Custom Script: call RemoveLocation(udg_TempPoint)
  • Custom Script: call RemoveLocation(udg_TempPoint2)
tell me why u made that dummt unit :eek:
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
That is what I meant.
But note that using the GUI move unit checks for pathability/collision.
So doing so will cause problems(move the caster next to where he should be).
So moving one of the units to a random place(like center of map) then moving the other one, then moving the first.
I am not sure if turning off collision will work(I seem to think that Move Unit instantly still checks for pathing).
 
Status
Not open for further replies.
Top