Warcraft III resources & community, 2003–2006 · archived

Trigger / Variable Question

7 posts
#1

Trigger / Variable Question

Suppose I want to construct an event that causes one unit to spawn for each of 8 players (Whichever ones are playing) in the center of a region.

Now, I understand the region portion, and the unit selected to spawn. The thing I want to use is a variable to select each of the 8 players and spawn one of thsoe units for them. I also want this trigger to tell which players are currently playing (Suppose 7 are playing, not 8), and only spawn those players this unit.
#2
Thats a very easy trick

For each integer from 1 to *Playernumbers*
If Player[For Integer A] slot status equal to playing
then do Unit-Create *numberofunits* *unittype* for Player[For Integer A] at *yourrect* facing *yourdegrees* degrees
:wink:
#4
I think "is playing" is the problem. They never work for me. Maybe try put together "Slot Equal to User" AND "Slot Not Equal to Has left the Game".
#5
how about making the triggers invidivually for each player?


Event: *event to make the units

Conditions: *Player 1 equal to playing true blah blah

Action Create # of UNIT for PLAYER at RECT facing # Degrees

might work...
#6
Yea, that'll work easily noob, but the thing is, I want to be conservative with my triggers. Any extra triggers that may not be needed, I don't want. Thus using variables rather than individual players. The more triggers, the more lag. Even the more actions in a trigger is more lag. Especially for older machines.
#7
For each integer from 1 to *Playernumbers*
If Player[For Integer A] slot status equal to playing
then do Unit-Create *numberofunits* *unittype* for Player[For Integer A] at *yourrect* facing *yourdegrees* degrees <<<<<<<<< This MUST work....

because I have it in my map too and that still works!
Oah and , better to have not the event at map init.
Then it could be that it doesn'T work. Better to make it so:
Time - Elapsed Game time equal to 1 seconds

etc.