Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ In game year
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Tue 11 Jul 2006 10:29 PM (UTC) |
Message
| 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? |
Everything turns around in the end | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Tue 11 Jul 2006 10:33 PM (UTC) |
Message
| 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. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #2 on Tue 11 Jul 2006 10:37 PM (UTC) |
Message
| 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 |
Everything turns around in the end | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #3 on Wed 12 Jul 2006 04:07 AM (UTC) |
Message
| 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. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #4 on Wed 12 Jul 2006 04:29 AM (UTC) |
Message
| 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. |
Everything turns around in the end | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #5 on Wed 12 Jul 2006 04:45 AM (UTC) |
Message
| 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. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
18,973 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top