playMaker

Author Topic: Loading a new scene  (Read 1306 times)

MichaelPatriot21

  • Playmaker Newbie
  • *
  • Posts: 23
Loading a new scene
« on: January 19, 2019, 11:57:46 PM »
So I have this button called "recruit",right? In the first state I put no actions and a UI CLICK transition the pointed it at the second state. In the second state I have a Random Int action that adds 1-20 int to an int variable called "New Soldiers" then an Int Operator action that adds "New Soldiers to the global variable "soldiers". It has a FINISHED transition that points to the third state. The third state has a Wait action set to 30 seconds and a FINISHED transition pointed at the first state. The point of this button is to add recruited soldiers to the player's party. The player's party is displayed on a different scene/level. I also have it display on the scene/level with the button as well. The button does what it's supposed to do. I press it, it adds a random number of soldiers, it displays, all good right? Unless I go to my player's party, which involves pressing a button to load a new scene/level. If I click the recruit button, go to the other scene/level, then go back to the scene/level with the recruit button and click it again, it adds new soldiers, ignoring the wait action in the third state. I tried pitting Don't Destroy On Load in many places, still loading a new scene/level seems to override the timer or reset the FSM.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15620
  • Official Playmaker Support
Re: Loading a new scene
« Reply #1 on: January 22, 2019, 03:24:03 AM »
Hi,

 can you pause and step back to see where your fsms went in the process? given your explanation, I think it's a simply a matter of logical flaw in your state sequence.

 Bye,

 Jean