• 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.

Insantly moving a unit without interrupting its orders

Status
Not open for further replies.
Level 8
Joined
Mar 12, 2008
Messages
437
[Solved] Insantly moving a unit without interrupting its orders

Is what is said in the title possible? I think I've seen it in MaD Balls Arena. Some guy told me to move it to coordinates instead of a point, but that did not do any difference. Is it done in JASS?
 
Last edited:
Level 8
Joined
Mar 12, 2008
Messages
437
QueenOfOblivion, that's not quite the effect I'm looking for.
The Reborn Devil, I will try those.


Edit: It didn't quite work. What I want to do is a spell that causes a unit to switch places with the targeted unit. Currently, the spell looks like this:
  • Relocate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Relocate
    • Actions
      • Set U[1] = (Casting unit)
      • Set U[2] = (Target unit of ability being cast)
      • Set P[1] = (Position of U[1])
      • Set P[2] = (Position of U[2])
      • Set R[1] = (X of P[1])
      • Set R[2] = (Y of P[1])
      • Set R[3] = (X of P[2])
      • Set R[4] = (Y of P[2])
      • Custom script: call SetUnitX(udg_U[1], udg_R[1])
      • Custom script: call SetUnitY(udg_U[1], udg_R[2])
      • Custom script: call SetUnitY(udg_U[2], udg_R[3])
      • Custom script: call SetUnitY(udg_U[2], udg_R[4])
      • Custom script: call RemoveLocation(udg_P[1])
      • Custom script: call RemoveLocation(udg_P[2])
Should I use "GetLocationX/Y" instead of "Set Something = (Y of Asdf)"?
 
Last edited:
Level 22
Joined
Dec 31, 2006
Messages
2,216
QueenOfOblivion, that's not quite the effect I'm looking for.
The Reborn Devil, I will try those.


Edit: It didn't quite work. What I want to do is a spell that causes a unit to switch places with the targeted unit. Currently, the spell looks like this:
  • Relocate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Relocate
    • Actions
      • Set U[1] = (Casting unit)
      • Set U[2] = (Target unit of ability being cast)
      • Set P[1] = (Position of U[1])
      • Set P[2] = (Position of U[2])
      • Set R[1] = (X of P[1])
      • Set R[2] = (Y of P[1])
      • Set R[3] = (X of P[2])
      • Set R[4] = (Y of P[2])
      • Custom script: call SetUnitX(udg_U[1], udg_R[1])-----------\WRONG\
      • Custom script: call SetUnitY(udg_U[1], udg_R[2])-----------\WRONG\
      • Custom script: call SetUnitY(udg_U[2], udg_R[3])-----------\DOUBLE WRONG\
      • Custom script: call SetUnitY(udg_U[2], udg_R[4])-----------\WRONG\
      • Custom script: call RemoveLocation(udg_P[1])
      • Custom script: call RemoveLocation(udg_P[2])
Should I use "GetLocationX/Y" instead of "Set Something = (Y of Asdf)"?

Here's the trigger:
  • Relocate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Relocate
    • Actions
      • Set U[1] = (Casting unit)
      • Set U[2] = (Target unit of ability being cast)
      • Set P[1] = (Position of U[1])
      • Set P[2] = (Position of U[2])
      • Set R[1] = (X of P[1])
      • Set R[2] = (Y of P[1])
      • Set R[3] = (X of P[2])
      • Set R[4] = (Y of P[2])
      • Custom script: call SetUnitX(udg_U[1], udg_R[3])
      • Custom script: call SetUnitY(udg_U[1], udg_R[4])
      • Custom script: call SetUnitX(udg_U[2], udg_R[1])
      • Custom script: call SetUnitY(udg_U[2], udg_R[2])
      • Custom script: call RemoveLocation(udg_P[1])
      • Custom script: call RemoveLocation(udg_P[2])
 
Level 8
Joined
Mar 12, 2008
Messages
437
Here's the trigger:
  • Relocate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Relocate
    • Actions
      • Set U[1] = (Casting unit)
      • Set U[2] = (Target unit of ability being cast)
      • Set P[1] = (Position of U[1])
      • Set P[2] = (Position of U[2])
      • Set R[1] = (X of P[1])
      • Set R[2] = (Y of P[1])
      • Set R[3] = (X of P[2])
      • Set R[4] = (Y of P[2])
      • Custom script: call SetUnitX(udg_U[1], udg_R[3])
      • Custom script: call SetUnitY(udg_U[1], udg_R[4])
      • Custom script: call SetUnitX(udg_U[2], udg_R[1])
      • Custom script: call SetUnitY(udg_U[2], udg_R[2])
      • Custom script: call RemoveLocation(udg_P[1])
      • Custom script: call RemoveLocation(udg_P[2])

lol, epic phail :D

It works now btw. +rep

What do you mean?

If the unit has multiple orders in the order queue.
...or is there possibly a way to check if a unit has multiple orders in the queue?
 
Status
Not open for further replies.
Top