playMaker

Author Topic: Photon + RPC  (Read 2792 times)

steamrollerstudios

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Photon + RPC
« on: July 19, 2013, 03:14:47 AM »
I did a quick search but couldn't find anything that covered this.

If i have a number of players/enemies in the scene, how do i limit an RPC to just a single FSM?

From what i can tell the event is broadcast to all FSM in the scene.

For now I'm send the view ID in the string data and having every FSM check to make sure the RPC is addressing them before proceeding.

Is there a better way?

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
    • SneakOnTheLot.com
Re: Photon + RPC
« Reply #1 on: July 19, 2013, 09:15:05 AM »
Yup, I'm having the same exact issue.

I'm making a gold pickup system for multi-player.  When I pickup a gold it crashes cause the pickup player is not the owner of the game object that it tries to destroy.

So I'm using RPC to broadcast a Destroy Gold Pickup event to the player who owns it. 

It all works great right up until the point where it's suppose to send an RPC event to a Photon target from a string.  The Player Name String variable is there but for some reason it continues to send the event to everyone and not the player's name who is in the Photon Targets From String variable.

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
    • SneakOnTheLot.com
Re: Photon + RPC
« Reply #2 on: July 19, 2013, 09:31:49 AM »
Figured that one out. 

Even though Photon View RPC Broadcast FSM Event has a place where you can put a string target, it didn't work.

I used Photon View RPC Broadcast FSM Event To Player and it worked.

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
    • SneakOnTheLot.com
Re: Photon + RPC
« Reply #3 on: July 19, 2013, 11:21:23 AM »
Spoke too soon.  RPC broadcast event to player isn't working.  :(

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
    • SneakOnTheLot.com
Re: Photon + RPC
« Reply #4 on: July 19, 2013, 05:37:43 PM »
Question:  If only one person is logged into the Photon room, does the Photon View RPC Broadcast FSM Event to Player action even fire? 

My whole rig works if I use Photon View RPC Broadcast FSM Event but then when I try to send it to just a named player, it doesn't.

However, it does fire if there are multiple players in the photon room.

Can someone please tell me what's going on there?

steamrollerstudios

  • Playmaker Newbie
  • *
  • Posts: 5
    • View Profile
Re: Photon + RPC
« Reply #5 on: July 19, 2013, 08:27:36 PM »
Yeah i got the whole system up and running and its working. It just seems like a bit of a waste for each and every FSM in the scene to get an event triggered on them just to realize that it wasn't targeting them. To me it seems like I must be missing something.

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • View Profile
    • SneakOnTheLot.com
Re: Photon + RPC
« Reply #6 on: July 22, 2013, 05:50:17 PM »
Alright, after a bit of testing and days of tireless crying, I've come to some stark realization.

The Photon RPC Broadcast FSM Event To Player only works if there is more than 1 person in the room.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15316
  • Official Playmaker Support
    • View Profile
Re: Photon + RPC
« Reply #7 on: July 29, 2013, 02:28:28 AM »
Hi,

 the ability to fire a local RPC, only the same networkView instances is coming, I have it already here, and It will be shipped in the next update, currently, RPC is "global" in the same ways as regular event sent from playmaker when you use the target "broadcast to all"

bye,

 Jean