The forum has been set to read-only mode. For community discussion and questions, head over to our Discord: https://discord.taleoftwowastelands.com

timeframe questions

General mod discussion and requests.
Post Reply
User avatar
Puppettron
Gary
Posts: 1715
Joined: Sat Nov 23, 2013 10:47 pm

timeframe questions

Post by Puppettron » Tue Jul 08, 2014 3:31 am

ok, i've got mods that run a lot of timers, but the major problem i'm trying to figure out with the Cannibal mod is that with timers running over several minutes, they're not taking into account times when the game is running time fast or skipping it entirely, like waiting, sleeping, fast travel, cyber surgery if you've set that to a longer-than-instant time, hell the 2 week transition between the wastelands.


but i got no idea how to account for that.  any help there?


perms:  either a full fireworks display spelling out "Puppettron Made This" anytime a user accesses my content in-game, or just give me credit somewhere.

Gribbleshnibit8
Posts: 481
Joined: Sun Nov 04, 2012 2:06 am

Instead of using a

Post by Gribbleshnibit8 » Tue Jul 08, 2014 5:19 am

Instead of using a GetSecondsPassed timer, use a timer based on the GameDaysPassed global value. It's slightly more complex, because you have to track it yourself, but it handles time passing during sleep/wait/etc. GameDaysPassed is a float value based on a 24 hour time. From the wiki


[quote]Remember that an hour is about 0.041667 (1/24) of a day. So using GameDaysPassed for anything other than day tracking may get awkward.[/quote]


So tracking time with it is something like



if (important thing to track happens && checkBool)
set TimeTrackVar to GameDaysPassed + AmountOfTimeToTrackFor
set checkBool to false
endif


Post Reply