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

Sliding Units to a point

Status
Not open for further replies.
Level 6
Joined
Jan 2, 2007
Messages
189
Hey all, im working on a spell just for fun and I cant seem to get it to work properly.

What I want is for all enemy units to slowly slide towards the center of a point. In addition, while the units are sliding, the player is able to move the unit away from the center.

Here is what I have so far. Its just the basic trigger:

  • Time - Every 0.04 seconds of game time
  • Actions
    • Set Temp_Point[1] = (Position of Thunder Strike 0051 <gen>)
    • Set Temp_Group[1] = (Units within 1000.00 of Temp_Point[1] matching ((((Matching unit) is A structure) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of Dummy Unit 0002 <gen>)) Equal to True) and (((Matching unit) is alive) Equal to True))))
    • Unit Group - Pick every unit in Temp_Group[1] and do (Actions)
      • Loop - Actions
        • Custom script: call RemoveLocation(udg_Temp_Point[1])
        • Set Temp_Point[1] = (Position of Thunder Strike 0051 <gen>)
        • Set Temp_Point[2] = (Position of (Picked unit))
        • Set Temp_Point[3] = (Temp_Point[2] offset by 5.50 towards (Angle from Temp_Point[2] to Temp_Point[1]) degrees)
        • Unit - Move (Picked unit) instantly to Temp_Point[3]
    • Custom script: call DestroyGroup(udg_Temp_Group[1])
    • Custom script: call RemoveLocation(udg_Temp_Point[1])
    • Custom script: call RemoveLocation(udg_Temp_Point[2])
    • Custom script: call RemoveLocation(udg_Temp_Point[3])
The problem is the player cannot move their units, the units try to move but the "move unit instantly" cancels the order and keeps sliding them.

Oh and one last thing. I thought it would be neet to have the chain lightining effect on all the units sliding. How would I go about that? That is, how would the effect be on every unit that enters the area and then goes away if a unit is able to escape?

thank you for your help!
 
Level 10
Joined
Jun 26, 2005
Messages
236
You would have to do something like this... (off my head)

  • Event
    • Unit is Issued Point Order
  • Condition
    • Triggering unit is Sliding Equal to True
  • Action
    • set loc = Position of Triggering unit
    • Unit Move Triggering unit instantly to loc, facing Point of issued order
    • custom script: call RemoveLocation(udg_loc)
 
Status
Not open for further replies.
Top