playMaker

Author Topic: Load Level Workflow 1.3  (Read 12894 times)

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Load Level Workflow 1.3
« on: February 16, 2012, 07:44:47 PM »
1st Congratulation for the 1.3 I already love it!
I've found many topics about the Load Level action and i can read that most issues have been addressed: https://hutonggames.fogbugz.com/default.asp?playmaker.1.7.3
http://hutonggames.com/playmakerforum/index.php?topic=458.0

Every time i reach my load level action num the scene load but then stop!

Code: [Select]
MissingReferenceException: The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
HutongGames.PlayMaker.Fsm.SendEventToFsmOnGameObject (UnityEngine.GameObject gameObject, System.String fsmName, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.SendEvent.OnEnter () (at Assets/PlayMaker/Actions/SendEvent.cs:39)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)
I've workaround this disabling the toggles into the Debugging parameters in the PM Gui (script), but after upgrading to 1.3 this don't work anymore. Every scene that i need to load is unique and has it's own var and events, so i worked all my project with no preloader/manager kind of workflow...
I've made a test with 2 simple scenes where i have a button to load the level num 1 and this scene has a button that load back the level num 0: everything just works.
What's happend then? Need urgent help!

edit: How i fixed this..
Adding a FINISHED event to the Load Level Num that put the fsm into an empty state fix the editor to go in pause mode and the error disappear: in other words: now it work.
The whole experience was a real pain, i think that some cure for this must be added in background.
Sorry if i waste some of your time :)
« Last Edit: February 16, 2012, 09:34:33 PM by elvis75k »

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #1 on: February 16, 2012, 09:38:42 PM »
Hmm, it's a bit late in the night.. and i hope i can find an answer before i go to work tomorrow.
The fix i did before with the finish event to the load level is only working with 1.2.1
In 1.3 i can't pass this error.. and the editor will pause.
Code: [Select]
MissingReferenceException: The object of type 'PlayMakerFSM' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
HutongGames.PlayMaker.Fsm.SendEventToFsmOnGameObject (UnityEngine.GameObject gameObject, System.String fsmName, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Fsm.Event (HutongGames.PlayMaker.FsmEventTarget eventTarget, HutongGames.PlayMaker.FsmEvent fsmEvent)
HutongGames.PlayMaker.Actions.SendEvent.OnEnter () (at Assets/PlayMaker/Actions/SendEvent.cs:39)
HutongGames.PlayMaker.FsmState.OnEnter ()
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Load Level Workflow 1.3
« Reply #2 on: February 17, 2012, 06:22:00 AM »
Hi,

 odd, I am currently using load level num with 1.3 and it works fine. Are you sure you have properly set the "dontdestroyOnLoad" settings where appropriate?

 bye,

 Jean

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #3 on: February 17, 2012, 08:26:54 AM »
Hi, Jean.
I don't understand you: i never used dontdestoroyOnLoad except the one in the Load Level action.
I guess that this will keep only the FSM that contain Load Level. Right?
If this is correct, do i need to put this "dontdestoroyOnLoad" alone on every FSM until the error disappear?
Since i solve this on 1.2.1 i think that in 1.3 there's something new that look better the "abandoned" FSM and show the error. Is debugFlow an option to catch where i generate this bug?

Cheers

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #4 on: February 17, 2012, 09:42:24 AM »
I've set up the scene lo load itself when the button is pressed.
The same scene load ok but the error appear.
If i put "dontdestoroyOnLoad" to an object it cause more trouble than before, because the object itself is then duplicated in the hierarchy!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Load Level Workflow 1.3
« Reply #5 on: February 17, 2012, 09:48:51 AM »
Do you only get the error when set up to load itself? Or also when loading other scenes?

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #6 on: February 17, 2012, 10:10:14 AM »
Do you only get the error when set up to load itself? Or also when loading other scenes?


I get this error ever. Loading the same scene was just a test i did to try to catch who's guilty.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Load Level Workflow 1.3
« Reply #7 on: February 17, 2012, 10:29:12 AM »
Do you have a simple repro case you could send me?

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #8 on: February 17, 2012, 10:50:51 AM »
Thanks Alex, i've sent you a mail with the package of a scene causing problem.
Every scene in this project looks almost like this one, i hope you don't get scared about the mess..

elvis75k

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 97
    • nRender
Re: Load Level Workflow 1.3
« Reply #9 on: February 23, 2012, 07:10:44 PM »
Hey Alex, have you seen my project?

I've finally found the cause of the "has been destroyed" error.
It was a big surprise for me: i have the habit to disable (read turn off) most of my game object (disabled before the editor run (born disabled)) and that's fine because this way i feel like i get some speed up (just a feeling).. but if any of the deactivate "actor" has an fsm component then booom! Of course this error only happend when the scene is loaded with an action. Sometime the error appear in v1.2.1 but without rules or predictable behaviour. In 1.3 and up ther's no room for coincidences..

What's your thought on that?

« Last Edit: February 23, 2012, 07:19:20 PM by elvis75k »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Load Level Workflow 1.3
« Reply #10 on: February 23, 2012, 07:31:30 PM »
That's a really good lead! I'll take another look...

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Re: Load Level Workflow 1.3
« Reply #11 on: February 24, 2012, 12:23:01 AM »
I think that this is related to the issue that I am having

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Load Level Workflow 1.3
« Reply #12 on: February 24, 2012, 04:50:29 AM »
Hi,

 I found the source of this problem.

there is indeed a bug:

if the sendevent action is set within the "START" state flow, then reloading the scene creates this error.

I get this error when reloading  the same scene while already playing, not when the application is loading the scene fro the very first time at launch.

and it seems to happen even if the event is trigger later on, as long as it is actually somehow part of the start flow. But I am not sure about this second findings, cause after I fixed the send event called straight on start state I still have the same issues on other fsm.


bye,

 Jean

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Re: Load Level Workflow 1.3
« Reply #13 on: February 29, 2012, 07:49:50 AM »
Hi,

 I found the source of this problem.

there is indeed a bug:

if the sendevent action is set within the "START" state flow, then reloading the scene creates this error.

I get this error when reloading  the same scene while already playing, not when the application is loading the scene fro the very first time at launch.

and it seems to happen even if the event is trigger later on, as long as it is actually somehow part of the start flow. But I am not sure about this second findings, cause after I fixed the send event called straight on start state I still have the same issues on other fsm.


bye,

 Jean

Hey,

Sorry to be a pest, but is there any word of how a fix for this is going?

Many thanks in advance,
Mark

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Load Level Workflow 1.3
« Reply #14 on: February 29, 2012, 01:04:53 PM »
I'm looking into this, but still haven't managed to repro the problem on my end... so far all my tests are running fine...

If anyone has a simple repro project they could send me, that would be most helpful!