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

Open/Close Gate => full HP?

Status
Not open for further replies.
Level 9
Joined
Aug 7, 2009
Messages
380
And... when the gate is opening, that's means the gate's hit point is 0? maybe that's explain why the gate die when close :D. This is my trigger:
  • Events
  • Destructible - Lever 0478 <gen> dies
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Gate[25] Equal to False
    • Then - Actions
      • Set Gate_system[25] = True
      • Destructible - Set life of Gate 0477 <gen> to Gates_HP
      • Destructible - Open Gate 0477 <gen>
      • Wait 0.50 seconds
      • Destructible - Resurrect Lever 0478 <gen> with (Max life of Lever 0478 <gen>) life and Hide birth animation
    • Else - Actions
      • Set Gate_system[25] = False
      • Set Gates_HP = (Current life of Gate 0477 <gen>)
      • Destructible - Close Gate 0477 <gen>
      • Destructible - Set life of Gate 0477 <gen> to Gates_HP
      • Wait 0.50 seconds
      • Destructible - Resurrect Lever 0478 <gen> with (Max life of Lever 0478 <gen>) life and Hide birth animation
Var: Gate_system[] is boolean with array. Tell me what's wrong :D
 
Level 9
Joined
Aug 7, 2009
Messages
380
Oke, now i know what's wrong, I should not put the Set Gates_HP = (Current life of Gate 0477 <gen>) before the Destructible - Close Gate 0477 <gen> at the Else action. It cause the gate still at 0 hp :D +rep all, but another problem: How to detect if the gate is truely alive or not, cause i want: this trigger does not work anymore when the gate is dead. And... you know when the gate is open => it's hp is 0 => gate is dead, so... I can't turn off this trigger when using Destructible - Gate 0477 <gen> dies as event
 
Level 22
Joined
Jan 10, 2005
Messages
3,426
I had the same problem with one of my old maps. What I did was, turn the open/close triggers off when an enemy unit enters a region just behind the gate. Because that would mean they have breached it.

What might also work is to have a boolean variable. Set this boolean to ''True'' when a player opens the gate. Then when someone wants to close it, check if the boolean is ''True''.
Now, when the gate is actually destroyed, the boolean will not be set to ''True'', so players won't be able to close it again.
 
  • OpenGates
    • Events
      • Unit - A unit enters Gate <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to Player 2 (Blue)
      • (Number of units in (Units in Gate <gen> owned by Player 2 (Blue))) Equal to 1
      • GateHealth Greater than 0.00
    • Actions
      • Set GateHealth = (Current life of City Entrance 10776 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GateHealth Less than or equal to 0.00
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • Destructible - Open City Entrance 10776 <gen>
  • CloseGates
    • Events
      • Unit - A unit leaves Gate <gen>
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Owner of (Leaving unit)) Equal to Player 2 (Blue)
          • (Owner of (Leaving unit)) Equal to Player 7 (Green)
      • ((Number of units in (Units in Gate <gen> owned by Player 2 (Blue))) + (Number of units in (Units in Gate <gen> owned by Player 7 (Green)))) Equal to 0
      • GateHealth Greater than 0.00
    • Actions
      • Destructible - Close City Entrance 10776 <gen>
      • Destructible - Set life of City Entrance 10776 <gen> to GateHealth
replace those player names with your own if you need it
 
Status
Not open for further replies.
Top