Playmaker Action GetPlayerProperties called twice?

Options
jrDev
jrDev
Hello,

Throughout my tests I have been having small issues with learning PUN and Playmaker. The latest one isn't much an issue (or maybe it was/will be, and caused some of the headaches I had in the previous threads I created) but I am curious as to why it's happening.
Since I use Playmaker, this might be directed at @jeanfabre,

1. So I currently have Playmaker FSM setup that is on Game Manager object which handles player turns.
2. When the player turn updates, the GameManager then sends an RPC Event "Update Player Turn" to let each player Instance know in their FSMs that the turn has changed.
3. Now in the player FSMs I do a compare Turn Number to make sure it is the actual Player's turn (the Game Manager saves the Turn Number in Room properties) using GetPlayerProperties with the LocalPlayer enum to get the Player's Actor Number.

I was having other issues with Player Properties recently so I had a log that I put in the GetPlayerProperties action that looks like this:

Debug.Log(Time.timeSinceLevelLoad + " user=" + userId.Value + " player=" + _player.UserId + " " + actorNumber.Value + " " + _player.ActorNumber);

I put this extra log after the above to make sure I am not crazy:

Debug.Log("Don't Repeat");

With that setup, here is the weird part; I get the log on the Standalone build that looks like this:

3.952909 user= player="TheID" 2 2
Don't Repeat

3.952909 user="TheID" player="TheID" 0 2
Don't Repeat

The Standalone build is Player 2 since it Joins the created room. See pic of log using SRDebugger asset:


This does not happen in the Editor Play mode, it only logs once. If you notice though, the first log shows user= blank, and the actor number fsm variable as 2, but the second log shows user="TheID" and actor number fsm variable is 0. It looks like it is applying the value to each FSM variable at 2 different times, but if you notice I have the Time.timeSinceLevelLoad logging the same time for each. In the Editor play mode, this is not the case, I get the ID and actor number for Player 1 in the same log for the FSM variables. I have a pic of the FSM too:


The "Check If Current Player" state is where I have the GetPlayerProperties action. It is a puzzling issue and as I said, one that may have caused me issues in the passed when I couldn't retrieve the UserID with the GetPlayerProperties, and then only getting 0 for Actor number in another instance. Any insight into this may help to see if there is a Playmaker issue.

Thanks,
jrDev

Comments