In game year

Posted by Metsuro on Tue 11 Jul 2006 10:29 PM — 6 posts, 22,752 views.

USA #0
I am trying to convert the ingame year to more towards one of ours. However doing only certain amount of days per month I am not sure how to do? could someone maybe explain? or help how to do it?
USA #1
I think you'll have to change pulses. Do a search, I've seen this brought up before. Changing pulses isn't something that simple.
USA #2
it really isn't the pulse. when it updates time, theres a check for time_info.day >= 30 then it resets to 0 and ups the month 1, however I am not sure how to change this to allow only certian months to go to 30, some to 31, and then 28, and then eventualy the 28 to 29
USA #3
So when you say that you want the year to be like ours, you don't mean it at all in terms of passing of time, but in terms of days per month. That's an important detail. :-)

Basically you'll just want to add extra bits to the if check where you say things like: if day >= 30 and month=april, move to may. But if day >= 31 and month=jan, move to feb. This shouldn't be too hard if you know precisely how many days you want for specific months.
USA #4
Yes however I dont know how to it up, because there are 3 different amounts, to several different months, I am not sure how I'd setup an ifcheck to do that.
USA #5
Just do several if checks, I already showed you the basic structure. If day >= 31 and month = jan or mar or may etc., then move to next month. If day >= 30 and month = april or june etc., then move to next month. The hard part is for leap years. You'd have to do something like: if day >= 28 and month = feb and not leap year, move to mar, else make one more day. If day >= 29 and month = feb, move to mar.

It might help you to write down what you're trying to do in English before you try to write the code. If you can't formulate what you want in English (or whatever natural language you prefer) there is almost no hope of being able to write code for it.