Need help with Idea

Shadow

TH.net Regular
Reaction score
23
okay so im trying to make a gate system with destructibles where this unit called the gate keeper has the ability to open the gate an ability to close the gate. So what I do is when the unit casts open gate a real variable is set to the current health of the gate destructible, then the destructible opens. Then when the unit casts close gate it closes the gate and sets the health of the destructible to the Real Var.

Now this works all grand and fine, my issue is when real var is below 0 (destructible is killed) to remove the abilities from the unit but it seems that i have to cast open gate again and then the gate opens and the ability is removed I tried to add another action under where it removes the ability to kill the gate but it didn't work so everything works its just I have to cast open gate then the gate opens which I Don't want so somehow I need a check to see if the destructible health is below 10 to remove the ability and kill the destructible.

I tried this but it didnt suceed

Trigger:
  • Remove Gate Abilities
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Gate1 Greater than or equal to 10.00
        • Then - Actions
          • Set Gate1 = (Current life of (Iron Gate 0012))
        • Else - Actions



Trigger:
  • Gate is Dead
    • Events
      • Game - Gate1 becomes Less than 20.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Gate1 Less than 20.00
        • Then - Actions
          • Unit - Remove Open Gate 1 from Base Captain 0451 <gen>
        • Else - Actions


Made it 20 because I thought it would make it so the ability would be removed before the gate was dead so it would fix my problem where you could still cast the ability.

So my whole thing works its just the gate always needs to be opened so the ability is removed v.v
 

KJP

New Member
Reaction score
5
just a thought, but why don't you use the a destructable dies event to ,so when the gate dies, you can then use the remove abilities action for both the opening and closing of the gate
 

Shadow

TH.net Regular
Reaction score
23
Because when the gate is in the open position the destructible is considered dead.

BTW to simply my question more how can I make a good way to check the destructible health when its alive and if it falls below some number say close to 0 so its not dead but about to die then remove the abilities cause if i check it when it is 0 or below then its just gonna take away the abilities when its in the open position thats why I said 20 in the above post.
 

Vibon

New Member
Reaction score
1
What you are saying is, when a destructible door is in its "open" state, then it is considered as a dead destructible? Then why not save the destructible into a variable, maybe that would work?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top