HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Array

06-26-2005, 01:30 AM#1
MrApples
Anyone mind explaing how to identify players connected to variables with array?
06-26-2005, 03:52 AM#2
volatile
How exactly do you want to identify them?

There is already an identifier in the GUI map editor called
(Conversion Convert player index to player)
This is an Array already built in for you to use to refer to individual players.
06-26-2005, 08:58 AM#3
Anitarf
Quote:
Originally Posted by volatile
How exactly do you want to identify them?

There is already an identifier in the GUI map editor called
(Conversion Convert player index to player)
Remember, player[0] = Player1 player[1] = Player2, etc...
This is an Array already built in for you to use to refer to individual players.
Actually, in GUI, player[1]= Player1. The GUI function "convert player index to player" is translated into JASS function ConvertedPlayer(), instead of the function Player().
06-27-2005, 07:32 PM#4
MrApples
Example.
A easy way to do an on and off fuction is have a trigger that sets a veriable to 0, and a variable that sets the same variable to 1.
If the variable is one, the triggers that use it work, if its 0, they don't.

Is it possible to use one variable-integer for every player and keep track of whether its on or off for each player, and if so is it possible to identify triggering player to the variable.
06-27-2005, 07:50 PM#5
Tim.
Why not a boolean array?

Quote:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
<Your conditions>
Then - Actions
Set BOOLEANARRAY[(Player number of (Owner of (Triggering unit)))] = True
Else - Actions
Set BOOLEANARRAY[(Player number of (Owner of (Triggering unit)))] = False