Timers with f:get_date()

Find detailed help from the AAO community, or write your own tutorials.

Moderator: EN - Forum Moderators

Post Reply
Moltor
Posts: 76
Joined: Thu Jun 03, 2010 3:43 pm
Gender: Male

Timers with f:get_date()

Post by Moltor »

People keep asking me how I did the timing stuff in Turnabout Party. (I did a similar thing in The Realtime Turnabout also.) So I snagged some screenshots from my Turnabout Party script to explain it.

1: Define a variable to equal the expression f:get_date() at the beginning of the thing you're timing.
Image

2: When you want to check the time, subtract that variable from the result of a later call of f:get_date() to see how many milliseconds have passed. In my case, I also turned milliseconds passed into seconds remaining.
Image

3: Evaluate a condition to decide what to do with this time result. Like, jump to a game over section if you're out of time.
Image

4: Use [#var:t] if you want to show this t variable in some text.
Image
Last edited by Moltor on Thu Nov 04, 2010 5:30 am, edited 1 time in total.
User avatar
E.D.Revolution
Posts: 5743
Joined: Mon Jul 26, 2010 9:00 pm
Gender: Male
Spoken languages: English and decent Spanish
Location: Across dimensions, transcending universes

Re: Guide: Timers with f:get_date()

Post by E.D.Revolution »

I think you need to make a guide for using variables. You seem to understand that better than most of us. All we can do is the basic "press1=1" sort of thing.
Image
User avatar
Quadratic
Posts: 153
Joined: Sun Sep 26, 2010 10:52 pm
Gender: Male
Spoken languages: English

Re: Guide: Timers with f:get_date()

Post by Quadratic »

Hmm... that's very useful, alright. I wonder, what other functions are there? I can see this being used in a trial, to slowly lower your health bar by 1 every second... (Judges are impatient these days...)
Anyone know the other 'f:' 's?
Finished Trials:
Turnabout Transfer - Day One: http://aceattorney.sparklin.org/jeu.php?id_proces=19354

FABULOUS!
Moltor
Posts: 76
Joined: Thu Jun 03, 2010 3:43 pm
Gender: Male

Re: Guide: Timers with f:get_date()

Post by Moltor »

The tips, tricks, and info thread has moar info about functions and variables and stuff.
Post Reply