playMaker

Author Topic: Photon Scene object RPC's?  (Read 6131 times)

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Photon Scene object RPC's?
« on: May 04, 2016, 10:56:08 AM »
Hello,

I have a photonscenceinstantiate monster and everything works well with the master client controlling all aspects of its movement and then clients sync to that info.

My issue is when I try to send an RPC to a targeted (by name player) to deal damage using Photon View RPC Broadcast Fsm Event To Player it does nothing?

If I use Photon View RPC Broadcast Fsm Event it works but it applies damage to all players?

Can anyone tell me where I am going wrong? is this a shortfall of using scene instantiated objects?


600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Photon Scene object RPC's?
« Reply #1 on: May 04, 2016, 11:09:29 AM »
Hello,

I use "Photon View RPC Broadcast Fsm Event To Player" too and it works, maybe the name is not correct? Do you get the name as string at runtime or put it there manually? If it's manually the player might have a "(Clone)" next to its name when he is instantiated.

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Photon Scene object RPC's?
« Reply #2 on: May 04, 2016, 11:36:28 AM »
Hi Thank you for replying.

I am using Photon View Get Owner Properties, which changes from the name of the object "player:ME" to a string "Guest 2308" (for example) and then using Photon View RPC Broadcast Fsm Event To Player and sending to string name "Guest 2308". I can send this event from a playerinstanciate but not a sceneinstanciate for some reason? Am I missing something obvious

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Photon Scene object RPC's?
« Reply #3 on: May 04, 2016, 11:44:24 AM »
Have you tried this action specially for sending to players "Photon View RPC Broadcast Fsm Event To Player"?
I have not used with the regular RPC action and setting the name like that...
Maybe the dedicated action will work for your setup too.

EDIT: Oh wait I just noticed it is that action... let me double check where I get the player's name
« Last Edit: May 04, 2016, 11:48:16 AM by 600 »

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Photon Scene object RPC's?
« Reply #4 on: May 04, 2016, 11:52:17 AM »
Hi,

Yes I can confirm I am using "Photon View RPC Broadcast Fsm Event To Player", playmaker is just truncating the name on my display.

Have you tried specifically from an instantiatedSceneObject as it is fine everywhere else for me.

Thank you!

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Photon Scene object RPC's?
« Reply #5 on: May 04, 2016, 12:14:15 PM »
Hey yes you are right, it won't work. Because you send it to your self (the master)? Scene view objects belong to the master client, so you can do a check if the player isMaster send a regular global event, if other - send this RPC.
Sending from scene object to joined (not master) player works.

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Photon Scene object RPC's?
« Reply #6 on: May 04, 2016, 12:17:45 PM »
You are literally the very best! thank you so much for the help, I will test it out later and let you know how I get on!

Much appreciated!

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Photon Scene object RPC's?
« Reply #7 on: May 04, 2016, 12:38:14 PM »
No problem, happy to help _ Playmaker + Photon <3  ;D ;D
Good luck!

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Photon Scene object RPC's?
« Reply #8 on: May 04, 2016, 02:29:10 PM »
Ok wow so it works! now I have AI that can damage a player, great......but......
How do I send events from the non-master clients to the AI's controlled by the master? as in how does a player (non-master) send an event to a specific individual scene instance for damage.

I have tried using broadcast to player using the AI as the name but it doesn't seem to work. Do I need to do some sort of broadcast all and then filter with the string data?

Help is so massively appreciated!

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 715
    • Flashing Lights
Re: Photon Scene object RPC's?
« Reply #9 on: May 04, 2016, 02:56:49 PM »
Actions:
Photon View Get ID
Photon View Find By View ID

Get the AI id, send it to the master, master finds it and does an event. Something like that ;)

adrian

  • Junior Playmaker
  • **
  • Posts: 52
Re: Photon Scene object RPC's?
« Reply #10 on: May 12, 2016, 03:57:31 PM »
Hi, thanks for all the help, all solved, got ICE Creatutes working well in a photon multiplayer environment now. Hats off sir!