Good stuff. Hopefully you get to realize your idea :)
I too have an awesome idea for a game... But I think to do it justice would require a lot more skill than I am able to bring to the table as well as a much bigger budget lol.
Quote from FoxyMayhem:
Thanks man, that helped me understand. So any variable will work for "for each player", right? Is the variable modified by the end of the loop?
----
Yes. You can use any variable of type integer. Each time the loop runs the integer listed as the "player" at the start of the loop will be set to a different player in that group.
Quote from SouLCarveRR:
It increments it at the end of the loop.
----
Forgive my daftness, but does that mean if I run the loop 3 times using the variable PlayerCount = 4, what will the value of PlayerCount be after the loop is run, 4, 3, or 7?
for each player PlayerCount on team 1
{
debug(text(PlayerCount))
}
debug(text(PlayerCount))
Then I think the output should be 4, 1, 2, 3, 3
If you run it on team 2 the output should be 4, 4, 5, 6, 6
But you should check this for yourself cause I am not 100% on the above. Experiment with having multiple players and teams and give it a shot.
by "text( )" There is a function for turning an integer into a text which you can then print out using the "debug( )" function.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Oh, and I read the article you linked.
Good stuff. Hopefully you get to realize your idea :)
I too have an awesome idea for a game... But I think to do it justice would require a lot more skill than I am able to bring to the table as well as a much bigger budget lol.
Thanks man, that helped me understand. So any variable will work for "for each player", right? Is the variable modified by the end of the loop?
It increments it at the end of the loop.
What does that mean?
Quote from FoxyMayhem:
Thanks man, that helped me understand. So any variable will work for "for each player", right? Is the variable modified by the end of the loop?
----
Yes. You can use any variable of type integer. Each time the loop runs the integer listed as the "player" at the start of the loop will be set to a different player in that group.
Quote from SouLCarveRR:
It increments it at the end of the loop.
----
This means the same thing.
Forgive my daftness, but does that mean if I run the loop 3 times using the variable PlayerCount = 4, what will the value of PlayerCount be after the loop is run, 4, 3, or 7?
if you have a 3v3 game and run the code:
PlayerCount = 4
debug(text(PlayerCount))
for each player PlayerCount on team 1
{
debug(text(PlayerCount))
}
debug(text(PlayerCount))
Then I think the output should be 4, 1, 2, 3, 3
If you run it on team 2 the output should be 4, 4, 5, 6, 6
But you should check this for yourself cause I am not 100% on the above. Experiment with having multiple players and teams and give it a shot.
by "text( )" There is a function for turning an integer into a text which you can then print out using the "debug( )" function.