HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Capture Trigger?

06-03-2008, 06:59 PM#1
collisionrunner
I would like to make a map with capture points (like the points you have to capture in Team Fortress 2), but am not sure I understand triggers well enough to manage this simple task. What I need is a trigger that will count down to 0 and then once it reaches 0 it will grant control of the point to Player X who captured it, but it needs to stop if there are Player Y units in the region, and should all of the Player X units die or leave the region, it needs to start counting back up and then down to 0 once again, granting control to Player Y once it hits 0. I also need it to count down faster depending on the number of Player X or Player Y units in the region (i.e. 2 Player Y units in Region 1, then Region 1 counts down twice as fast). If anyone could point me in the right direction to at least get this started I would greatly appreciate it.

Oh, I forgot to mention, each region is represented by a tower unit that will change color depending on who captured it. Not sure if that is necessary info, but I thought I should include it. Thank you.
06-03-2008, 08:13 PM#2
rulerofiron99
First of all, you'll need an integer value.

Next, you make a trigger that

increases or decreases that integer by the amount of units owned by players in the player group.

Should be quite simple, if you don't understand I could make you a test map.
06-03-2008, 09:49 PM#3
collisionrunner
If you would be willing to make me a test map, I would greatly appreciate it. I'm sorry for the hassle, but I learn better when I have something to tinker with. Thank you very much.
06-03-2008, 10:52 PM#4
C0mm4nd3r
i whould use something liek these:

Code:
Core

a unit enters region Tower1region

if Tower1 is owned by player 2
and P2unitinT1region = True
then
Kill all units in Tower1region owned by player 1
else
if Tower1 is owned by player 1
and P1unitinT1region = True
then
kill all units in Tower1region owned by player 2
else 
if entring unit is owned by player 1
then
set P1UnitinT1region = True
set T1RegionP1Units = T1RegionP1Units +1
Run CountbackT1 gen 

else if entring unit is equal to owned by player 2
set P2UnitinT1region = True
then
set T1RegionP2Units = T1RegionP2Units +1
Run CountforwardT1 gen


-----------------------------------------------


CountbackT1

loop
if P1unitinT1region is Ture
set T1Cpoints = T1Cpoints - T1RegionP1Units
wait 1 second
else if P2unitinT1region is True
Turn off these Trigger

CountforwardT1

loop
if P2unitinT1region is True
set T1Cpoints = T1Cpoints + T1RegionP2Units
wait 1 second
else if P1unitinT1region is True
Turn off these Trigger


------------------------------------------------
T1Owner


Every 1 seconds of game time

if T1Cpoints is equal to 0 or less

Change Tower1 owner to Player 1

else if T1Cpoints is equal to 100 or more

Change Tower1 owner to Player 2

i hope you understand it ^^


PD: with T1 i mean Tower 1, with P1/2 i mean Player 1/ 2

GGL&HF!
06-04-2008, 04:39 AM#5
collisionrunner
that's way over my head, man, haha, but if you could send me a PM or e-mail and walk me through it i would be very greatful, but i know it's asking a lot, so no obligation or anything. thank you for at least trying, haha, but i'm brand new to triggers
06-04-2008, 05:41 AM#6
rulerofiron99
I'll do it when I get back from school.

Another quick fix I just thought about:

Make the tower a unit that can be destroyed, and when it gets destroyed, make a new one for the owner of triggering unit.