I’m developing a game where time is an integral part. However, I’m trying to find the best way to code it in. So far what I’ve done is something similar to this:
You just finished making a COG game.
The time is ${time} ${PM}.
What else do you want to do?
*choice
#Make another one.
*set time +3
*goto doublethreat".
And then, if noon happens:
`*if ((time >= 12) and (pm = "am"))
*set pm "pm``
I would appreciate if anyone could offer some insight on how to make this more efficient. Ideally, I want to get it to a military time.
@Lordirish has posted a very thorough clock system…is that something like what you are wanting, or are you looking for a more limited-scope, less complex timer?
Then, any time you want an action to take a certain amount of time… you can add that in hours and minutes. Eg.
*set htime +2
*set mtime +30
*gosub_scene clock timetrack
(or whatever scene your timetrack is in)
(two hours and thirty minutes.)
Then, any time you want to display the time- you just write
${htime}:
*if mtime = 0
00.
*if ((mtime > 0) and (mtime < 10))
0${mtime}.
*if mtime > 9
${mtime}.