HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Problem with Gate

02-28-2006, 06:02 PM#1
GordonBBB
Well, I have a gate, but the problem is that if I have two units in the gate and one leaves, the gate closes and the other unit has to leave the gate region before being able to open the gate...
How do I make a gate that will open whenever a unit is near it, and close then there are no units in the region?

This is what I have so far:

Trigger:
Opening Gate
Collapse Events
Unit - A unit enters Gate <gen>
Collapse Conditions
((Owner of (Triggering unit)) is in (All allies of Player 1 (Red))) Equal to True
Collapse Actions
Destructible - Open Gate (Diagonal 2) 0897 <gen>
and
Trigger:
Closing gate
Collapse Events
Unit - A unit leaves Gate <gen>
Collapse Conditions
((Owner of (Triggering unit)) is in (All allies of Player 1 (Red))) Equal to True
(Gate <gen> contains (Triggering unit)) Equal to False
Collapse Actions
Destructible - Close Gate (Diagonal 2) 0897 <gen>
02-28-2006, 06:08 PM#2
Thunder_Eye
Make an integer comparsion and check if it is more then 0 units in the region

here:
Trigger:
Closing gate
Collapse Events
Unit - A unit leaves Gate <gen>
Collapse Conditions
(Owner of (Triggering unit)) is in (All allies of Player 1 (Red))) Equal to True
(Gate <gen> contains (Triggering unit)) Equal to False
(Number of units in (Units in Gate <gen>)) Equal to 0
Collapse Actions
Destructible - Close Gate (Diagonal 2) 0897 <gen>
02-28-2006, 06:11 PM#3
GordonBBB
thanks ill try that
02-28-2006, 06:14 PM#4
Thunder_Eye
You might instead want to do a check if "number of units in "Gate Region" owned by "a ally of player 1" equal to 0.
Because as it is now the gate wont close if there is an enemy in there, even if you empty it on all your units it wont.
02-28-2006, 11:11 PM#5
BuRnInSpartan
you don't need

(Gate <gen> contains (Triggering unit)) Equal to False

if you have

(Number of units in (Units in Gate <gen>)) Equal to 0

other than that Thunder_Eye's trigger should be fine
03-01-2006, 02:11 PM#6
Thunder_Eye
Yeah I know, didnt have time to change his trigger so just copyed it and added what he needed.
03-01-2006, 11:29 PM#7
BuRnInSpartan
hehe that's cool... wonder when gordon BBB will post back i hope he got it to work