playMaker

Author Topic: Events fire off before main states finishes[SOLVED]  (Read 1871 times)

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Events fire off before main states finishes[SOLVED]
« on: February 09, 2017, 07:51:13 AM »
Hi there,

In one of my mini-games, when the player enters the game and then immediately exits the game (presses on back button) nome of the stuff doesn't get seeded from xml in time, and it doesn't load text anymore, if I launch the mini-game again, the FSM won't load the text anyway. Is there an "elegant" way of making sure this doesn't happen? I can think of disabling the buttons interactions or graphic raycast, until the mini-game loads completely but that will take a couple of states and actions...
« Last Edit: February 21, 2017, 03:04:01 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Events fire off before main states finishes
« Reply #1 on: February 10, 2017, 02:24:00 AM »
Hi,

 You may need to wait a frame before using the xml and moving forward.

without a deeper look it's hard to say where the issue is, but try the above and se how it goes, get back to me if you are stuck.

 Bye,

 Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Events fire off before main states finishes
« Reply #2 on: February 17, 2017, 05:16:14 AM »
I had a good check and it turns out that the XML gets parsed correctly, but for some reason it loses reference or never gets reference to the text gameobject, so the xml content exists but it doesn't add itself to the label. The find gameobject is in first state, so I am not sure why it's saying it's "None". This only happens If i switch off internet, enter mini-game, exit mini-game, turn on internet and try again and bam the text won't load anymore because it's gameobject says "None" ( even though first actions is suppose to find it).

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Events fire off before main states finishes
« Reply #3 on: February 20, 2017, 01:36:46 AM »
Hi,

 this seems a problem outside XmlMaker for sure.

the gameobject is likely gone because you've loaded a new scene, is that right?

Bye,

 Jean

elusiven

  • Full Member
  • ***
  • Posts: 233
  • Debt we all must pay...
Re: Events fire off before main states finishes
« Reply #4 on: February 20, 2017, 03:00:54 AM »
The whole project is one scene only. I sorted this issue out now by moving the find actions to the same state where I change the text and so far it works :P