Method for a Global Timer and Calendar

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

This is the timer core of my new Event Manager mod that will allow anything to set a global timer event. This portion demonstrates a simple calendar function that is viewable from your ship's interior. You can watch in rabid fascination as the hours and days pass during your journey to the core.

What this is doing is creating a continuous timer to run events from. The next release for this mod will entail a fully functional alarm and Active/Passive event manager that can be called from any item, station, ship, system, or script. This will hopefully allow many objects to make use of the same background timer, and should help us to expand into fun things like evolving items over time, trade and inventory updates for stations and lots of other things. The active part of this project will allow for scripts to be fired from the timer, rather than activating items from an Invoke, for example, an item could "activate itself" from the timer.

Passive updates for events such as trade adjustments or interest payments wouldn't necessarily need the active timer, but the method to add them in by date: hour, day, week, month, year and the hopefully easy method to add an event should make it worth having the update code centralized in a function set such as this one. (yes, trade and station inventory updates could simply run when needed from a unvGetTick function, but this is funner)

edit- I suppose I could add the link at this point. :P Mod On Xelerus

Mod Notes- Install into Extensions folder. This mod overrides the stStarGate entry and the dsShipInterior and should be compatible with most 0.98d mods on Xelerus and any of my own mods.

Currently the timer is set to pass an hour every 120 ticks (4 seconds real time) Let me know what you think the time ratio should be, if it seems not to be running the way you, like, think it ought to be.

You can reset the time easily from the <OnCreate> of the Stargate. That is where the ticks are set for frequency of running the timer update code.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

That's really cool ! :)


4 seconds=1hours makes 5-10 hours of gameplay as 6-12 months of time to reach Heretic.

Sounds reasonable.
Post Reply