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

"Pilot ability"

Status
Not open for further replies.
Level 20
Joined
Feb 23, 2014
Messages
1,265
Actually, I think that in GUI this is somewhat tricky.

There is an event that uses units being loaded into a transport, so you can easily just set the movement speed of the unit to 0 in the object editor and return it to the normal value once a unit is loaded.

The problem is having it go back to 0 when it unloads all units as I can't remember an event that would fire off of a unit being unloaded.

The best idea I to circumvent this is to do something like this:

  • Melee Initialization
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
      • ((Triggering unit) is in MobileTransports) Equal to True
      • (Issued order) Equal to (Order(move))
    • Actions
      • Set TransportedUnits = (Units owned by (Owner of (Triggering unit)) matching (((Matching unit) is loaded into (Triggering unit)) Equal to True))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in TransportedUnits) Greater than 0
        • Then - Actions
          • -------- do nothing --------
        • Else - Actions
          • Unit - Set (Triggering unit) movement speed to 0.00
          • Unit Group - Remove (Triggering unit) from MobileTransports
          • Unit - Order (Triggering unit) to Stop
      • Custom script: call DestroyGroup(udg_TransportedUnits)
Whenever you increase a transport movement speed to normal, you add it to "mobile transports" unit group. Once a unit from that group is issued an order to move, it will check if it has any units loaded inside. If not, then it will be ordered to stop and its movement speed will be reduced to 0.
 
Last edited:
Status
Not open for further replies.
Top