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.
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.
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.
4: Use [#var:t] if you want to show this t variable in some text.
Timers with f:get_date()
Moderator: EN - Forum Moderators
Timers with f:get_date()
Last edited by Moltor on Thu Nov 04, 2010 5:30 am, edited 1 time in total.
- 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()
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.
Re: Guide: Timers with f:get_date()
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?
Anyone know the other 'f:' 's?
Finished Trials:
Turnabout Transfer - Day One: http://aceattorney.sparklin.org/jeu.php?id_proces=19354
FABULOUS!
Turnabout Transfer - Day One: http://aceattorney.sparklin.org/jeu.php?id_proces=19354
FABULOUS!
Re: Guide: Timers with f:get_date()
The tips, tricks, and info thread has moar info about functions and variables and stuff.