playMaker

Author Topic: Light switch not working. Help error Loop count exceeded maximum 1000  (Read 6392 times)

fantome2024

  • Playmaker Newbie
  • *
  • Posts: 6
Hello, I'm brand new to Playmaker and trying to figure out connecting a switch to lights. Here is what I'm trying to do.

On "Mouse pick event" flip lights "On"
On "Mouse pick event" flip lights "Off"

but when I click the switch I receive the error below

Switch : FSM : Loop count exceeded maximum: 1000 Default is 1000. Override in Fsm Inspector.
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmLog:AddEntry(FsmLogEntry)
HutongGames.PlayMaker.FsmLog:Log(FsmLogType, String)
HutongGames.PlayMaker.FsmLog:LogError(String)
HutongGames.PlayMaker.Fsm:EnterState(FsmState)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState)
HutongGames.PlayMaker.Fsm:UpdateStateChanges()
HutongGames.PlayMaker.Fsm:UpdateState(FsmState)

Here is the pic of what I've done

« Last Edit: November 03, 2015, 10:14:25 PM by fantome2024 »

terri

  • Sr. Member
  • ****
  • Posts: 386
    • terrivellmann.tumblr.com
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #1 on: November 03, 2015, 10:05:12 PM »
Is it the same if you use mouse up instead of mouse down?

fantome2024

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #2 on: November 03, 2015, 10:16:12 PM »

Correct same thing happens. I set both events to "mouse up" and it happened again.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #3 on: November 04, 2015, 01:10:16 AM »
Hi,
you can try to add 2x a state with a "mouse pick event" with a "mouse up" and "mouse off" on it. and place those in between

fantome2024

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #4 on: November 04, 2015, 07:50:59 AM »
Hi,
you can try to add 2x a state with a "mouse pick event" with a "mouse up" and "mouse off" on it. and place those in between

Wouldn't that make it if I moved off the object the light would turn off? I want to be able to click On/Off  like an actual light switch.  If I'm mistaken could you elaborate a little more on how to setup. Like a drawing or pic. Thank you

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #5 on: November 04, 2015, 08:06:16 AM »
Hi!

You can add a new state between those two with the action Wait 0.1 sec. it happened to me also
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #6 on: November 04, 2015, 08:33:48 AM »
Hi,
an easier way is to add a state with a "next frame" action between your actions

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #7 on: November 04, 2015, 09:22:34 AM »
I think you need a delay between the two states. therefor I normally add a wait action with 0.1 sec.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #8 on: November 04, 2015, 09:24:47 AM »
You are right! It worked with Next Frame Action! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #9 on: November 04, 2015, 09:44:41 AM »
It just happens that the next state is reached inside the same frame and the conditions are still true so it again goes to the next state... where the conditions are still true...

Ends up looping too much and throws the flag. Next Frame Event fixes this most of the time, but you could also fix it by using Get Mouse Button Down and Get Mouse Button Up which behave differently.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

fantome2024

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Light switch not working. Help error Loop count exceeded maximum 1000
« Reply #10 on: November 04, 2015, 06:42:11 PM »
It just happens that the next state is reached inside the same frame and the conditions are still true so it again goes to the next state... where the conditions are still true...

Ends up looping too much and throws the flag. Next Frame Event fixes this most of the time, but you could also fix it by using Get Mouse Button Down and Get Mouse Button Up which behave differently.

Sorry I'm really new to this. Could you draw something or give me a visual of how to should be setup

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames