Ok, I was inspired by the Phantom game and I wanted to create my own version like it...but much much smaller and simplier. (the scale for everything is .4 teehee!)
Anyway, there are 4 players and one is going to be the 'Guy' (haven't come up with a name) and they get more minerals and stuff...
I have looked around and tried some things and all failed...How could I do this?
I'm guessing that I need a variable that has an array of 3 and have each player as a number. at the start of the game, pick a random number in the array and he/her becomes the 'Guy' But how would I give him/her the extra stuff?
So you're asking how to pick a player randomly? Player values are just integers. Player groups are collections of players. At the start of the match, add each player to a player group and pick a random index from 1 to the size of the group to select a random player. Create a action, 'give stuff' with a parameter 'player' of type 'integer'. Perform actions using that player index. You should be able to find functions that are built in capable of creating a player group, testing its size, adding players to a player group, testing whether a player slot is active, and etc. If you want to store who 'the guy' is, create a global integer variable which will store the player #.
Wait a minute....ok, i get what you say, so I went into the trigger editor, Made the Player Group (Do i create 4 for each person? Or just one for everybody?) with an array of 3. Went into the initialization and created the action Set Variable... here is what it looks like:
Set Player Start Group[0] = Value
When I click value where do I go? because it seems that i cannot add one player to each array value ([0] = Player 1, [1] = Player 2, [2] = Player 3, [4] = Player 4). Would I just not make the variable an array and use all players? Or Convert Player to player group?
I'm stumped... :[
-Mr12toe
Edit: Found the action a second after posting this....I hate it when that happens. Anyway now all i need to do is pick a random player...How would I do this?
I was saying use a player group variable type, not an array. There should be a player group function 'add player to player group' or something along those lines. There is a method that gets the value (player #) from the player group at a specific index of the group. Think of the player group like an array, but the max size appears to vary. You want to select a random index from 1 to 'players in player group' (max size) using the math random integer function. I'd write up the triggers but I'm away from my computer.
It should look something like -
Set variable 'theGuy' = player from player group(random integer from 1 to players in player group(playerGroupVar))
Look in the math and player group trigger sections using the left hand side of the trigger selection menu.
Ok, I was inspired by the Phantom game and I wanted to create my own version like it...but much much smaller and simplier. (the scale for everything is .4 teehee!)
Anyway, there are 4 players and one is going to be the 'Guy' (haven't come up with a name) and they get more minerals and stuff...
I have looked around and tried some things and all failed...How could I do this?
I'm guessing that I need a variable that has an array of 3 and have each player as a number. at the start of the game, pick a random number in the array and he/her becomes the 'Guy' But how would I give him/her the extra stuff?
@Mr12toe: Go
So you're asking how to pick a player randomly? Player values are just integers. Player groups are collections of players. At the start of the match, add each player to a player group and pick a random index from 1 to the size of the group to select a random player. Create a action, 'give stuff' with a parameter 'player' of type 'integer'. Perform actions using that player index. You should be able to find functions that are built in capable of creating a player group, testing its size, adding players to a player group, testing whether a player slot is active, and etc. If you want to store who 'the guy' is, create a global integer variable which will store the player #.
@Ultimaswc3: Go
Wait a minute....ok, i get what you say, so I went into the trigger editor, Made the Player Group (Do i create 4 for each person? Or just one for everybody?) with an array of 3. Went into the initialization and created the action Set Variable... here is what it looks like:
Set Player Start Group[0] = Value
When I click value where do I go? because it seems that i cannot add one player to each array value ([0] = Player 1, [1] = Player 2, [2] = Player 3, [4] = Player 4). Would I just not make the variable an array and use all players? Or Convert Player to player group?
I'm stumped... :[
-Mr12toe
Edit: Found the action a second after posting this....I hate it when that happens. Anyway now all i need to do is pick a random player...How would I do this?
@Mr12toe: Go
I was saying use a player group variable type, not an array. There should be a player group function 'add player to player group' or something along those lines. There is a method that gets the value (player #) from the player group at a specific index of the group. Think of the player group like an array, but the max size appears to vary. You want to select a random index from 1 to 'players in player group' (max size) using the math random integer function. I'd write up the triggers but I'm away from my computer.
It should look something like - Set variable 'theGuy' = player from player group(random integer from 1 to players in player group(playerGroupVar))
Look in the math and player group trigger sections using the left hand side of the trigger selection menu.
@Ultimaswc3: Go
So basically I make ONE player group variable, set all the players to that group, then use your trigger?
W00T! I got it to work nicely!