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

Making gate open/close

Status
Not open for further replies.
Level 17
Joined
Apr 13, 2008
Messages
1,597
What the hell? It's not clear what you want.
Look at your keyboard.
Look up the page down key. Hit it with all your might.
Read the Similiar Threads carefully.

Alternative solution:
Look at your keyboard.
Look up the page up key. Hit it with all your might.
Use the search button.

If you want to make a unit ability make your problem clearer. Just make a triggered ability what does that.
 
Even though I am upset that you didnt search through the forums. I prefer gate triggers with 2 levers, because it takes a second just to open the gate. Wel first you need a trigger like this:
  • Gate Trigger 2 levers
    • Events
      • Destructible - A destructible within (Playable map area) dies
    • Conditions
    • Actions
      • Set TempIntA = 0
      • For each (Integer A) from 1 to HowManyGatesYouHave, do (Actions)
        • Loop - Actions
          • Set TempIntA = (TempIntA + 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying destructible) Equal to LeverA[TempIntA]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LeverAToggle[TempIntA] Equal to 0.00
                • Then - Actions
                  • Set LeverAToggle[TempIntA] = 1.00
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Dying destructible) Equal to LeverB[TempIntA]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LeverBToggle[TempIntA] Equal to 0.00
                • Then - Actions
                  • Set LeverBToggle[TempIntA] = 1.00
                • Else - Actions
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • Gate[TempIntA] Equal to False
                  • LeverAToggle[TempIntA] Equal to 1.00
                  • LeverBToggle[TempIntA] Equal to 1.00
            • Then - Actions
              • Destructible - Open GateUnit[TempIntA]
              • Set Gate[TempIntA] = True
              • Countdown Timer - Start GateTimer[TempIntA] as a One-shot timer that will expire in 3.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • And - All (Conditions) are true
                    • Conditions
                      • Gate[TempIntA] Equal to True
                      • LeverAToggle[TempIntA] Equal to 1.00
                      • LeverBToggle[TempIntA] Equal to 1.00
                • Then - Actions
                  • Destructible - Close GateUnit[TempIntA]
                  • Set Gate[TempIntA] = False
                  • Countdown Timer - Start GateTimer[TempIntA] as a One-shot timer that will expire in 3.00 seconds
                • Else - Actions
Then you need to make respawn triggers for each timer:
  • Gate Revive 1
    • Events
      • Time - GateTimer[1] expires
    • Conditions
    • Actions
      • Set TempIntA = 1
      • Set LeverAToggle[TempIntA] = 0.00
      • Set LeverBToggle[TempIntA] = 0.00
      • Destructible - Resurrect LeverA[TempIntA] with (Max life of (Last created destructible)) life and Show birth animation
      • Destructible - Resurrect LeverB[TempIntA] with (Max life of (Last created destructible)) life and Show birth animation
For the different timers just ajust TempIntA to the array number on the timer.
 
Level 4
Joined
Mar 15, 2008
Messages
80
hey, somebody else who uses levers, not circles of power:wink:
but there is a simpler way of doing that, only with two triggers working together to form a loop:

  • Open Gate
    • Events
      • Destructible - Lever001 Dies
    • Conditions
    • Actions
      • Destructable - Open CityGate001
      • Destructable - Ressurect Lever002
It's important to kill the second lever at map initialisation or something though
...and then to close the gate...
  • Close Gate
    • Events
      • Destructable - Lever002 Dies
    • Conditions
    • Actions
      • Destructable - Close CityGate001
      • Destructable - Ressurect Lever001
It's also cool to to add a delay time between the death of the switch and when the gate opens along with some sound effects:thumbs_up:
 
Level 11
Joined
Jun 21, 2007
Messages
505
He wants to make a spell that opens gates! Just take an Area of effect spell and make it do nothing (make no effect). Then you use a trigger:
  • Events:
    • Unit - A unit finishes casting an ability
  • Conditions:
    • (Ability being cast) Equal to Open Doors
  • Actions:
    • Destructible - Pick every gate in region with offset (errhm, take the starting point as the target point of ability being cast and make both X and Y's offsets equal... remember that 400 is Large area enough
    • Destructible - ... this is a continue of the last said action... Open (Picked) gate
Good Luck, World Editorer!
I like questions of people who have no idea what they are going to do, it's my only way to recieve rep =)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,217
tyeeeee1, your +rep currently adds no rep and thus your +rep is valueless.

Basically you kill the gate on the event of your choice and then play the open animation and your done (as destructables never decay). That is how everyone does it in every map ever made that involves opening gates.

The GUI actions to open / close basically do the above if you read the JASS behind them.
 
Level 11
Joined
Jun 21, 2007
Messages
505
I don't use WEU, but in cases when I need very large map. No cases of those happened yet. Your tutorial is for WEU-users, but newbs don't know about WEU, they use what they initially have, and your triggers are whole advanced. Your method, for example, can't be used in many games, but it's a good example of how to methodically use all new WEU functions. But didn't you notice who is the creator of this thread - he wants to find out how tot open/close gates! Your posts actually looks like self-advertising of your tutorial for undiscovered case (recieving +rep).
 
Level 11
Joined
Jun 21, 2007
Messages
505
It will require learning JASS I guess? I already know how would I self-study JASS - by creating triggers with a single action, converting it to custom text and studying the text. The only action I wouldn't find out using this way is if GetLocalPlayer() == Player(######) then. And I don't see JASSNEWGENPACK in tools section. Where can I find it?
 
Status
Not open for further replies.
Top