HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

To Close a Opened Gate

07-05-2005, 01:36 AM#1
MrApples
A big problem I've had for a while now. There are gate commands for the map I am working on. I can't find a way to close the gates, to open them yes, but not to close them.

It isn't as simple as explained above though, if someone could close the gate all they wanted by just typing a chat message -close gate, it would be an exploit cause they could keep refreshing the gates health. And I can't have a trigger where if the gate is destroyed turn off the close function because opening the gate destroys the gate.

Is there anyway to do this?
07-05-2005, 01:54 AM#2
FLUFFwc3
Never tried it, but maybe if a player types -close gate1 then it could first save the old gate's HP as a variable or custom value or something, then close the gate, then make the closed gate have the saved HP.
07-05-2005, 01:56 AM#3
Setreal
Simply store the health in a variable when opened and set the gate's health to it when closed to avoid refreshing hp.

Edit : Bleh beaten to it.
07-05-2005, 12:35 PM#4
MrApples
K, what variable do I use for that in case I don't find?
07-05-2005, 01:14 PM#5
oNdizZ
use real when storing life.
07-05-2005, 01:28 PM#6
SrPrez
Yeah I dunno how to do those code msgs in wc3campaigns but neways Ive done this before and just setup two triggers, one being like "open player1" and one is "close player1"

for open--------------------------------------------
Event - Player 1 Red, types a chat message containing -open as an exact match

Condition - Elven Gate blah blah (just click on ure unit in WE to use it instead of my gate) is dead equal to false <---- Boolean Comparison

Action- Set doorlife1 (a real variable u shall create :P) = (current life of Elven Gate)

-Set Gate1 = 1 (I set up a variable to ensure ppl cant double open their gates and hence healing it every time, so 1 means the gate is open 0 means its closed, think finite state machines)

-Destructible - Open Elven Gate (or w/e gate ures is)

for closing-------------------------------------------
Event - Player 1 Red, types a chat message containing -close as an exact match

Condition - gate1 = 1

Action - Destructible - Close Elven Gate (or w/e gate ures is)

Set gate1 = 0

Destructible - Set life of Elven Gate to doorlife1

HAPPY MAPPING