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

[Trigger] Set Height of Unit

Status
Not open for further replies.
Level 18
Joined
May 27, 2007
Messages
1,689
title basically says it all but i want to make a flying unit land before it picks up units for transport but i need it to stay down until the units are all loaded. will i have to add an ability to raise and lower the ship before it is able to load then make it available to load after its landed. same for unloading
 
Last edited:
Level 21
Joined
Jan 5, 2005
Messages
3,515
use a blank spell with a trigger like this:

  • Oh Noes
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(Pickup))
      • (Owner of (Targeted unit)) Equal to (Owner of (Triggering unit))
    • Actions
      • Unit - Order (Triggering unit) to Move To (Position of (Targeted unit))
      • Wait until ((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) Less than 10.00), checking every 1.00 seconds
      • Animation - Change (Triggering unit) flying height to ((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) - (Distance between (Position of (Triggering unit)) and (Position of (Targeted unit)))) at 5.00
      • Unit - Order (Triggering unit) to Load (Targeted unit)
      • Animation - Change (Triggering unit) flying height to (Default flying height of (Triggering unit)) at 5.00
notes about this: im not sure how the z axis changes as terrain high changes, basically this trigger make it so it moves to the the z high of the unit, it may be possible to get around this by just mashing the flying high of the unit to 0, but im dunno.

you need to set the order string in the ability as Pickup (or whatever)

the unit must be loading unit, but you can tweak this to whatever method you use.

after looking at this trigger a bit more i decided to try and super optimise it (probably unneccessarily) but why not :p

anyways, here is the trigger which will make sure that if another order is given that it wont conflict with this trigger. anyways, hopefully this will work and make sense:

  • Oh Noes
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(Pickup))
      • (Owner of (Targeted unit)) Equal to (Owner of (Triggering unit))
    • Actions
      • Unit - Order (Triggering unit) to Move To (Position of (Targeted unit))
      • For each (Integer A) from 1 to ((Integer((Current movement speed of (Triggering unit)))) / (Integer((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit)))))), do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Current order of (Triggering unit)) Equal to (Order(Pickup))
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) Less than 10.00
                • Then - Actions
                  • Animation - Change (Triggering unit) flying height to ((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) - (Distance between (Position of (Triggering unit)) and (Position of (Targeted unit)))) at 5.00
                  • Unit - Order (Triggering unit) to Load (Targeted unit)
                  • Animation - Change (Triggering unit) flying height to (Default flying height of (Triggering unit)) at 5.00
                  • Skip remaining actions
                • Else - Actions
                  • Wait 1.00 seconds
            • Else - Actions
              • Skip remaining actions
the interger a loop uses time = speed / distance to work out the maximum time it would take for the triggering unit to reach the targeted unit which therfore reduces looping it loads of times for nothing. this trigger might not even work i dunno i just made it for fun. anyways use the first one for it to work but you will have to find some way of ending this trigger is another order is made and use the second one if you are feeling lucky :p


MASSIVE EDIT!!!

im so soryr ive just looked over this and ive noticed just how silly it is :p mus tbe my lack of sleep.

this will work much better

  • Oh Noes
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • (Issued order) Equal to (Order(Pickup))
      • (Owner of (Targeted unit)) Equal to (Owner of (Triggering unit))
    • Actions
      • Unit - Order (Triggering unit) to Move To (Position of (Targeted unit))
      • Wait until (((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) Less than or equal to 10.00) or ((Current order of (Triggering unit)) Not equal to (Order(Pickup)))), checking every 1.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of (Triggering unit)) Equal to (Order(Pickup))
          • (Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) Less than 10.00
        • Then - Actions
          • Animation - Change (Triggering unit) flying height to ((Distance between (Position of (Triggering unit)) and (Position of (Targeted unit))) - (Distance between (Position of (Triggering unit)) and (Position of (Targeted unit)))) at 5.00
          • Unit - Order (Triggering unit) to Load (Targeted unit)
          • Animation - Change (Triggering unit) flying height to (Default flying height of (Triggering unit)) at 5.00
        • Else - Actions
          • Skip remaining actions
use this for maximum success!
 
Level 18
Joined
May 27, 2007
Messages
1,689
ok i tried the way u did that trigger and it didnt seem to work right, idk why but i tried a sort of offshoot of rule's and it seemed to work but i cannot get it to raise again when i am done loading

but to answer your questions
1. i will put them in a unit group only if i need to
2.as far as i know it can hold a max of 8 units unless there is a way to change that

here is what i did basically and the ability was the stone form but i changed the unit base and alternate form to the correct things
  • Load Copy
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • ((Ability being cast) Equal to Land V-Wing ) and ((Unit-type of (Triggering unit)) Equal to V-Wing)
    • Actions
      • If ((Current flying height of (Triggering unit)) Greater than 290.00) then do (Animation - Change (Triggering unit) flying height to 60.00 at 450.00) else do (Do nothing)
cus i tried it that if your current height was less than that it would raise the height instead if you need it i can upload the map


Also Could You Answer Me This: How come when i order units to load up into another unit only like 2 or 3 out of 6 actually load up btw this is a completly different trigger (combination of triggers)
  • Drop Offs
    • Events
      • Time - Every 33.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 6 Assault Droid for Player 1 (Red) at (Center of pick <gen>) facing 90.00 degrees
      • Wait 0.20 seconds
      • Unit Group - Pick every unit in (Units within 512.00 of (Center of pick <gen>)) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to PickUp
          • Unit Group - Remove AAT 0606 <gen> from PickUp
      • Set PickUpNumber = (Number of units in PickUp)
      • Wait 0.50 seconds
      • Unit Group - Order PickUp to Load AAT 0606 <gen>
      • Wait 4.00 seconds
      • Skip remaining actions
  • Drop off
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Transporting unit) Equal to AAT 0606 <gen>
    • Actions
      • Wait 4.00 seconds
      • Unit - Order AAT 0606 <gen> to Move To (Center of DropREdoff <gen>)
      • Wait until ((Distance between (Position of (Transporting unit)) and (Center of DropREdoff <gen>)) Less than or equal to 20.00), checking every 0.10 seconds
      • Unit - Order (Transporting unit) to Unload (Triggering unit)
      • Wait 1.00 seconds
      • Unit - Order AAT 0606 <gen> to Move To (Center of LoadUpred <gen>)
I have tried a couple of different ways but they dont seem to have much better results
 
Last edited:
Level 21
Joined
Jan 5, 2005
Messages
3,515
right so you having trouble getting the unit to move up after it has picked up the units?

does "Animation - Change (Triggering unit) flying height to (Default flying height of (Triggering unit)) at 5.00" not work to raise it to normal height?

im assuming you have tried a trigger like this

  • Oh Noes
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to RaiseVWing
    • Actions
      • Animation - Change (Triggering unit) flying height to (Default flying height of (Triggering unit)) at 450.00
you may have to manually set the flying height instead of select default flying height.


when units load they sort of bash into each other, and if they havent loaded after a certain amount of time the order is cancelled, i think, not usre tho. i would just repeat the order 2 or 3 times to be safe.

also what is wrong with the last two triggers? do they not work? if not what is wrong with them?
 
Status
Not open for further replies.
Top