playMaker

Author Topic: Help infinate Loop Warning Breaking FSM [SOLVED]  (Read 3277 times)

PlatinumPlayer

  • Playmaker Newbie
  • *
  • Posts: 26
Help infinate Loop Warning Breaking FSM [SOLVED]
« on: July 16, 2012, 06:03:43 AM »
I have made a 3ed person camera controller using the video tutorial found here: But because there is a loop when a person repeatedly attempts to zoom in when already at max zoom. The FSM stalls and i get an editor warning about this infinite loop so how do i disable/ignore this warning for this specific FSM as this infinite loop is vital to the function of the FSM.

« Last Edit: July 16, 2012, 08:24:53 AM by PlatinumPlayer »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help infinate Loop Warning Breaking FSM
« Reply #1 on: July 16, 2012, 06:38:44 AM »
Hi,

 try implementing a flag or a check that detects that indeed you are at the max, so that you avoid the loop.

 I have implemented something similar in the shooter M2H game port to playmaker.

https://hutonggames.fogbugz.com/default.asp?W882

have a look, it may very well apply to your zooming system.

Bye,

 Jean

PlatinumPlayer

  • Playmaker Newbie
  • *
  • Posts: 26
Re: Help infinate Loop Warning Breaking FSM
« Reply #2 on: July 16, 2012, 08:05:34 AM »
Its the check itself that creates the loop. Maybe its firing to fast?



It always stalls at Zoomed In Or Out when meeting max limit. It is suppose to toss the process back to the Idel to see if the MouseWheel has been scrolled up or down again. But when it realizes that if you keep scrolling with the mouse that it will create an infinite (as intended) looping action. If your not scrolling there wont be a loop, and thus no danger of infinite looping. But the editor still yells at me anyway.

How do i over come this?

PlatinumPlayer

  • Playmaker Newbie
  • *
  • Posts: 26
Re: Help infinate Loop Warning Breaking FSM
« Reply #3 on: July 16, 2012, 08:24:21 AM »
FIXED: A .5 delay state buffer between the zoomed states and idle has removed all warnings for me.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help infinate Loop Warning Breaking FSM
« Reply #4 on: July 16, 2012, 08:25:59 AM »
Hi,

 to overcome loop warning, cut your process in two distinct FSS. One is responsible for checking the mosue scroll and fire events when the user is scrolling, by sending two events "SCROLL UP" and "SCROLL DOWN", the second fsm will have them events as global events and process it, then you cut the loop problem.

bye,

Jean

PlatinumPlayer

  • Playmaker Newbie
  • *
  • Posts: 26
Re: Help infinate Loop Warning Breaking FSM [SOLVED]
« Reply #5 on: July 16, 2012, 08:36:53 AM »
That was the first thing i tried actually. But since you need to capture the axis in a float and check the float for positive or negative, its a bit less forgiving i guess. I only know how to capture the axis in in a 'every frame' fsm state, then have compare if float is + or -, before tossing it off to the zoom. Is there a much more efficent way of capturing/registering a mouse-wheel scroll?