Thread: [Utility] Clock Adjuster
-
March 20th, 2022, 14:45 #321
-
March 24th, 2022, 03:26 #322
I've come back to help figure things out and wanted to share here and let you all know before submitting to the forge (will stay free). Let me know if you run into any issues. Hopefully I was able to get this in before too many changes by others were made. It might still be a bit messy in the TimeManager script right now, but its late and last time I tried cleaning it out I somehow deleted something I needed so I will wait, but here are the functions I've made that are key to utilizing features like reminders and events.
I've added script to allow other extensions to make use of the time as I have with reminders and events:
local aCurrentDate = TimeManager.getCurrentRawDate() -- gets a table of the current time
local aBuildDate = TimeManager.buildRawDate(nMinute, nHour, nDay, nMonth, nYear) -- gets a table of the time given
local nMinutes = TimeManager.getRawDateDifferences(aCurrentDate, aLastDate) -- gets the difference in minutes
TimeManager.setLastDate(Node, aCurrentDate) -- for repeating events like reminders
local aLastDate = TimeManager.getLastDate(Node, aCurrentDate) -- for repeating events like reminders
TimeManager.addTimeChangeFunction(f) -- add a function to be triggered on TimeChange events
and if you have an extension that could benefit from these functions, you can add
if TimeManager then
TimeManager.addTimeChangeFunction(MyNewFunction);
end
then if you change time with your extension, you just call TimeManager.TimeChanged() right AFTER, never before the adjust function.
hopefully you all find this works out.
oh, and I capped the table rolls by reminders to 60, so you don't kill your computer when you jump a year.Last edited by pr6i6e6st; March 24th, 2022 at 03:32.
-
March 24th, 2022, 03:42 #323
if you were unfortunate enough to get it a moment ago, redownload. sorry, left a mistake in the rounds advancement code
-
March 25th, 2022, 19:40 #324
Updated and is live on the forge!
-
March 25th, 2022, 20:11 #325
Thanks looking good.
-MrDDT
Discord @mrddt
Grim Press Discord (Publishing/Extensions/Modules)
Bethica Discord (West Marches RPG)
PLEASE VOTE FOR THESE FEATURES VERY IMPORTANT!!!
-
March 25th, 2022, 20:34 #326Templar
- Join Date
- Jun 2019
- Posts
- 107
So, with the mod now being on Forge under it's OP, does it currently include all the updates bmos has done over the past while? I just want to make sure I won't be accidentally sliding backward in terms of bug fixes and the like before switching over to the forge extension.
-
March 25th, 2022, 20:36 #327
-
March 25th, 2022, 20:37 #328Templar
- Join Date
- Jun 2019
- Posts
- 107
Amazing, thank you!
-
March 26th, 2022, 22:34 #329Templar
- Join Date
- May 2018
- Location
- Midwest US
- Posts
- 121
Well, you beat me to this... I was going to use this idea to learn the LUA stuff... dang it!
Thanks though... I will definitely use this a LOT!
The only things I was going to include that don't appear to be here are...
1. A more abstract output of time for the players based on a range of hours... like "Just after high sun", "Mid-morn"... etc.
2. The color of the theme changing to reflect the time for more immersion.
Obviously, both would/should have options in the settings to turn them on and off.
-
March 26th, 2022, 23:03 #330
You could do this as another extension by overriding the CalendarManager.outputTime() function, as that is what is called to display the time in most instances (except reminders and events)
This too can still be done as another extension. Many ways it could be done and will not effect the clock adjuster.
The CalendarManager in Core RPG should have much of what you need. The TimeManager.TimeChange() function of mine would be all you need to have it operate when time changed.
I left the code open in the forge too, so you can still go through and see what I have that you could utilize.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)


Reply With Quote


Bookmarks