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

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
When you attack a lever, that means it dies. When the lever dies, you open/close/destroy the gate. You can set the lever back to alive then if you want to use it again. In that case, make a If/Then/Else command with a boolean condition that checks if the gate is opened or closed, and make the Then Actions open the gate when it's closed, and close the gate when opened.
 
Level 7
Joined
Jun 16, 2008
Messages
327
The function Rethon wants can be done using the same lever and gate with only two seperate triggers.

First, create one new trigger in the trigger editor (F4).

  • Open-Gate Trig
  • Events
    • Destructible - (Your Lever) <gen> dies
  • Conditions
    • GateOpen Equal to False
  • Actions
    • Set Gateopen = True
    • Destructible - Open (Your Gate) <gen>
    • Wait 2.50 seconds
    • Destructible - Resurrect (Your Lever) <gen> with (Max life of (Your Lever) <gen>) life and Hide birth animation
The GateOpen variable was a boolean, and it's default is false, as the gate is automatically closed when the game starts, so be sure to set it to false in a seperate initialization trigger.

Now, we're going to create the Closing Gate trigger:

  • Close-Gate Trig
  • Events
    • Destructible - (Your Lever) <gen> dies
  • Conditions
    • GateOpen Equal to True
  • Actions
    • Set Gateopen = False
    • Destructible - Close (Your Gate) <gen>
    • Wait 2.50 seconds
    • Destructible - Resurrect (Your Lever) <gen> with (Max life of (Your Lever) <gen>) life and Hide birth animation
And there, that's pretty much it. It should work, so try it out. :)
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
When you attack a lever, that means it dies. When the lever dies, you open/close/destroy the gate. You can set the lever back to alive then if you want to use it again. In that case, make a If/Then/Else command with a boolean condition that checks if the gate is opened or closed, and make the Then Actions open the gate when it's closed, and close the gate when opened.

As you see, that's exactly what I said already.
 
Status
Not open for further replies.
Top