How to stop infinite loop detection?

Started by Pizzaman, Mon 24/01/2005 22:35:18

Previous topic - Next topic

Pizzaman

Ya speaking of infinite loops, uh how do you remove that detection thing?

Cuz I am trying to have a while loop which has the enemy attack you and there is a random number generated to see if he will succeed or not, and i set it to do a random seed every second.  And I also have the player push a button to attack back when he wishes. 

But if there is no activity for even a second, the game crashes with an error about infinite loop.  Although its not an infinite loop, its quite "controlled."  I thought the Turin Machine Problem was impossible. 

Is there a way to avoid doing this without a while loop?

-Pizzaman

Etcher Squared Games

Why not just hook into repeatedly_execute()?

Have some kind of state to get your random # only at certain times when you need.

But remember that gets executed every game CYCLE, so you'll need to know what the game speed is (default 40).  So you'd want to get a random # every 40 cycles.
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

Goot

Yeah, you have to put it in repeatedly execute. A script like this:
while(condition){
script here
}
will crash the game if the condition will be true untill the game continues. The script doesn't keep running until the while function has finished.
To do a while statement you either need a Wait(1); in the condition, to allow the game to continue for a split second, so that the condition might be changed to false, or to update a variable in the condition which will eventually end the loop.

Gilbert

If it's put in repeatedly execute, I'll recommend using "if" other than "while", as it would be checked every game loop already, and you don't need Wait().

All you need to do is to track the conditions with conditions, and use "if" "else" etc. to response accordingly.

SMF spam blocked by CleanTalk