HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Prison rescue trigger help

04-15-2007, 05:08 PM#1
Knatten
Trigger:
Hero Die team 1
Collapse Events
Unit - A unit Dies
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to Shadow
((Triggering unit) belongs to an ally of Player 1 (Red)) Equal to True
Collapse Actions
Unit - Create 1 Dead Runner for (Owner of (Triggering unit)) at (Random point in Team 2 Prison <gen>) facing Default building facing (270.0) degrees

this trigger works fine, it creates a wisp in a ''prison''. Just like those sheep, tree tags. Shadow unit is a hero.
But now i cant figure out how to make so when an ally of player 1 enters the prison, all dead allys in his team will revive at their start location.
04-15-2007, 06:39 PM#2
wussupallies
Just make it so when a unit enters region (Team 2 Prison) and that unit belongs to an ally of player 1 and isn't a Dead Runner then do a loop (let's say you have x players on the team) that checks it with a boolean

for A 1 ... x
if player dead = true (boolean variable) then
create 1 Shadow at Team 1 Base (region)
end if
end for

now, if you want to do it with hero units, I think you need to modify it slightly by reviving instead of creating a unit, and having all the units you will be reviving stored in an array.

Array Heroes (unit)

Heroes [1] Player 1's Hero
Heroes [2] Player 2's Hero
Heroes [3] Player 3's Hero
Heroes [..] ..

This is a little rough, so someone correct me if there is a more effeceint way to do it. Also, this is just pseudo-code.
04-15-2007, 10:51 PM#3
Anopob
I don't exactly get what you're talking about, but do you mean if X person enters X region all X people get rescued (like in a tag)?

If so, then do: Unit enters region, check if the unit belongs to an ally of player 1, pick all units in that region, kill them, then create them in those player's start locations...