playMaker

Author Topic: Frustrated with Photon Actions  (Read 4741 times)

RayKatz

  • Playmaker Newbie
  • *
  • Posts: 5
Frustrated with Photon Actions
« on: February 17, 2014, 08:19:16 AM »
Hello there!

I just ported my small multiplayer game from unity networking over to photon by using the photon actions in playmaker. After some troubles because of the additional components I finally figured out what needs what and was happy with the state machine i build. But...

Some of the photon actions don't seem to work at all.
  • "Photon Network Instantiate" doesn't create objects (I have the prefabs in the right place) and doesn't create any errors in the console.
  • "Photon GUILayout Toolbar With Rooms" doesn't show anything.
  • "Photon View RPC Broadcast Fsm Event" doesn't trigger any events, not even locally. It creates in Error in the console: "PhotonView with ID 1 has 2 methods "rpc" that takes 1 argument(s): String. Should be just one?", but I can't figure out how to fix this.

Is there something I miss? I have a PlayMaker Photon Proxy in the scene and all needed components on the objects. It's very frustrating, since I dont want to use the regular Unity networking.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Frustrated with Photon Actions
« Reply #1 on: February 17, 2014, 10:18:13 AM »
Hi,

We'll sort this out:

Can you give some context? are you testing in editor, or else on what platform. what version of unity you are using and what version of playmaker.

-- "Photon Network Instantiate" does work. What do you mean "in the right place", you mean in the "Resources" folder.

-- "Photon GUILayout Toolbar With Rooms" will not show anything if there is no room or if you are not in the lobby. Also, always check against the number of room using the action "Photon Network Get Room Count", if room count is 0, then all is well.

-- "Photon View RPC Broadcast Fsm Event". what event are you sending and are you passing data to it? currently only empty events or events with a string data can be passed trhough the network, this may be the reason ( likely).


Have you studied the sample provided that is 100% done in PlayMaker,

http://www.hutonggames.com/samples.php

 in there all these actions are used and work fine as far as I am aware, so you should study this demo first to understand when and how to use them so that you can then apply them in your own implementation.

I am currently working on the next update, so If I spot anything, I'll report here if this is related.

bye,

 Jean

bye,

 Jean

RayKatz

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Frustrated with Photon Actions
« Reply #2 on: February 17, 2014, 12:11:19 PM »
Hi jeanfabre!

Sorry for not being very precise, but thanks for the answer! I use the latest version of Unity (4.3.4) and the latest Version of PlayMaker (1.7.7 i think? I updated just today). I'm testing in Editor and Standalone.

On Instantiate: Yes, I meant the resources folder. I have the Action in the State, but nothing gets fired. No object gets created, no event happens. If I dont have the object in the resouces folder, I get an error that tells me my mistake, so it definetly calls the action.

On Toolbar: I have a GuiLayout Area with the toolbar and 2 buttons in it. If the toolbar is in there nothing is shown, not even the buttons. Once i deactivate the toolbar, the buttons reappear. Not sure what is happening there.

On Broadcast Event: Wow, I didn't know that! That explains a lot. Thanks for that!

I will check that once I get back from dinner. :3

Edit: I checked the Broadcast Event Action and tried to give it string data. While it now tells me that it sends an event, I still got an error: "PhotonView with ID 1 has 2 methods "rpc_s" that takes 2 argument(s): String, String. Should be just one?" Maybe that is because I have that event in mutiple states?

I will look for the demo and have a look at the implementation. Maybe I'm just blind.

Edit 2: I looked at the demo and learned a lot. But I still don't know what I am doing differently when it comes to Instantiate.

Edit 3: Fixed the toolbar problem. I didn't wait for the room list to actually arrive. Still figuring out why my Instantiate/Event Broadcast doesn't work.

Edit 4: I just tried to use the chat in the demo. Seems like Event Broadcast doesn't work there either. Bug?
« Last Edit: February 17, 2014, 02:24:00 PM by RayKatz »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Frustrated with Photon Actions
« Reply #3 on: February 17, 2014, 02:24:09 PM »
Hi,

 Do you have a photonView on your prefab you are trying to instantiate?

bye,

 Jean

RayKatz

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Frustrated with Photon Actions
« Reply #4 on: February 17, 2014, 02:56:28 PM »
Hi,

 Do you have a photonView on your prefab you are trying to instantiate?

bye,

 Jean

Yes, I have. I even tried it with and without the game object proxy script.


Edit: I figured out why I couldn't use the Event Broadcast. Seems like the event fired before the level was loaded somehow and even the same FSM was supposed to get the event, it didn't happen. Also I had a Photon Proxy Script on my manager object, which seemed to prevented the broadcast. Very irritating!

Wow, I justed tested it after writing this and Instantiate works for whatever reason now. I don't know what I did! But thanks anyway, probably wouldn't figured it out without the demo.

I guess this is solved now. I hope I don't run into similiar problems after this.

Edit again: Instantiate only works if the network group is set to 0. Otherwise it never does anything.

And again: FSM Event Broadcast is very frustrating to use. It seems to only work under specific conditions or timings. Instantiating objects which broadcast events seems to be a good workaround.
« Last Edit: February 17, 2014, 04:28:43 PM by RayKatz »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Frustrated with Photon Actions
« Reply #5 on: February 17, 2014, 10:32:08 PM »
Hi,

 I am glad you are making progress. Indeed a lot of concepts are essentials to fully grasps before multi player game works.

 I guess you also found the help that goes with the demo right? in there you will find hopefully your answers.

https://hutonggames.fogbugz.com/default.asp?W927

each fsm is documented ( and you get to it from the playmakr interface directly as well using the small blue book help button.

FSM Event Broadcast does work as well, study how the chat is working in the demo, it's using this action.

bye,

 Jean

RayKatz

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Frustrated with Photon Actions
« Reply #6 on: February 18, 2014, 02:30:28 AM »
This is what I find weird. I looked at the demo from the site and everything works but the chat. I get errors once I try to send a message over chat and it stops exactly at the Event Broadcast. Once I get back to my computer I will paste the error message here.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Frustrated with Photon Actions
« Reply #7 on: February 18, 2014, 04:38:54 AM »
Hi,

 odd, I just tested yesterday and everything is working.

bye,

 Jean

RayKatz

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Frustrated with Photon Actions
« Reply #8 on: February 18, 2014, 06:48:37 AM »
I think I'm going to lay down for a while. Just tested the demo again, everything is working... What is happening? x(

I guess some quirk happened; thanks for the help. Guess next time I restart before running around cursing the console. I think after that I should be able to figure everything out. Thanks!