• 🏆 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!

Gate/Gates

Status
Not open for further replies.
Level 2
Joined
Dec 6, 2016
Messages
26
I just wanted to make a couple triggers that could make the gate open for a specific players' units when they pass(possibly with regions), don't close on it's own units when one of them passes, and when it "Closes" doesn't automatically "Heals" itself.

When I manage to do one of these I just couldn't do the other so I've been stuck for quite a while.

(And by the heal part as most of you would remember when a Gate "Opens" it technically "dies" in the game so when it closes it comes with full hp as it would technically rebuilds itself.)


I've been trying to make it work for the past 2 weeks but I just cannot make a simple gate open/close system.

If anybody out there could help me with it you would have my eternal gratitude.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I can't exactly help you with your problem (not at the moment anyway) but it would be best if you could post your existing triggers for other to gauge where you're at and to see if there's something you might've missed. If don't know how to post the triggers, check this out: How to easily post triggers.

Also I think the issue here is related to the same problem experienced in this recent thread from the Triggers & Scripts sub-forum, Dynamic Gate Triggers. Hopefully it can shed some light on your case here.
 
Level 2
Joined
Dec 6, 2016
Messages
26
  • Gate open
    • Events
      • Unit - A unit enters Gate Main <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Open Gate[Morehp] (Diagonal 2) 0107 <gen>
  • Gate Close
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
      • (Gate Main <gen> contains No unit) Equal to False
    • Actions
      • Destructible - Close Gate[Morehp] (Diagonal 2) 0107 <gen>
These are the closest I've got but it is still wonky and I couldn't get around to stop the gate from repairing itself.
 
Level 39
Joined
Feb 27, 2007
Messages
5,031
There is no "triggering unit" for your second trigger because it runs off of a timer, not a unti event. Instead you need to check that the number of alive Player 1 units nearby the gate is 0:

  • Gate Close
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Set Count = 0
      • Custom script: set bj_wantDestroyGroup = true //this cleans the group leak from the line below this (automatically destroys group after)
      • Unit Group - Pick every unit in (units in Gate Main <gen>) and do (actions)
        • Loop - Actions
          • If (all conditions) then (actions) else (actions)
            • If - Conditions
              • (Owner of (picked unit)) equal to (Player 1)
              • ((Picked unit) is alive) equal to true
            • Then - Actions
              • Set Count = Count + 1
            • Else - Actions
      • If (all conditions) then (actions) else (actions)
        • If - Conditions
          • Count equal to 0
        • Then - Actions
          • Destructible - Close Gate[Morehp] (Diagonal 2) 0107 <gen>
        • Else - Actions
 
Level 2
Joined
Dec 6, 2016
Messages
26
Hmm.... looks like I need to go around the variables and unit groups all over again, it's been a long time since I've used the World Editor I forgot about %70 of it.
 
Status
Not open for further replies.
Top