If I want to say, Bob goes first, Ringo Goes second and Sam goes third and Berry goes last then how would I do this?
As a matter of fact, i am okay with it going clockwise and just specifying a turn starting point
The important part is that I can speficy who goes first. However, it is preferred if I can control who's turn it is next.
Thanks,
Best Answer
C
Customer Support
said
almost 6 years ago
Hi Marco,
If you have the challenge set to "Turn Based" you can use "challenge.consumeTurn" to take the turn of any player, though I am not 100% sure if it only works on the next player or which ever player is specified.
I'll look into it in greater detail tomorrow. It may be a case of not setting your challenge to turn based and keeping track of the turns in cloud code yourself.
Shane
1 Comment
Customer Support
said
almost 6 years ago
Answer
Hi Marco,
If you have the challenge set to "Turn Based" you can use "challenge.consumeTurn" to take the turn of any player, though I am not 100% sure if it only works on the next player or which ever player is specified.
I'll look into it in greater detail tomorrow. It may be a case of not setting your challenge to turn based and keeping track of the turns in cloud code yourself.
Marco G. Williams
Hello,
The game I am making requires that turns be taken in a certain order. For example.
Let's say I have some scriptData called activePlayers and this is an array of PlayerName & PlayerId as such.
{"name":Spark.getPlayer().getDisplayName(), "id":Spark.getPlayer().getPlayerId()}
However, I want allow the user to "sit in a specific seat" around a table. So my 10 seats would look something like this.
var seatsArray = [
{"name":"Berry", "id":"254568sdf8sd6f84sdf7"},
{"name":"Ringo Star", "id":"254568sdf8sd6f84sdf8"},
{"name":"Sam", "id":"254568sdf8sd6f84sdf9"},
{"name":"Bob", "id":"254568sdf8sd6f84sdf10"},
]
I think you catch my drift.
If I want to say, Bob goes first, Ringo Goes second and Sam goes third and Berry goes last then how would I do this?
As a matter of fact, i am okay with it going clockwise and just specifying a turn starting point
The important part is that I can speficy who goes first. However, it is preferred if I can control who's turn it is next.
Thanks,
Hi Marco,
If you have the challenge set to "Turn Based" you can use "challenge.consumeTurn" to take the turn of any player, though I am not 100% sure if it only works on the next player or which ever player is specified.
I'll look into it in greater detail tomorrow. It may be a case of not setting your challenge to turn based and keeping track of the turns in cloud code yourself.
Shane
Customer Support
Hi Marco,
If you have the challenge set to "Turn Based" you can use "challenge.consumeTurn" to take the turn of any player, though I am not 100% sure if it only works on the next player or which ever player is specified.
I'll look into it in greater detail tomorrow. It may be a case of not setting your challenge to turn based and keeping track of the turns in cloud code yourself.
Shane
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2485 topics