HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Stupid Trigger! Can't figure it out!

01-31-2003, 09:32 PM#1
Guest
Hi, I can't figure out how to compile a trigger that will generalize what I wan't it to do. I want to make it so that it will create a certain amount of units every 20 seconds in the game according to how many players in the game. For example, I want to create only 1 footman if there are 1-3 players in the game, and I want to create 2 footman if there are 4-6 players in the game, and I want to create 3 footman if there are 7-9 players the game etc... I want to make it so I don't have to predict every possible outcome of players and player slots that they might be in. Please respond as soon as possible.:bangH:
01-31-2003, 10:23 PM#2
DaKaN
---Moved---

Just a friendly reminder.

Do not post questions in the repository, that section is for working code you wish to share with others.

As far as your question goes:

make 2 varibles. A Interger varible and a Player Group varible.

At the beginning of the map. do:

Player Group - Clear (or does it say remove..) All players from Player Group (your varible)

For each interger A from 1 to (max players in your map) IF (Player slot status is = to Is Playing) then do (add player to Player Group[Varible] else (Do nothing)

then after you did that

Set Varible (your interger varible) = to Player Group - Count the number of players in player group (varible again)

make this a seperate trigger of its own and have it repeat every 5 or 10 seconds just in case anybody leaves the game.

As far as spawning goes, just use If statments and use Interger Comparison. E.G If (Varible) Is = to 5 then do (trigger here)
and so on