| 02-07-2003, 08:16 PM | #1 |
Guest | I want to make a trigger that only opens a gate for one team and not the other. I know I can do it by doing owner of triggering unit = red or blue or green etc but that's clumsy as hell and can't be the best way. Anyone know a way to make a trigger that's something like: player is in PlayerGroupWhatever = true? |
| 02-07-2003, 09:03 PM | #2 |
make a player group array varible, at the start of the map, do a for each interger a from 1 to (how many people are on team 1) and do if thier slot is = to is playing add them to player group[1] then do the same for team 2 but add them to [2] e.g. for each interger a 1 to 4 do if player intergerA slot status = to is playing then add player intergerA to playergroup Group[1] for each interger a 5 to 8 do if player intergerA slot status = to is playing then add player intergerA to playergroup Group[2] that would take care of players 1 2 3 and 4 for 1 team and 5 6 7 and 8 for the other (of course u need to edit that if those arnt your teams) Then you would have Unit Enter Region (the region that will open your door) Conditions BOOLEAN - Player is in Player Group = to true then your actions |
| 02-07-2003, 09:46 PM | #3 |
Guest | Thank you. |
| 02-07-2003, 10:30 PM | #4 |
Guest | Hmm well then since I'm making a gate I need it to open and close at the right times. Ive got it to open and now I need a trigger that will activate whenever a unit owned by player in player group leaves the gate region. It has to have a condition that checks if any units owned by players in player group are still within region. I need this so that the gate will not close while you're trying to move lots of troops through it and such. Any ideas? |
| 02-07-2003, 10:53 PM | #5 |
thats a tricky one.. gotta think about that one first thing that comes to mind is make 2 regions, 1 that opens (small region close to gate) and a larger region that closes, covers more area so u have time to move troops though |
| 02-07-2003, 10:55 PM | #6 |
Guest | Yeah there are lots of ad-hock methods but they all end up doing stupid things sometimes and getting in the way. I hope you can figure out an elegant solution cause I can't :) |
| 02-08-2003, 04:16 AM | #7 |
Guest | I came up with a decent solution. I give each gate a variable and count it up every time someone enters the region and count it down every time someone leaves. When someone leaves I also run a trigger that checks if the variable = 0. If it does it closes the gate cause it means no units are in the area. Good? |
