Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Gevarre on June 14, 2013, 10:16:57 PM

Title: How do I send data between networked players?
Post by: Gevarre on June 14, 2013, 10:16:57 PM
I'm still trying to get my in-game networked scoreboard working and am having a bit of trouble getting data between players.

What I've got is a Scoreboard Manager FSM in the scene with an ArrayMaker hash table attached. As each player connects, the manager reads the player's name from the preferences file and stores it in a global variable. I now need to transmit that variable to all players and then tell their manager to append their individual hashtables and refresh the scoreboard.

What I'm having problems with is how to send that player name variable to the other players. I've got a SendRemoteEvent on the scoreboard manager that triggers the event on all other players' managers, but when I set "String Data" within that SendRemoteEvent to the variable I want to send, I get the following error:

Sending RPC 'SendRemoteFsmEvent' failed because the number of supplied parameters doesn't match the rpc declaration. Expected 1 but got 2 parameters.

I have no idea what this error means and I'm probably going about this entirely the wrong way, so any help would be appreciated.

The documentation doesn't really go into what to do with that String Data field other than to say "Use GetEventInfo to read the data", but I have no clue as to how to set that up. In Unity scripting, I would just send an RPC with the data, then the receiving RPC function would just automatically assign that incoming data to whatever variable I wanted and go from there, but I don't know what the equivalent would be in Playmaker.
Title: Re: How do I send data between networked players?
Post by: jeanfabre on June 17, 2013, 06:45:23 AM
Hi,

Odd, Have you double checked the demo? it uses RPC BroadcatFsm Event to send the chat content to a given player so that works as far as I am aware, the problem may be somewhere else in the logic.

don't hesitate to get back to me if you still can't make it work, we'll sort it out.

Bye,

Jean
Title: Re: How do I send data between networked players?
Post by: Gevarre on June 17, 2013, 01:26:24 PM
Which particular demo would that be?

I have the sample scenes, but can't seem to find one that has chat. All I can find is reference to some stuff using Photon, which isn't really usable in my case.
Title: Re: How do I send data between networked players?
Post by: jeanfabre on June 17, 2013, 02:31:17 PM
hi,

 it's in the photon sample scenes package, you can get to it via the playmaker welcome  screen. the link is the following:

http://www.hutonggames.com/samples.php

You will find the documentation of the photon sample here:

https://hutonggames.fogbugz.com/default.asp?W927

If you have more questions based on this, or if some concept are still blur to you, let me know.

bye,

 Jean
Title: Re: How do I send data between networked players?
Post by: Gevarre on June 17, 2013, 03:59:27 PM
Actually, that's still quite confusing. I'm assuming that by "photon sample scenes package", you actually mean "Playmaker Photon Demo".

Then, if I dig around enough, I'm assuming you mean the PlaymakerTestGame scene, since it has chat in it. When I use "assume" in the above, it's because the link you included to documentation is for the Photon DemoWorker sample, which, as far as I can tell, has no playmaker components at all. I need a non-photon solution.

Even if all the above is correct, everything I see here uses PhotonViewRpcBroadcastFsmEvent. I cannot use a Photon because there are too many issues with their solution. Even if I could, the docs for the string portion of PhotonViewRpcBroadcastFsmEvent are identical to Playmaker's SendRemoteEvent:

"Optionnal string data ( will be injected in the Event data. Use 'get Event Info' action to retrieve it)"

As far as I can find, there doesn't seem to be any further explanation of what "Use 'get Event Info' action to retrieve it" means, so I have no idea how to set this up.

Once again, I'll freely admit that it's probably really simple and I'll probably smack my head when I see it and say "Oh, yeah! Why didn't I see that?" SendRemoteEvent may not even be what I should be using here. I just don't know.

If I just had a hint of the basic workflow or concept and a list of which actions I should be using, I could probably figure it out. I get the feeling that once I do figure it all out, it's probably another tutorial I should write :)
Title: Re: How do I send data between networked players?
Post by: jeanfabre on June 19, 2013, 02:00:34 AM
Hi,

 sorry :) in my head there is only one networking solution... my fault.

 ok, let's start again...

Playmaker needs to update to allow for data to be passed using RPC, I'll bump alex on this.

bye,

 Jean
Title: Re: How do I send data between networked players?
Post by: Barakouda on June 25, 2013, 10:39:02 AM
Hello,

so it's not possible to send data (int, float, Vector) with PhotonView RPC Broadcast FSM ? .........I've been looking for days.

All I could do is sending a int value as string in the optional data string..

How to do it ?
Title: Re: How do I send data between networked players?
Post by: jeanfabre on June 25, 2013, 03:33:04 PM
Hi,

 this thread is about Unity networking, not Photon, sorry for the confusion :)

 with Photon, string optional data is supported, its with Unity networking that it's still something to address.


I will start implementing more optionnal data types for Photon. I have added this to my todos.

bye,

 Jean