HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Interesting Trigger Problem

02-08-2003, 07:06 PM#1
Guest
I'm trying to set up some gates that will open for allies but not for enemies. I've got the triggers working just how I want them except when the gate dies and someoen enters the gate region it immediately brings it back again. My problem is when I try to make a trigger that will turn off the gate open\close triggers when the gate dies, it seems to count the gate opening as dying and it'll disable the trigger immediately. Is there a solution?
02-08-2003, 07:27 PM#2
FyreDaug
first check to see if the doodad is alive, if it isnt set a boolean false and run an if statement off of "alive or not" sorta thing

EVENT:
Unit enters yoru region
CONDITIONS:
blnGateAlive = true
ACTIONS:
If doodad is alive then do (open gate) else set blnGateAlive = false

It'll work for closing it the same way.
02-08-2003, 07:49 PM#3
Guest
Why would I need a condition if my action has a if\then\else statement?

Also the game seems to think a gate opening is the same as a gate dying. How do I set up a condition to set the blnGateAlive variable that won't set it to false every time the gate opens?
02-08-2003, 08:24 PM#4
AlexBS
map initialization set gate=true



trigger1
event: unit enters gateregion
conditions:gate=true, owner of triggering unit=player
actions:set gate=false
open gate

trigger2
unit leaves gate region
set gate=true
wait 5 seconds
if gate=true, then close gate.


if its just gonna be remade instantly, then why dont u just make it invincible?
02-08-2003, 08:50 PM#5
Dinadan87
Quote:
Originally posted by AlexBS

if its just gonna be remade instantly, then why dont u just make it invincible?


Your not paying attention. He DOESN'T want it to come back but he cant find a way around it.
02-08-2003, 08:51 PM#6
Guest
Ok I figured it out. I'll write the trigger down:

TRIGGER ONE:

Events: Unit Enters GateRegion

Conditions: Owner of Triggering Unit is in Human Team

Actions:

Set Gate = Gate + 1
Run Trigger Two



TRIGGER TWO:

Events: none

Conditions: Iron Gate = Alive

Actions:

Set GateAlive = True
Open Iron Gate



TRIGGER THREE:

Events: A Unit Leaves GateRegion

Conditions:

Owner of Triggering Unit is in Human Team

Actions:

Set Gate = Gate - 1
Run Trigger 4



TRIGGER FOUR:

Conditions:

Gate = 0
GateAlive = True

Actions:

Close IronGate
Set GateAlive = False


This trigger only closes when there are no allies in gate region (no getting stuck and having to walk back across region to trigger gate open). It will also stop working when the gate is actually killed so the gate won't resurect every time someone steps on the region.