• 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] A unit UNload a another unit?

Status
Not open for further replies.
Level 29
Joined
Sep 26, 2009
Messages
2,595
the way I went around it was that when a unit fired the "unit is loaded ..." event, I saved that unit into unit group.
When unit leaves a transport, it fires the "unit enters region" event, so I used that. But the event fires for any unit (created, summoned, ...), hence I check if the triggering unit is in the "loaded" unit group. If yes, it was unloaded and I remove the unit from the unit group.
 
Alternatively, you can use Bribe's GUI Unit Event.
Bribe said:
Use the event "Game - CargoEvent becomes Equal to 1.00" to detect when a unit is loaded into a transport. Use the event "Game - CargoEvent becomes Equal to 2.00" to detect when it is unloaded.

You also have "CargoTransportUnit[(Custom value of Unit)]" to get the unit who is carrying the unit, and "CargoTransportGroup[(Custom value of Transport)]" to pick all units that the transport is carrying.
 
the way I went around it was that when a unit fired the "unit is loaded ..." event, I saved that unit into unit group.
When unit leaves a transport, it fires the "unit enters region" event, so I used that. But the event fires for any unit (created, summoned, ...), hence I check if the triggering unit is in the "loaded" unit group. If yes, it was unloaded and I remove the unit from the unit group.

It doesn't fire the enters-region event unless you moved the unit outside the region after it was loaded. And yes, as KILLCIDE stated, use Unit Event. It does all that cool stuff without bugs.
 
Status
Not open for further replies.
Top