| 10-11-2004, 05:25 PM | #1 |
I know this is really basic and lots of people probably know it and use it, but i thought i would put this up for people that may not know it. If you have a lot of triggers that trigger for certain people and a region for that person(EX: A TD map and you have locations like Red, Blue, so on for everyone and you want them to be able to type '-destroy' to kill all the buildings in their region), you could use this. Make a Region Array variable name for example Region. At your Map initialization trigger set every persons Region(Red, Blue, so on) to Region[(Player Number of (Triggering Player))]. Now that you have that, every time you need something done in a person region, all you use is, for example: Unit - Create 1 Footman for (Triggering player) at (Center of Regions[(Player number of (Triggering player))]) facing Default building facing degrees Since its such an easy trigger i wont upload a map, just give you the triggers here: Code:
Start
Events
Map initialization
Conditions
Actions
Set Regions[(Player number of Player 1 (Red))] = Red <gen>
Set Regions[(Player number of Player 2 (Blue))] = Blue <gen>
Set Regions[(Player number of Player 3 (Teal))] = Teal <gen>
Set Regions[(Player number of Player 4 (Purple))] = Purple <gen>
Set Regions[(Player number of Player 5 (Yellow))] = Yellow <gen>
Set Regions[(Player number of Player 6 (Orange))] = Orange <gen>
Set Regions[(Player number of Player 7 (Green))] = Green <gen>
Set Regions[(Player number of Player 8 (Pink))] = Pink <gen>
Destroy
Events
Player - Player 1 (Red) types a chat message containing -destroy as An exact match
Player - Player 2 (Blue) types a chat message containing -destroy as An exact match
Player - Player 3 (Teal) types a chat message containing -destroy as An exact match
.
.
.
Conditions
Actions
Unit - Create 1 Footman for (Triggering player) at (Center of Regions[(Player number of (Triggering player))]) facing Default building facing degrees |
| 10-11-2004, 07:20 PM | #2 |
Actually if you want to make the stuff simple, you can just use a point array instead, and the player number of player 1 is always going to be 1, and you can save some event creating time too: Code:
Start
Events
Map initialization
Conditions
Actions
Set Points[1] = Center of (Red <gen>)
Set Points[2] = Center of (Blue <gen>)
Set Points[3] = Center of (Teal <gen>)
Set Points[4] = Center of (Purple <gen>)
Set Points[5] = Center of (Yellow <gen>)
Set Points[6] = Center of (Orange <gen>)
Set Points[7] = Center of (Green <gen>)
Set Points[8] = Center of (Pink <gen>)
Player Group (Pick every player in All Players) and do actions:
Trigger to Destroy add the event (picked player) types a chat message containing -destroy as An exact match
Destroy
Events
Conditions
Actions
Unit - Create 1 Footman for (Triggering player) at (Points[(Player number of (Triggering player))]) facing Default building facing degreesThis way it won't even leak points each time youj type -destroy |
