OSP Code QoL Code for modeling a calendar

Users who are viewing this thread

Fujiwara

Sergeant at Arms
This is something simple I came up with for the Onin no Ran mod that probably has much wider application....Enjoy!

(0.0, 0, ti_once, [], [(assign,"$day",1), (assign,"$month",7), (assign,"$year",1)]),

(0.0, 24, 0, [(lt, "$day", 31)], [(val_add,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$day",31),(lt,"$month",13)], [(val_add,"$month",1), (assign,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$month",13)], [(val_add,"$year",1), (assign,"$month",1)]),

The start day, month, and year can be whatever you want it to be by changing the values in the first trigger. The year consists of 12 30-day months...not exactly the Gregorian calendar, but we're not worried about matching solar years with the seasons in M&B either :smile: One could model the lunar year with the following changes,

(0.0, 0, ti_once, [], [(assign,"$day",1), (assign,"$month",7), (assign,"$year",1)]),

(0.0, 24, 0, [(lt, "$day", 29)], [(val_add,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$day",29),(lt,"$month",14)], [(val_add,"$month",1), (assign,"$day",1)]),
(0.0, 0, 0.0, [(eq,"$month",14)], [(val_add,"$year",1), (assign,"$month",1)]),

since there are generally 13 lunar months per solar year, give or take a day. If you like it, take it. Just give me a credit, huh? :lol:
 
For a regular player not at all. Its for modders to include to make dates in the game. You can then link events to certain dates if thats the kind of mod you were making.
 
This point is to give the modder the ability to script changes based on the date, without having to count days from the first game day. For example, the Battle of the Pelennor Fields from LoTR:RoTK happened on a specific day of the month in a particular year (March 14-15 3019 III, fyi). If AW ever wanted to include that battle in his mod, this would allow him to keep track of the time without having to say, 'OK, 452 days from game day 0, the Battle of the Pelennor Fields starts, and two days later it's over.". This may sound simple, but when you've got several of these time-related events happening, counting days simply doesn't work. In the Onin no Ran mod, there are literally scores of events and quests related to the aristocrat and bushi classes that are date-related (the Japanese are VERY fond of holidays). Thus, if you want a trigger to fire on 10/23/2006, you just add the following to the conditionals in the trigger:

Code:
(eq,"$day",23),(eq,"$month",10),(eq,"$year",2006)
 
Excellent work, and a very promising little script. I can't wait to see this in action.

I swear, this game is the best thing that's happened to crpgs since Daggerfall. Probably even better than that because of the modability.
 
Daggerfall...
working...
FESTIVALS!

edit; I just can't forget the day the temples made free ressuractions, "Bring out your fresh dead!"
 
Back
Top Bottom