Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: monkey0506 on Mon 08/08/2005 03:23:23

Title: SUGGESTION: Disable while loop iteration check (IMPLEMENTED)
Post by: monkey0506 on Mon 08/08/2005 03:23:23
I started a topic a while back when I was having some problems with too many while loop iterations, and Chris said something about implementing an option to disable the 150000 loop check.  Well, I didn't want to have to ask him directly about it, so I'm asking here.  Also, I had an idea about it.  Instead of a global option, perhaps it could be a function that would get used like:

function func_name() {
  DisableCheck(eWhileLoop);
  /* blah */
  }

So that the check for while loop iterations would be disabled for the duration of the call to the function.  Or perhaps it wouldn't have to completely disable the check, but just not crash the game because of that check.  Then, if the game did crash it could say something like:  "Game encountered fatal error running function "func_name".  DisableCheck called from within function.  Try removing this line from the function to determine cause of crash." or something...  Thanks for any help on figuring out when this will be implemented.
Title: Re: SUGGESTION: Disable while loop iteration check.
Post by: Pumaman on Mon 08/08/2005 22:04:01
I agree that this would be useful, and I'll look into implementing it.

Edit by strazer: Implemented in AGS v2.71 Beta 4
Title: Re: SUGGESTION: Disable while loop iteration check.
Post by: monkey0506 on Tue 09/08/2005 00:11:51
Well in order to initialize my struct variables I need either this or String arrays and the ability to use Strings as struct members.  Thanks in either case.
Title: Re: SUGGESTION: Disable while loop iteration check.
Post by: Ishmael on Tue 09/08/2005 00:45:23
At some point I've come up with a use for the while loop which the check then came and ruined... The downsided is that I don't remember what that idea was :\ But yeah, this would be usefull.
Title: Re: SUGGESTION: Disable while loop iteration check.
Post by: fred on Thu 11/08/2005 07:08:08
Yeah. let's have a function like that.

@monkey: While we're waiting for it, just remember that although the large arrays can't be iterated through from beginning to end, they work just fine if you just need to acces sub-parts of them - if it's not necessary to initialize or access all indices at once. Splitting the iterations up between different functions may also help, as I think I've done somewhere in my script.

fred
Title: Re: SUGGESTION: Disable while loop iteration check.
Post by: monkey0506 on Thu 11/08/2005 17:40:07
Hmm...I suppose that as a temporary fix I could just work with the first 25 dialogs.  Seeing that 200 * 30 * 25 = 150000.  And 500 / 25 = 20.  I don't want to have to create 20 functions.  But for testing purposes the first 25 dialogs should be enough.  Thanks for the idea.