playMaker

Author Topic: Photon Network RPC send int/float ? [Solved]  (Read 8044 times)

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Photon Network RPC send int/float ? [Solved]
« 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
« Last Edit: September 12, 2014, 06:04:31 AM by 600 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon Network RPC send int/float ?
« Reply #1 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

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Photon Network RPC send int/float ?
« Reply #2 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!

HFMgames

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Photon Network RPC send int/float ? [Solved]
« Reply #3 on: December 05, 2015, 10:48:46 AM »
Hello. How to send two variables with a single RPC?

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Photon Network RPC send int/float ? [Solved]
« Reply #4 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.

zorranco

  • Junior Playmaker
  • **
  • Posts: 50
Re: Photon Network RPC send int/float ? [Solved]
« Reply #5 on: December 23, 2015, 10:47:57 AM »
Still nothing on this? Having to build strings and split later makes FSMs look dirtiest.
« Last Edit: December 24, 2015, 05:01:19 AM by zorranco »

zorranco

  • Junior Playmaker
  • **
  • Posts: 50
Re: Photon Network RPC send int/float ? [Solved]
« Reply #6 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?

Raptcha911

  • Playmaker Newbie
  • *
  • Posts: 17
Re: Photon Network RPC send int/float ? [Solved]
« Reply #7 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 ??

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Photon Network RPC send int/float ? [Solved]
« Reply #8 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.