playMaker

Author Topic: Build "If-Statement" but get infinite Loop instead..  (Read 2160 times)

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Build "If-Statement" but get infinite Loop instead..
« on: October 18, 2013, 03:32:43 AM »
hi,

I tested a few things, one of it was to find out, how to do something like an IF-statement. But I did not get it right.

I compare 2 variables (float) and start an event, if a "greater than" case is true:

First, I read out ScreenHight and Width, subtract 15 from each and then check for Cursor-Position in non-normalized Screenspace.

After that, I compare them, if Cursor position is equal or greater than ScreenHight or Width -15, than event is send and another State is entered... nearly ;)

(I am getting an infinite loop)

What to do?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Build "If-Statement" but get infinite Loop instead..
« Reply #1 on: October 18, 2013, 10:36:41 AM »
I think we need a screenshot of the FSM.

Usually, loops come from exiting a state per a condition, then the state you enter next immediately sends you back because of some condition there being met. So it means your conditions are not correct or are always met.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Onkelpoe

  • Junior Playmaker
  • **
  • Posts: 50
Re: Build "If-Statement" but get infinite Loop instead..
« Reply #2 on: October 18, 2013, 04:19:26 PM »
I deleted the FSM -  but I guess, you´re right.

I tried to make a RTS pan, like moving to mouse to the edges/borders of the screen to make the playfield move.

The Event was triggered, when cursor reached near border of the screenspace.
So that Bool was true and state was switched. The condition for send event and switching to action was met, once the mouse was in the region...

Yanifska

  • Full Member
  • ***
  • Posts: 163
    • My Portfolio
Re: Build "If-Statement" but get infinite Loop instead..
« Reply #3 on: October 19, 2013, 05:30:20 PM »
Hi,

have you seen this tutorials ? they helped me a lot :

to avoid the Infinite Loop Warning just add a state with the Next Frame Event

concerning the If statement :http://www.hutonggames.com/tutorials_game_design_with_playmaker.php

and for the rts camera :

http://www.hutonggames.com/tutorials_camera_motion_and_control.php

hope it helps
-Yaniv
Visit my portfolio: http://www.yanivcahoua.com/