Fenix Process Delays


bomb_dog

Still Fresh
Joined
Dec 3, 2005
Messages
82
Hi there,

I've been starting to write a little Fenix game and have got stuck with a little problem.

I'm trying to implement Moogle's timing script so I can display some text, give the player some time to read it (pause for a second or two), and then move on.

This is the code...

timer[1] = 0;
while(timer[1] < 10000)
frame;
timer[1]+=1;
end


However, both in a seperate process and 'in-line', nothing seems to happen, the script continues on regardless.

Is there anything I'm missing? I am also running a timer counting from 60-0 in a seperate process, though using different variables.

Thanks for any help.

EDIT: Happy Christmas, as well!
 
Your timer is too long. A timer counts to 100 every second, as your loop is set to continue until the timer reaches 10000 it will take 100 seconds before it breaks out of it.
 
Hi Ruckage,

The script seems to ignore the timer loop altogether, rather than run in the loop for 10000 seconds.
I only tried 10000 seconds as Moogle's original used 1000, and the comment on the script said 'One second passed'

 
timer[0] = 0;
while(timer[0] < 1000)
frame;
end
//One second passed
 
ruckage posted on Dec 25 2006 at 09:29 AM said:
Your timer is too long. A timer counts to 100 every second, as your loop is set to continue until the timer reaches 10000 it will take 100 seconds before it breaks out of it.
It's milliseconds, milli prefix = 1/1000 so its 10 seconds.

As for the problem. Just a point, timers, like arrays, begin at 0, so use timer[0], just to make your code better :D You don't need to increment the timer, it counts itself, you initialise it as soon as you call it in your declaration to a 0 value.

Anyway, to help you, here is the correct code:

Code:
timer[0] = 0;
while(timer[0] < 10000)
	 frame;
end
 
Last edited by a moderator:
sam fisher posted on Dec 25 2006 at 02:33 PM said:
It's milliseconds, milli prefix = 1/1000 so its 10 seconds.

Actually you're wrong. I know as blingo was heavily dependant on timers and I initially thought that they were in milliseconds as there was a missprint on the fenixonfire site. However in the pdf on the front page describing data types and variables the correct description is given. Here is an excerpt from the pdf on fenixonfire.

Global Varibles: TIMER
TIMER
INT TIMER[9]
Ten accessible programmable chronometers at any moment
DESCRIPTION:
Fenix has 10 accessible chronometers through the array of variables timer (from timer[0] to
timer[9]). As it happens with any array to get the value of timer as a integer variable is just
like to get the value of timer[0].
These timers are initialized to value 0 automatically when the program begins and are
increased 100 times per second automatically.
 
Last edited by a moderator:
Sorry, i took itfrom moogles document. The time that is. So fenix handles it in "centiseconds"? lol. Never heard of that one before.

Anyway I know the code I game was right and that you do not need to increment the timer yourself.
 
Me again, and I think I know why it wasn't pausing...

Although I was incorrectly incrementing the counter, I had forgotten about the process driven coding method.

So, I was calling a subroutine(x) which was incrementing to 'x', forgetting that the remainder of the code would execute as well, and not wait for this subroutine to finish. D'oh! I need to add some code to 'kill' each process....
(that'll be with 'return' then.....)

Ooh, fenix is fun without a lovely 'Dummies guide to...' manual!
(Yes, I've read the tutorials, and fenixonfire etc - and the best way to learn stuff is through others documented code!)

Thanks for the help guys, I may be back..... my little game needs some more 'sub-games' (and better graphics, sounds, save hi-score etc!) before release.
 
Back
Top