playMaker

Author Topic: How to use ISme[photon][halp!!]?  (Read 3650 times)

ghost010

  • Junior Playmaker
  • **
  • Posts: 51
How to use ISme[photon][halp!!]?
« on: June 04, 2014, 11:18:46 AM »
So i took the photon example and set it side by side with my player.
Did every thing almost the same apart form animation and the Ismine/isme.

The example uses 2 scripts(scripts i dont want to use because they dont fit my game), instead i have 1 FSM for movement control on the main game object and 1 FSM on a child object(head/look).

Once i instantiate my player prefab i want it to detect if its my player or not.
And if it is my player.than i want to turn on the desired FSM's,components and gameobjects:
Player camera.
Movecontroll FSM.
Headlook FSM.
Audio listener.

However.i can not get this to work.
First think i had was just a Isme action with a YES and NO event(did not work,would always go to NO)
Than i copyed the statements form the example and edited it so i could activate/enable my objects.

This gives me an error.
Quote
Fsm component 'Player(clone)' on gameObject 'Player(clone)' has variable checked for network synching, but no PhotonView component is observing this fsm

But player prefab does have the photonview.
Also if i un pause the game,i'm able to manually turn on headlook and have it function how it should. But when i manually enable the movement FSM, it rubberbands me back to my instantiated spot.
The camera does get activated and the prefab does get spawned on the spawn point.

It took me 3 hour's to set it up and trying to get it working..but no luck.

I do know how to instantiate and enable components in script( i followed a tutorial)but thats a tedious process and i just want to do it in playmaker.

ghost010

  • Junior Playmaker
  • **
  • Posts: 51
Re: How to use ISme[photon][halp!!]?
« Reply #1 on: June 05, 2014, 08:21:59 AM »
Bump.
Seeing as it only got 4 views and is already at the bottom of the page.

Id really appreciate help with this :/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to use ISme[photon][halp!!]?
« Reply #2 on: June 05, 2014, 09:39:21 AM »
Hi,

 give me another day, and I'll reply.

 Bye,

 Jean

ghost010

  • Junior Playmaker
  • **
  • Posts: 51
Re: How to use ISme[photon][halp!!]?
« Reply #3 on: June 07, 2014, 09:40:31 PM »
I'll be awaiting your response,in the mean time,ill do some GUI stuff(allot of gui stuff...).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to use ISme[photon][halp!!]?
« Reply #4 on: June 09, 2014, 04:38:02 AM »
Hi,

 "is me" is CORE to how networking will work with your prefabs. So leaving that out is a no go to achieve anything really.

"is me" refers to the owner of this prefab across the network.

Player A plays on Computer A and he's in game character game object is "A"
Player B plays on Computer B and he's in game character game object is "B"

 the character of Player A on computer A will return true to "is me" because the character prefab "A" represents this player on his own computer.
Character A on computer B will return false to "is me".

 This is ESSENTIAL that you understand this. Typically, use this "is me" to know if you should listen to user input or not, typically, you don't want Player B to control Character A isn't it, so character A will ask the question "is me", and on computer A the answer will be true and you will process input, on computer B however, it will be false and you shoudl not process any user input.

 Does that make more sense?

bye,

 Jean

ghost010

  • Junior Playmaker
  • **
  • Posts: 51
Re: How to use ISme[photon][halp!!]?
« Reply #5 on: June 09, 2014, 03:27:13 PM »
Yes,i understand.but if i add the "photon view Get Is Mine" to for example a cube that i just instantiated. It will always respond with "no" even though it got instantiated by me...





Its really giving me some headaches.

I also get this error after quitting the viewer each time:
Failed to 'network-remove' GameObject because it is missing a valid InstantiationId on view: View (0)-999 on Cube(Clone) (scene). Not Destroying GameObject or PhotonViews!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to use ISme[photon][halp!!]?
« Reply #6 on: June 10, 2014, 01:30:26 AM »
Hi,

Photon is firing an error, and so you can't rely on any logic after an error has been thrown. You must first instantiate an object properly, and only then if Photon was happy instantiating it you can ask for properties.

 Typically, have you put your prefab in a Resource folder? this is a MUST, failing to do so will not work.

bye,

 Jean

ghost010

  • Junior Playmaker
  • **
  • Posts: 51
Re: How to use ISme[photon][halp!!]?
« Reply #7 on: June 10, 2014, 04:54:00 AM »
yes,its all in the correct folders.
I was able to create the same problem win the photon demo form playmaker.
In the demo_room(in separated folder).

I added a connect and a wait in a state(in "game" gameobject),made that the first state.
After wait sends event finished,its continues with the states that were already there.

now it asks if we are conected,yes we are.
than it sets the message queue and after that,it instantiates the player.

Now the player apears as "Player : " in the hierarchy and the isMines state says no.

Well the problem was that i had to make a state with "photon/connected to photon"
and give that state the option to create or join a room.
after pushing the giu button to create the room, i had to make a state that listens to"photon/created room" give it a "is in room event"and let that event load the actual level.


I didnt use "Photon/created room".
Its vital to have the listener/global event "photon/created room" load the level.
You can not load the level and create the room in the same state or any other state that does not have "Photon/created room"(as far as i know and tested).

I'll probably make some fsm templates or prefabs and might even write a tutorial when im done figuering every thing out,but the most inportend part has been nailed.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How to use ISme[photon][halp!!]?
« Reply #8 on: June 10, 2014, 07:22:14 AM »
Hi,

 That will be great fi you share your experience and tricks to understand photon, I am sure it will be every beneficial.

 It's also very important that you master complety every aspect of the PlayMaker demo for Photon, it's the most basic form of networking requirements. So if you have have doubt on a particular fsm or logic beind it, let me know.

Bye,

Jean