Gate (as a Structure, not a Doodad) Triggers

Nathan0093

New Member
Reaction score
4
I've found a way to make a structure a gate using the gate model. If you wish to make a vertical gate just create another gate unit in the object editor and use a trigger to replace it with a new unit and make the new unit face 180 degree. Anyway, here are the triggers that i need help with:

Code:
Gate Open
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Open 
        (Unit-type of (Triggering unit)) Equal to Gate
    Actions
        Unit - Replace (Triggering unit) with a Gate (Opened) using The old unit's relative life and mana
        Animation - Play (Last replaced unit)'s death animation, using only Common animations
        Unit - Make (Last replaced unit) Invulnerable
^In this trigger I want to make the gate play its "open" animation and become invulnerable. It keeps playing the "destroyed" animation, so what string should i put to get the desired effect? Also, after the gate is "opened" it is replaced by a walkable gate, but units still cant walk through it, and when the gate becomes invulnerable the HP bar and HP # doesnt show anymore. How do i fix this?

Code:
Replace Destroyed Gate
    Events
        Unit - A unit Dies
    Conditions
        (Unit-type of (Dying unit)) Equal to Gate
    Actions
        Unit - Replace (Dying unit) with a Gate (Opened) using The new unit's max life and mana
        Set ReplacedGate = (Last replaced unit)
        Unit - Make ReplacedGate Invulnerable
        Unit - Set life of ReplacedGate to 5.00
        Unit - Remove Close  from ReplacedGate
        Animation - Play ReplacedGate's death animation
        Wait until ((Life of ReplacedGate) Greater than or equal to 500.00), checking every 1.00 seconds
        Unit - Replace ReplacedGate with a Gate using The old unit's relative life and mana
^In this second trigger I want the destroyed gate to be replaced by a opened gate. The problem is that while waiting to be repaired another gate might be destroyed, hence the newly destroyed gate will become the unit in the variable, which means the old gate waiting to be repaired wont be replaced by a closed gate when its HP reaches 500. How do i get around this?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top