ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Improved Time System Library

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Improved Time System Library

Postby Denk » Wed Jun 05, 2019 5:07 am

Lately I have been using the Time System Library which comes with ADRIFT 5. Besides %Minute% and %Hour% it also has a variable called %Day% which I think is intended to keep track of which day it is. You could use this to print the date, e.g. if we are somewhere between day 4 and day 30 in the game, you could output "Date: %Day%th of July".

Unfortunately, it turns out, that the variable %Day% is not correctly updated when time passes midnight. For instance, it may take on negative values. And it is not updated when you sleep.

I have now modified the time system so that the variable %Day% is now correctly updated, both at midnight and when you sleep. Thus you can now use the Improved Time System Library to keep track of the date in the game.

The Improved Time System Library can be found here: http://www.adrift.co/game/1520
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 282
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 56

Re: Improved Time System Library

Postby Lazzah » Wed Jun 05, 2019 10:54 am

Denk wrote:Lately I have been using the Time System Library which comes with ADRIFT 5. Besides %Minute% and %Hour% it also has a variable called %Day% which I think is intended to keep track of which day it is. You could use this to print the date, e.g. if we are somewhere between day 4 and day 30 in the game, you could output "Date: %Day%th of July".

Unfortunately, it turns out, that the variable %Day% is not correctly updated when time passes midnight. For instance, it may take on negative values. And it is not updated when you sleep.

I have now modified the time system so that the variable %Day% is now correctly updated, both at midnight and when you sleep. Thus you can now use the Improved Time System Library to keep track of the date in the game.

The Improved Time System Library can be found here: http://www.adrift.co/game/1520

Thanks Denk! :Thanks:
WIP: The Lost Labyrinth of Lazaitch

ALSO AVAILABLE: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2255
Joined: Thu Mar 31, 2011 4:54 am
Location: Dagenham, Essex
Points: 60

Re: Improved Time System Library

Postby DazaKiwi » Wed Jun 05, 2019 8:51 pm

Good job Denk thanks for letting us know. I actually forgot we had one already with A5.
User avatar
DazaKiwi
 
Posts: 658
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 21


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 4 guests