Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 600 on September 09, 2014, 02:25:18 PM

Title: Photon Network RPC send int/float ? [Solved]
Post by: 600 on September 09, 2014, 02:25:18 PM
Hello,

Does PhotonView RPC event and RPC to Player actions have an option to send int and float variables?
There are only String Data options,
do you always convert numbers to send and recieve?
Is it better to send Strings than numbers around the network?

Thanks
Title: Re: Photon Network RPC send int/float ?
Post by: jeanfabre on September 12, 2014, 01:49:50 AM
Hi,

 Only string at the moment is allowed ( if you are ok with scripting you can add your rpc call with all the variables types you need, I can show you where the code is if you want).

 I have added this to the trello task:https://trello.com/c/7uuBZfv8/7-photon

but as I work on uLink integration, I think I may have a much better approach soon where you can send anything and any quantity of variables via rpc with only only one generic call, so stay tuned :)

 Bye,

 Jean
Title: Re: Photon Network RPC send int/float ?
Post by: 600 on September 12, 2014, 05:55:47 AM
Thank you for the reply.

I cant script so I will follow the trello page for updates :)

I checked uLink some time ago and chose Photon instead,
will look in to this again, thanks!
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: HFMgames on December 05, 2015, 10:48:46 AM
Hello. How to send two variables with a single RPC?
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: 600 on December 06, 2015, 10:04:45 AM
Hello. How to send two variables with a single RPC?
Hello, you can Build String with two values, then Split when received.
Split String on the Ecosystem.
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: zorranco on December 23, 2015, 10:47:57 AM
Still nothing on this? Having to build strings and split later makes FSMs look dirtiest.
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: zorranco on January 03, 2016, 06:02:05 AM
I need an approach on this...to spawn bullets in every photon client, we must send a lot of vectors (position, rotation, path) among other data. Because every vector generates 3 floats and thus 3 strings, building all this strings ended with that FSM having more than 100 variables....unmanageable.

I am thinking about an FSM receiving a vector3 and returning the concatenetated string...

What approach do you use for sending all this strings?
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: Raptcha911 on February 25, 2016, 01:29:23 AM
OK so there is still no exclusive solution for this.. I can make a playmaker action for this.. Where you can just input as many strings as you want separated by a space..The action will then put all of these variables into a single array object (of any type Object[]) and you can then send this object through the RPC.. And then I will make an another action that takes this received array object and separates the values in it and store it in given variables... I just want to know if its possible to send an array through the RPC broadcast event ??
Title: Re: Photon Network RPC send int/float ? [Solved]
Post by: 600 on February 25, 2016, 10:39:02 AM
OK so there is still no exclusive solution for this.. I can make a playmaker action for this.. Where you can just input as many strings as you want separated by a space..The action will then put all of these variables into a single array object (of any type Object[]) and you can then send this object through the RPC.. And then I will make an another action that takes this received array object and separates the values in it and store it in given variables... I just want to know if its possible to send an array through the RPC broadcast event ??
Not sure about the Object variable, but maybe it is a good idea to combine BuildString with this RPC action, so you enter strings as you mentioned and the action automatically combines all in one string (could have an option to choose the separator).
Then receiving the event, you Get Event Info > String and use String Split (could set the number of Set RPC strings variable count (when Split they should match tho)).

I am doing this manually already, would be convenient in one action for sure.