• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[General] Gate System

Level 9
Joined
Mar 26, 2020
Messages
217
What's the best way for the gate system? you see, i used roar for open close (2 separate copied abilities) its working fine, but the thing is, if the gate is destroyed and you either close/open the gate, it will revive. I want a gate where you can open close without reviving the doodads for abuse of blockade. And better if you can add, i tried doing the revive gate (named repair) via Channel (the empty undead hero spell) but the gate doesn't revive
 
What's the best way for the gate system? you see, i used roar for open close (2 separate copied abilities) its working fine, but the thing is, if the gate is destroyed and you either close/open the gate, it will revive. I want a gate where you can open close without reviving the doodads for abuse of blockade. And better if you can add, i tried doing the revive gate (named repair) via Channel (the empty undead hero spell) but the gate doesn't revive
could you add more details about the type of gate you are trying to build and what it's supposed to do? (like how it would be activated etc)
 
Would using the default wc3 waygate system work? I think the default waygate is the best system unless it is causing some kind of problem for you.
i want a unpathable gate, not just phase through
could you add more details about the type of gate you are trying to build and what it's supposed to do? (like how it would be activated etc)
i want doodads gate to be open/close and once destroyed the open/close will not work, in my case once the gate is destroyed, using the close/open ability will revive the door. So basically, i want to remove that abuse and i was thinking of another way but that also didn't work hence i ask for any grand map modders what's best for gate system

ex scenario: player 2 breached player 1's gate and when player 2 is about to blob player 1 base, player 1 activate the open or close ability in which the dead gate will function and will basically revive the door in open/close way (i mean open door is basically alternate death but you get what im saying? lol) and for now i can only think of is increasing the cooldown window of the open/close ability as temporary solution.
 
Last edited:
I feel like the core problem here is that you want access to the gate even though it's dead(destroyed).
Not entirely sure if pathing is easy either but worst case you can just spawn path blockers I guess.
Anyway, using a damage detection system it should not be difficult to make the gate unkillable and when it reaches 1 life you can remove the pathing and play some sort of destroyed animation.

A bit clunky but I can't think of anything better right now
 
I feel like the core problem here is that you want access to the gate even though it's dead(destroyed).
Not entirely sure if pathing is easy either but worst case you can just spawn path blockers I guess.
Anyway, using a damage detection system it should not be difficult to make the gate unkillable and when it reaches 1 life you can remove the pathing and play some sort of destroyed animation.

A bit clunky but I can't think of anything better right now
Its the opposite actually, i want to open/close to be obsolete if the gate dies and yes i actually tried that since i have the GDD, it looks clunky indeed and i don't like it lol
  • Open
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Open Gate
    • Actions
      • Destructible - Pick every destructible in Gate1 <gen> and do (Destructible - Open Gate (Diagonal 1 left) 0086 <gen>)
  • Close
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Close Gate
    • Actions
      • Destructible - Pick every destructible in Gate1 <gen> and do (Destructible - Close Gate (Diagonal 1 left) 0086 <gen>)
This are my triggers currently, im still thinking what should i insert if i used if/else once the gate is destroy making the open/close basically clickable but nothing happens
 
Last edited:
You're saying the approaching unit has the open/close ability not the gate itself? same fot the revive?
uhh no, for the building, let just say the gate and the arch of the gate are separate building units, the gate is responsible for the path blocking while the arch is the one in control of the opening and closing of the gate

as for the revive, its another ability to revive the destroyed gate for the open/close to function
 
Last edited:
Its possible to detect when a gate dies but it also dies when its opened so detection can be temporarily turned off during opening.

Here is an example of the logic. The addition from your logic is the added detection when the destructable dies, using the GateLife variable as a condition and to set the life of the Gate after closing to what it was before it was opened and an IsGateOpen boolean for simplicity and readability for a repair trigger.

destructable Gate = (Diagonal 1 left) 0086 <gen>
real GateLife = Life of Gate
real GateRepairAmount = 250
real GateLifePrev
boolean IsGateOpen = false

Trigger Gate dies
set GateLife = 0

Trigger Open Gate
if GateLife greater than 0 then
set IsGateOpen = true
set GateLife = Life of Gate
turn off Gate dies
Open Gate
turn on Gate dies
endif

Trigger Close Gate
if GateLife greater than 0 then
set IsGateOpen = false
Close Gate
set Life of Gate = GateLife
endif

The Repair trigger must detect if the gate was destroyed and the state of the gate (Open/Closed) in order to apply the Repair amount correctly.

Trigger Repair Gate
set GateLifePrev = GateLife
set GateLife = Max((GateLife + GateRepairAmount), Max life of Gate)

if GateLifePrev eqal to 0 then (It was destroyed)
Resurrect Gate with GateLife
endif
if GateLifePrev greater than 0 and IsGateOpen = false then (It was closed)
set life of Gate to GateLife
endif
if GateLifePrev greater than 0 and IsGateOpen = true then (It was open)
endif
 
Its possible to detect when a gate dies but it also dies when its opened so detection can be temporarily turned off during opening.

