Player turn?

Game development with Board Game Arena Studio
Post Reply
User avatar
DargorX
Posts: 33
Joined: 10 September 2012, 20:16

Player turn?

Post by DargorX »

Hi there developers!

A player can be active outside his natural turn for a thousand reasons, but I need to know whose turn it is at certain times of the game.

Is there any way to know whose player's turn it is, regardless of who the active player is?

Looking at the database, it looks like the global variable number 2 might contain the value of the player whose turn it currently is, but I'm not entirely sure. I also don't know if I can access those variables.

Thanks!
User avatar
Tisaac
Posts: 2736
Joined: 26 August 2014, 21:28

Re: Player turn?

Post by Tisaac »

DargorX wrote: 13 May 2025, 10:53 Hi there developers!

A player can be active outside his natural turn for a thousand reasons, but I need to know whose turn it is at certain times of the game.

Is there any way to know whose player's turn it is, regardless of who the active player is?

Looking at the database, it looks like the global variable number 2 might contain the value of the player whose turn it currently is, but I'm not entirely sure. I also don't know if I can access those variables.

Thanks!
There is no such thing as a turn so you have to handle it yourself :)
User avatar
DargorX
Posts: 33
Joined: 10 September 2012, 20:16

Re: Player turn?

Post by DargorX »

Tisaac wrote: 13 May 2025, 12:34
DargorX wrote: 13 May 2025, 10:53 Hi there developers!

A player can be active outside his natural turn for a thousand reasons, but I need to know whose turn it is at certain times of the game.

Is there any way to know whose player's turn it is, regardless of who the active player is?

Looking at the database, it looks like the global variable number 2 might contain the value of the player whose turn it currently is, but I'm not entirely sure. I also don't know if I can access those variables.

Thanks!
There is no such thing as a turn so you have to handle it yourself :)
That's what I figured. I was asking mostly to find out if anyone had ever faced the same problem :P
User avatar
Kayvon
Posts: 1059
Joined: 17 October 2011, 01:39

Re: Player turn?

Post by Kayvon »

For sure. Just set an internal variable to track it. I do the same thing with the first player marker in many, many games.
User avatar
DargorX
Posts: 33
Joined: 10 September 2012, 20:16

Re: Player turn?

Post by DargorX »

Kayvon wrote: 14 May 2025, 14:16 For sure. Just set an internal variable to track it. I do the same thing with the first player marker in many, many games.
Thanks, I will do it this way.
User avatar
RicardoRix
Posts: 2540
Joined: 29 April 2012, 23:43

Re: Player turn?

Post by RicardoRix »

as a matter of interest, isn't this the difference between, getActivePlayerId() and getCurrentPlayerId() ?

the activePlayerId() will be the player with the spinning timer awaiting their move.
getCurrentPlayerId() will be the player that sent the request, possibly outside of their turn.

So then, yes, if the active player is not the player's who's turn it is, then you'd need to track it.
Post Reply

Return to “Developers”