• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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 (http://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.
 
Level 15
Joined
Jan 27, 2007
Messages
948
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.
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
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

  • Transport.w3x
    13.5 KB · Views: 55
Status
Not open for further replies.
Top