Here is an example of the logic. The addition from your logic is the added detection when the destructable dies, using the GateLife variable as a condition and to set the life of the Gate after closing to what it was before it was opened and an IsGateOpen boolean for simplicity and readability for a repair trigger.

destructable Gate = (Diagonal 1 left) 0086 <gen>
real GateLife = Life of Gate
real GateRepairAmount = 250
real GateLifePrev
boolean IsGateOpen = false

Trigger Gate dies
set GateLife = 0

Trigger Open Gate
if GateLife greater than 0 then
set IsGateOpen = true
set GateLife = Life of Gate
turn off Gate dies
Open Gate
turn on Gate dies
endif

Trigger Close Gate
if GateLife greater than 0 then
set IsGateOpen = false
Close Gate
set Life of Gate = GateLife
endif

The Repair trigger must detect if the gate was destroyed and the state of the gate (Open/Closed) in order to apply the Repair amount correctly.

Trigger Repair Gate
set GateLifePrev = GateLife
set GateLife = Max((GateLife + GateRepairAmount), Max life of Gate)

if GateLifePrev eqal to 0 then (It was destroyed)
Resurrect Gate with GateLife
endif
if GateLifePrev greater than 0 and IsGateOpen = false then (It was closed)
set life of Gate to GateLife
endif
if GateLifePrev greater than 0 and IsGateOpen = true then (It was open)
endif
Q: can this be modified to apply to all pre-placed gate? im thinking of variable counts to save time and i want to try this, sounds plausible
 
Q: can this be modified to apply to all pre-placed gate? im thinking of variable counts to save time and i want to try this, sounds plausible
Sure, just slap an array on the variables. If each player has no more than 1 gate you can easily use Player Number of Player as the index for the arrays.

The text is pseudo-code, fake code. It shows the idea. At the top are the global variables that you create in gui with their variable type. Things like "Open Gate" corresponds to similar gui actions in that case "Destructible - Open Gate Gate". The "if->endif" are the "if then else do multiple actions" action.
 
Trigger Open Gate
if GateLife greater than 0 then
set IsGateOpen = true
set GateLife = Life of Gate
turn off Gate dies
Open Gate
turn on Gate dies
endif

Trigger Close Gate
if GateLife greater than 0 then
set IsGateOpen = false
Close Gate
set Life of Gate = GateLife
endif
  • Gate Dies
    • Events
    • Conditions
    • Actions
      • Set GateLife = 0.00
  • Gate Open
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GateLife Greater than 0.00
        • Then - Actions
          • Set IsGateOpen = True
          • Set GateLife = (Real((Integer((Current life of GateCount[40])))))
          • Trigger - Turn off Gate Dies <gen>
          • Destructible - Open GateCount[40]
          • Trigger - Turn on Gate Dies <gen>
        • Else - Actions
  • Gate Close
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • GateLife Greater than 0.00
        • Then - Actions
          • Set IsGateOpen = False
          • Destructible - Close GateCount[40]
          • Set GateLife = (Real((Integer((Current life of GateCount[40])))))
        • Else - Actions
did i do it right? lol

PS. i have more than 30+ gates and planned to add more
 
Not quite right but its on the right path. Having 30+ gates adds some complexity. Ill go a bit more in dept in a while but for now lets fix these triggers. This will be an intermediate step to get the triggers in order for the future. When I write[] it doesnt matter which value you put there for now.

GateLife should be an array
IsGateOpen should be an array
Id appretiate if you renamed the destructible variable GateCount to Gate or GateDest. Count is generally a name for an integer or perheaps real variable and doesnt fit.
In the Gate Open trigger you set GateLife to convert real to integer and then convert integer back to real. Dont do this. Current life of Gate[] is a real so theres no need for any conversion.
In the Gate Close trigger you added the wrong action at the end. The correct action is to Set life of Gate[] to GateLife[]

Ill also explain the logic in further detail.
Gate Dies:
This trigger detects when the gates in the event dies. Since opening a gate kills the gate, this trigger is turned off before opening a gate. That means the trigger truly only detects when the gate is killed by an attacker. When that happens the variable GateLife[] is set 0.00, a value that means the gate has been killed by an attacker.

Gate Open:
As you can see this trigger checks if GateLife[] is Greater than 0.00. If the gate was killed by an attacker, it wouldnt execute the then actions but if it wasnt killed by an attacker GateLife[] is Greater than 0.00 and it would execute the then actions. First IsGateOpen[] is set to True, this variable is relevant to the Repair trigger but lets not do the repair trigger now. First we focus on these triggers before adding more complexity. GateLife[] is set to Current life of the gate, this is done because when the gate is opened, its killed, and when its closed, its resurrected and recieves its Max life. To stop this abuse the Current life of the gate is stored in GateLife[] so that it can be restored in the trigger Gate Close.

Gate Close:
This time, first close the gate (it gets resurrected) with Max life and therefor we set its life to GateLife[] which is the value it had before it was opened (killed).

Ive decided that unit indexing is a good fit to tie this system together. Do you need more information about any of these 3 things?
1) Variable array
2) Player index
3) Unit index
 
Back
Top