• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Detect unit leaves a transport?

Status
Not open for further replies.
Level 10
Joined
Jun 7, 2008
Messages
420
Hi, while there is a way to detect unit entering a transport

  • Unit - A unit owned by Player 1 (Red) Is loaded into a transport
how do I detect when it leaves a transport? Reason being I'm having a mount system in my RPG and many triggers would rely on this, such as the camera following the unit.

I know there is a way (https://www.hiveworkshop.com/forums/world-editor-help-zone-98/detection-problem-162428/)
But is there a way to do it without periodic triggers as it is already laggy enough. If not, I'll just settle for a every .5 second or something.
 
I had exactly the same problem with my map Pirates of the Sea with some rowboats, the camera had to stop following the unit and follow the rowboat, but the camera just stayed at the unit's last position. I could never solve this problem no matter how many times I tried and retried, but I believe it can be done with JASS, the problem is that I am not a JASSer, but probably one will come, and he might help you as well.
 
But is there a way to do it without periodic triggers as it is already laggy enough. If not, I'll just settle for a every .5 second or something.

probably not but if it lags with a periodic event your triggers must be horribly wrong
  • TransportEnter
    • Events
      • Unit - A unit Is loaded into a transport
    • Conditions
    • Actions
      • Unit Group - Add (Triggering unit) to TransportedUnits
      • Trigger - Turn on TransportLeave <gen>
  • TransportLeave
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in TransportedUnits and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is being transported) Equal to False
            • Then - Actions
              • Unit Group - Remove (Picked unit) from TransportedUnits
              • Game - Display to (All players) the text: ((Name of (Picked unit)) + was unloaded)
            • Else - Actions
 

Attachments

Status
Not open for further replies.
Back
Top