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

Movement via triggers which won't interrupt orders

Status
Not open for further replies.
Hi, is there any way that I can make movement via triggers (preferably GUI, or at least GUI-friendly) which will not interrupt movement and/or other orders?

Basically, I am making a jump ability that should allow you to do stuff mid-air just as if you were on the ground. But, I want to make it in a way that you can't control your movement. If you jump in a direction, you keep moving in the same direction until you land.

Any thoughts? Please, I need this urgently.
This goes without saying, but I will +rep for help :)

An example of what i need is in the Warlock map.
 
Level 5
Joined
Jan 27, 2014
Messages
164
By setting unit X/Y coordinates.
This will not interrupt the unit's order.
Here is a simple GUI-friendly version of trigger:
Code:
Actions
    Set unit = (Triggering unit)
    Set point1 = (Position of unit)
    Set point2 = (point1 offset by 10.00 towards (Facing of unit) degrees)
    Set real1 = (X of point2)
    Set real2 = (Y of point2)
    Custom script:   call SetUnitX ( udg_unit , udg_real1 )
    Custom script:   call SetUnitY ( udg_unit , udg_real2 )
    Custom script:   call RemoveLocation (udg_point1)
    Custom script:   call RemoveLocation (udg_point2)
All the variables are GUI globals.
The only JASS custom scripts are these:
Code:
    Custom script:   call SetUnitX ( udg_unit , udg_real1 )
    Custom script:   call SetUnitY ( udg_unit , udg_real2 )
 
First answer was already correct, but I even would prefer using only reals, because in fact these two locations are not needed anymore.
  • Custom script: local unit u = GetTriggerUnit()
  • Custom script: local real offset = 10
  • Custom script: local real angle = GetUnitFacing(u) * bj_DEGTORAD
  • Custom script: call SetUnitX(u, GetUnitX(u) + offset * Cos(angle))
  • Custom script: call SetUnitY(u, GetUnitY(u) + offset * Sin(angle))
  • Custom script: set u = null
No GUI variables needed in here, because all are declared local.
 
Last edited:
First answer was already correct, but I even would prefer using only reals, because in fact these two locations are not needed anymore.
  • Custom script: local unit u = GetTriggerUnit
  • Custom script: local real offset = 10
  • Custom script: local real angle = GetUnitFacing(u) * bj_DEGTORAD
  • Custom script: call SetUnitX(u, GetUnitX(u) + offset * Cos(angle))
  • Custom script: call SetUnitY(u, GetUnitY(u) + offset * Sin(angle))
  • Custom script: set u = null
No GUI variables needed in here, because all are declared local.

Thanks :)
I use GUI though, so I am kinda used to dealing with variables, and I don't really want to change that now :)



Admin, you can close the thread.
 
Status
Not open for further replies.
Top