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

Unloading unit from transoprt by triggers

Status
Not open for further replies.
Level 16
Joined
Mar 27, 2011
Messages
1,349
This is what im currently using in one of my maps:

  • Marine Load
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
      • (Unit-type of (Loading unit)) Equal to Marine
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] Equal to 0
        • Then - Actions
          • Unit - Add Marine Fire to (Transporting unit)
          • Unit - Add Marine Slot to (Transporting unit)
          • Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = 1
          • Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 0.50 seconds
          • Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = (Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] - 1)
          • Unit - Remove Marine Fire from (Transporting unit)
          • Unit - Remove Marine Slot from (Transporting unit)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] Equal to 1
            • Then - Actions
              • Unit - Increase level of Marine Fire for (Transporting unit)
              • Unit - Increase level of Marine Slot for (Transporting unit)
              • Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = 2
              • Wait until (((Triggering unit) is loaded into (Transporting unit)) Equal to False), checking every 0.50 seconds
              • Set Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] = (Bunker_Count_Marine[(Player number of (Owner of (Triggering unit)))] - 1)
              • Unit - Set level of Marine Fire for (Transporting unit) to Bunker_Count_Marine[1]
              • Unit - Set level of Marine Slot for (Transporting unit) to Bunker_Count_Marine[1]
            • Else - Actions
              • Do nothing
You use a wait function to wait for a unit to be unloaded since there is no "a unit is unloaded" event.
The variable is counting the number of units in the bunker (max 2 units in the bunker)

However, this is not MUI and only works if there is 1 bunker. This is not a solution but a pointer. I'd be
interested if anybody could provide a solution. I don't know jass, but maybe something to do with local
functions?
 
Level 12
Joined
Sep 11, 2011
Messages
1,176
How can I by trigger unload unit from board?
For example i have 10 places on my transport. I need to drop\unload unit in N3 field, how to do this?

i don't know what is N3 field, is that an unit ? however, if you want to unload unit from your board, you can use this

  • Unloading unit from board
    • Events
    • Conditions
    • Actions
      • Unit - Order your board to Unload your unit
you could find the action on "Issue order targeting a unit"
 
Last edited:
Status
Not open for further replies.
Top