• 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 opening for allies, and rebuilding

Status
Not open for further replies.
Level 12
Joined
Jan 16, 2008
Messages
1,037
How would I make it so when you are your allies units go by a specific gate, it opens, and when no allies are close to it, it closes. Another question would be, if this door was destroyed, how would I make it so when you click the rebuild icon, it rebuilds the gate?
 
Level 5
Joined
Aug 27, 2007
Messages
138
A simple way to do it is to create a region around the gate, and when an ally enters it, open it. When an ally leaves the region, check to see if there are any allies still inside it, and if there aren't any, then close it. For the rebuild icon, just make it a free action ability (like berserk) and when it's used, close the gate via triggers, maybe check to see if it needs to be opened.
 
Level 12
Joined
Jan 16, 2008
Messages
1,037
No offense but that didn't help me one bit... I know the region part...The triggering part is what I'm needing.
 
Level 14
Joined
Nov 4, 2006
Messages
1,241
  • Events
    • Unit - a Unit enters gateregion
  • Conditions
    • owner of triggering Unit is an ally of player X
  • Actions
    • Destructable - open gate
  • Events
    • Unit - Unit leaves gate region
  • Conditions
    • owner of triggering Unit is an ally of player X
  • Actions
    • if number of units in gate region owned by allies of player X = 0 then close gate
the open/close gate actions are in "destructables"
 
Level 6
Joined
May 3, 2007
Messages
199
Yes gates can be rebuilt. But with this set up his gates will be rebuilt automatically just doing those triggers listed for him. If you ever remember maps with the -open gate trick to revive destroyed gates. People who want to get around this have to be ether very good at triggers or use a seperate unit for a gate house. Like a guard tower next to the the gate with a modified warstomp and thunderclap spells so everytime the gate guard house does it the gate will do what it says. Otherwise I haven't seen a map use gate triggers like this since the days of Starcraft :p
 
Level 6
Joined
May 3, 2007
Messages
199
Azeroth Wars has a system with the open and close buttons on the gate itself. I have no idea how they did that. That's some good triggering right there. Player Controlled Gates. I only know of Gates working as destructables which is neutral. Not sure about how they got gates that players owned that open and close. I have no idea really in the end how it was all triggered and done in Azeroth Wars. Just saying that right now with the trigger you have as it is when allies enter and leave the area it will automatically revive that gate. Unless you interested in learning about variables or looking into other methods.
 
Level 12
Joined
Jan 16, 2008
Messages
1,037
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters SWdoor <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 1 (Red)
    • Actions
      • Destructible - Open Demonic Gate (Horizontal) 3412 <gen>

Is this correct for door opening? best i could do


Eh, this is the best I was able to find, gate doesnt open...
 
Last edited by a moderator:
Level 6
Joined
May 3, 2007
Messages
199
Okay, I spent some time on it and just made the triggers in the editior myself to be able to post it. Though I did use a variable for it. An empty player group. I call it RedAllies but you can do whatever with it >.> So I'm posting 3 triggers 1, how to set up the player group, 2, opening the gate, opps, just noticed something wrong with the 3rd one. I'll get back to it. Okay, went and fixed it all. Updated the open gate as well. Added another variable. An interger variable to count up units.

  • Set Up Red Allies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RedAllies = (All allies of Player 1 (Red))
  • SW Gate Open
    • Events
      • Unit - A unit enters SW Gate <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to (Random player from RedAllies)
    • Actions
      • Set SWGate = (SWGate + 1)
      • Destructible - Open Demonic Gate (Horizontal) 0000 <gen>
  • SW Gate Close
    • Events
      • Unit - A unit leaves SW Gate <gen>
    • Conditions
      • (Owner of (Leaving unit)) Equal to (Random player from RedAllies)
    • Actions
      • Set SWGate = (SWGate - 1)
      • If (SWGate Equal to 0) then do (Destructible - Close Demonic Gate (Horizontal) 0000 <gen>) else do (Do nothing)
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Problem with that trigger is that units will be constantly stepping on it, and as soon a unit left the area, the gate would close it's doors on units that are late.

I suggest making one similar to Azeroth Wars. It's easy, they made two gate units, and they used different collisions, the ability that opens it either replaces the gate or turns it's collision off, also playing one of the gate's animations (the open one, in this case).
 
Level 5
Joined
Jan 11, 2006
Messages
110
Okay, I spent some time on it and just made the triggers in the editior myself to be able to post it. Though I did use a variable for it. An empty player group. I call it RedAllies but you can do whatever with it >.> So I'm posting 3 triggers 1, how to set up the player group, 2, opening the gate, opps, just noticed something wrong with the 3rd one. I'll get back to it. Okay, went and fixed it all. Updated the open gate as well. Added another variable. An interger variable to count up units.

  • Set Up Red Allies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set RedAllies = (All allies of Player 1 (Red))
  • SW Gate Open
    • Events
      • Unit - A unit enters SW Gate <gen>
    • Conditions
      • (Owner of (Entering unit)) Equal to (Random player from RedAllies)
    • Actions
      • Set SWGate = (SWGate + 1)
      • Destructible - Open Demonic Gate (Horizontal) 0000 <gen>
  • SW Gate Close
    • Events
      • Unit - A unit leaves SW Gate <gen>
    • Conditions
      • (Owner of (Leaving unit)) Equal to (Random player from RedAllies)
    • Actions
      • Set SWGate = (SWGate - 1)
      • If (SWGate Equal to 0) then do (Destructible - Close Demonic Gate (Horizontal) 0000 <gen>) else do (Do nothing)

Those triggers wont always work becuase it chooses a random ally each time. Your way only works 100% of the time if there is only one ally. Allow me to explain. Say you have Blue and Teal and allies, and one of them enters the gate area. Since it is set to random player, it will choose whether to allow Blue or to allow Teal through the gate, so players may need to re-enter the gate area multiple times before being granted access. Heres what you need

  • Entergate
    • Events
      • Unit - A unit enters Bottomgate <gen>
    • Conditions
      • ((Triggering player) is an ally of Player 1 (Red)) Equal to True
    • Actions
      • Destructible - Open Gate (Diagonal 1) 0000 <gen>
 
Status
Not open for further replies.
Top