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

Status
Not open for further replies.
Level 4
Joined
Feb 7, 2007
Messages
61
So i have some gate triggers in my game, like this...

  • OpenGate
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Gate
    • Actions
      • Unit - Replace (Casting unit) with a Wall Gate (Opened) using The old unit's relative life and mana
      • Animation - Play (Last replaced unit)'s Death Alternate animation, using only Common animations
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Casting unit) Equal to Wall Gate 0156 <gen>
                  • (Casting unit) Equal to Wall Gate 0155 <gen>
        • Then - Actions
          • Game - Display to (All players) for 2.00 seconds the text: ((Name of (Owner of (Casting unit))) + has opened one of the back gates.)
          • Sound - Play ArrangedTeamInvitation <gen>
        • Else - Actions
However, the game messaging feature of this trigger that alerts all players that the player who opened the gate, opened it, will not work. This is because whenever the gate is opened and closed, a new GameObject ID or whatever (The Numbers after "Wall Gate" e.g. "Wall Gate 0156" is gonna be changed.

SOOO, whoever is gonna open it the 2nd time around, the alert won't work. Also, functions in my game require mobs to attack this specific gate, but since the ID is changed everytime the door is opened and closed, they wont be able to.

SOO, how do i make it to where it can stay the same ID?
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Why don't you just compare the IDs of the Gate units, rather than the actual handles?

What you could also do is use two unit variables that are referenced and change values whenever they get replaced. You don't absolutely have to use a preset value.
 
Level 4
Joined
Feb 7, 2007
Messages
61
Can you show me an example of the trigger by setting variables?

@Midnighters

I can't do that because the gates are Units and Not destructibles.
 
Status
Not open for further replies.
Top