• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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