playMaker

Author Topic: "Index was out of range" errors and "Disconnected FSM Instance"  (Read 1420 times)

japporeactor

  • Playmaker Newbie
  • *
  • Posts: 4
Hi guys and thanks for the amazing job with Playmaker 8),

I had to reimport my project and I've stumbled upon a series of errors in the console.
"Error Loading Action: State 1 : HutongGames.PlayMaker.Actions.SetVisibility : resetOnExit
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection."

Clicking on my character gives a "Disconnected FSM instance" alert and clicking on "Apply" doesn't change anything.
The error loops for all the states in all the FSMs.
See the attached images for reference.

The scene has just a main char with 3 FSMs on it:
- A light that turns on/off on a button press
- FSM that checks on the character health and links it through a variable to the hearts displayed on the GUI
- FSM connected with an animation of the character "Idle tired" if hearts reach 1.

The scene works fine except for the third FSM, which doesn't work if not disabled and enabled again at runtime.

Things I have already tried:
-Deleting playmaker and reimporting the last version.
-Making a prefab out of the character and click apply to the prefab disconnection alert
-Installing previous versions of Playmaker (tried 1.8.5, 1.8.7)

Please advice on what to do as I'm quite at the end of the road here  :(

Cheers
Japporeactor




djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: "Index was out of range" errors and "Disconnected FSM Instance"
« Reply #1 on: April 13, 2018, 05:20:32 AM »
Hi.
Have you tried pressing 'apply' in the inspector?

Can you show the fsm/states/action from that 3d one?

japporeactor

  • Playmaker Newbie
  • *
  • Posts: 4
Re: "Index was out of range" errors and "Disconnected FSM Instance"
« Reply #2 on: April 13, 2018, 06:55:55 AM »
Hi, thanks for answering!

I have already tried pressing "Apply" in the inspector but nothing happens :-\.
The strange thing is that the FSMs work (except the tired one, that works ONLY if I disable it and re-enable it at runtime). I guess it is because the FSM is not properly "loaded", as the error says. Therefore once I "load it" manually by disabling/enabling it, it works.

I have attached the FSMs shots as requested. Note that these FSMs have always worked flawlessly before reimport and I had no error about them before, so my guess is that it's not the logic.

« Last Edit: April 13, 2018, 06:58:48 AM by japporeactor »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: "Index was out of range" errors and "Disconnected FSM Instance"
« Reply #3 on: April 13, 2018, 09:01:19 AM »
Hi,
Are you using "Set Visibility" in one of the states?

There error points to that action, but its not in your pictures.

japporeactor

  • Playmaker Newbie
  • *
  • Posts: 4
Re: "Index was out of range" errors and "Disconnected FSM Instance"
« Reply #4 on: April 13, 2018, 11:01:33 AM »
It's a different FSM (Deactivated) to make the char flash toggling visibility. It is disabled so I didn't consider it in my screenshots. It behaves like the other FSMs (except the "tired" one), works but still gives error. What does "Error loading action" usually mean? I couldn't find much information, except this post that talks about "activate game object" used on old game objects not active. But I'm not using that action.

https://hutonggames.com/playmakerforum/index.php?topic=2676.msg79084#msg79084

UPDATE: I don't know how but just by clicking on the parameters in every single FSM fixed the errors. For those searching for a solution, I have basically just clicked every state and dechecked and checked all the bools/paramenters active.
It went away after that..  :o

Still the "Tired" FSM doesn't work tho. I'll post screeshot later for this one.



djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: "Index was out of range" errors and "Disconnected FSM Instance"
« Reply #5 on: April 13, 2018, 01:32:45 PM »
Hi.
There is a checkbox to turn on debug if you put that on you can see the values while playing.



So you can see if you the value from the set property and what the value is.

Also below that you can see Hint[F1]
You can click that  to turn on/of the hint info.

Also try to minimize using get/set properties and if you do you should also use the Linker Wizard
Else you might have issues when building to a platform.

You can break your "Tired" into 3 states for debugging so it is easier to pinpoint where the issue is.
You can set breakpoints (Pause) on each state for even better debugging.
(right click on a state and set breakpoint, click it again to turn off)