Ok so I have variables Player and Player t both are an array of 6 ints and NTeams is set to 3.
In the debugger I get that im accessing negitive array indexes.
Why wont this code work below?
Variable - Set Teams[1][1] = 1
Variable - Set Teams[1][2] = 4
------- --
Variable - Set Teams[2][1] = 2
Variable - Set Teams[2][2] = 3
------- --
Variable - Set Teams[3][1] = 5
Variable - Set Teams[3][2] = 6
------- --
General - For each integer Team from 1 to NTeams with increment 1, do (Actions)
Actions
General - For each integer Play from 1 to 2 with increment 1, do (Actions)
Actions
Variable - Set Player[(Player Play from (Players on team Team))] = Teams[Team][Play]
Variable - Set PlayerT[Teams[Team][Play]] = (Player Play from (Players on team Team))
Most likely (Player Play from (Players on team Team)) is evaluating to -1 when Play is 2, because the team only has one player? Are you starting the game through a game lobby, or map editor test? If map editor test, I think every computer you put in will have their own team.
But how is it setup? If PlayerT was a sol variable then why is there a varible inside of it; and if your using a record for this one, have you missed it on your other variables? I could care less what your using them for, we need to know how your using them.
Again maybe you should clarify what exactly your trying to do. If you want to match the lobby players to the team that they originally entered on you can just lock the lobby. Your aware that players are numbered according to when they enter not where they are in lobby. Also what is with player 4?
I think it would be simplier to just set each index of the player array equal to the player position on each team since you're already setting up their positions in the teams array.
Again maybe you should clarify what exactly your trying to do. If you want to match the lobby players to the team that they originally entered on you can just lock the lobby. Your aware that players are numbered according to when they enter not where they are in lobby. Also what is with player 4?
----
Thats exactly what I'm trying to fix. Make player in team 1 act as if player 1, which is where the 2 arrays come in. They are both arrays of 6 ints. So far my system seems to be working right. I just wish there was an easier way to do it.
Ok so I have variables Player and Player t both are an array of 6 ints and NTeams is set to 3.
In the debugger I get that im accessing negitive array indexes.
Why wont this code work below?
Variable - Set Teams[1][1] = 1
Variable - Set Teams[1][2] = 4
------- --
Variable - Set Teams[2][1] = 2
Variable - Set Teams[2][2] = 3
------- --
Variable - Set Teams[3][1] = 5
Variable - Set Teams[3][2] = 6
------- --
General - For each integer Team from 1 to NTeams with increment 1, do (Actions)
Actions
General - For each integer Play from 1 to 2 with increment 1, do (Actions)
Actions
Variable - Set Player[(Player Play from (Players on team Team))] = Teams[Team][Play]
Variable - Set PlayerT[Teams[Team][Play]] = (Player Play from (Players on team Team))
@penguinwars: Go
Most likely (Player Play from (Players on team Team)) is evaluating to -1 when Play is 2, because the team only has one player? Are you starting the game through a game lobby, or map editor test? If map editor test, I think every computer you put in will have their own team.
@DeltaV:
I am doing it from test document. How would I fix the problem though?
Just an if to check if the returned value of player on team is >=0?
You could use "For each Player Play in player group(Players on team Team)" so that you don't loop through any players that don't exist.
What is this PlayerT[Teams[Team][Play]] variable? Is this a record? It doesn't match up with the one you use previously.
@hobbidude:
Well Player is used for converting player to new player( team deceides it )
PlayerT is used for converting team player to new player.
@penguinwars: Go
But how is it setup? If PlayerT was a sol variable then why is there a varible inside of it; and if your using a record for this one, have you missed it on your other variables? I could care less what your using them for, we need to know how your using them.
Again maybe you should clarify what exactly your trying to do. If you want to match the lobby players to the team that they originally entered on you can just lock the lobby. Your aware that players are numbered according to when they enter not where they are in lobby. Also what is with player 4?
I think it would be simplier to just set each index of the player array equal to the player position on each team since you're already setting up their positions in the teams array.
@hobbidude:
Quote from hobbidude:
@penguinwars: Go
Again maybe you should clarify what exactly your trying to do. If you want to match the lobby players to the team that they originally entered on you can just lock the lobby. Your aware that players are numbered according to when they enter not where they are in lobby. Also what is with player 4?
----
Thats exactly what I'm trying to fix. Make player in team 1 act as if player 1, which is where the 2 arrays come in. They are both arrays of 6 ints. So far my system seems to be working right. I just wish there was an easier way to do it.
Wont let me edit my above post :/.
So far my system seems to be working right. I just wish there was an easier way to do it.
If you just trying to match lobby teams to integers top down then just use:
Variable - Set players[1] = (Player 1 from (Players on team 1))
A go through each index and set which player/team from the lobby. Nothing else is really needed
The reason why I did it the way I did is because team 1 isnt 1 and 2 it is 1 and 4.
@penguinwars: Go So you can't go?
Variable - Set players[4] = (Player 2 from (Players on team 1))