Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 600 on January 17, 2019, 06:58:06 PM

Title: Photon RPC Broadcast Target FSM[SOLVED]
Post by: 600 on January 17, 2019, 06:58:06 PM
Hello,
I am trying to target a specific scene game object's FSM as RPC target. I understand it can not reference an object directly. Tried adding Photon View and proxy, also instantiate the object similar as players, still getting the error.
Profiler shows that RPC broadcast all events are creating CPU spikes and now researching a way to send them directly to the manager, which deals all the RPC.
How those dropdown options are intended to be used (target as gameobj or FSM), any tips appreciated.

Thanks!

(https://i.imgur.com/w5m3QZp.jpg)

(Photon Classic)
error:
Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.PhotonViewRpcBroadcastFsmEvent.DoREC () (at Assets/PlayMaker PUN/Actions/PhotonViewRpcBroadcastFsmEvent.cs:94)
HutongGames.PlayMaker.Actions.PhotonViewRpcBroadcastFsmEvent.OnEnter () (at Assets/PlayMaker PUN/Actions/PhotonViewRpcBroadcastFsmEvent.cs:44)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState.OnEnter () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2695)
HutongGames.PlayMaker.Fsm.SwitchState (HutongGames.PlayMaker.FsmState toState) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2642)
HutongGames.PlayMaker.Fsm.UpdateStateChanges () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2570)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2711)
HutongGames.PlayMaker.Fsm.Update () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1934)
PlayMakerFSM.Update () (at C:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:539)
Title: Re: Photon RPC Broadcast Target FSM
Post by: jeanfabre on January 18, 2019, 02:44:47 AM
Hi,

 yes, this is a problem indeed, because I can't show a custom field for this, and so this actio only accept Self or BroadcastAll as options for Event Target.

 I have modified the action so that it errors out inside the action if you are not using the right one, at least you will not waiste time on this. Sorry about that.

so the likely option for you is to choose Self.

 Bye,

 Jean
Title: Re: Photon RPC Broadcast Target FSM[SOLVED]
Post by: jeanfabre on January 18, 2019, 03:07:02 AM
Hi,

 a new version is up on the ecosystem, with this new error checking to prevent this kind of time waiste :)

 Bye,

 Jean
Title: Re: Photon RPC Broadcast Target FSM[SOLVED]
Post by: 600 on January 18, 2019, 05:01:48 AM
Hi, ok got it, thank you Jean :)
Title: Re: Photon RPC Broadcast Target FSM[SOLVED]
Post by: jeanfabre on January 18, 2019, 05:54:02 AM
Hi,

 ok, keep up the great work with Flashing light, I hope it's going well for you!

Bye,

 Jean