In response to LordAndrew
LordAndrew wrote:
Or a look-up table.

> var list/days = list(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
>
> proc/CheckMonthCount()
> return days[currMONTH]
>


that's actually a really good idea too.

i think i will.
In response to LordAndrew
LordAndrew wrote:
Or a look-up table.

> var list/days = list(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
>
> proc/CheckMonthCount()
> return days[currMONTH]
>


Even better (:
In response to FIREking
FIREking wrote:
You're all making this harder than it is, you can just scale time. If you want time to be slower, you would just take current time and multiply it by a decimal point... if you wanted time to be twice as long as real time, it would be realtime * 2

your code here


This is just one way to do it, you could also base it off of world.timeofday (resets every 24 hours) or world.realtime (only has minute precision, not seconds precision).

I did it your way, making changes to get it to the 7.2 scale I wanted(not really hard, I changed wording a bit as well), but after doing so, it works! Until it gets to 0:5(hour:minute), it resets to 0:0 for some reason.

Also, I tried world.timeofday, but it gave a huge number, I want the 'clock' to stick to a 12/24-hour design(from 1-12 then back to 1 or 0-23 then back to 0) how do I set that up? do I just need an if() statement that changes world.time(if that even works)?
In response to JS173
Try changing your h:m to hh:mm.
the code used doesn't use H:M it uses 2 procedures[I changed them to TimeH()/TimeM()]

so the code for time is:
mob/Stat()
stat("Time",FullTime


which is gotten by:
proc/TimeUp()
FullTime=GameTime()
spawn(72) TimeUp()


Which is gotten by the procedures TimeH() and TimeM() set in this way:
proc/GameTime()
return "[TimeH]:[TimeM]"


so, in conclusion, I'm not sure how to set the code to hh:mm in this situation, as this would make it "[TimeH][TimeH]:[TimeM][TimeM]" which would not work very well.
In response to JS173
after Full Time add a )
I did, if I didn't I'd have an error, I typo'd in my comment.
so, no help on why it's resetting when it gets to 5?
Going to need you to post what you used.

Thanks.
world
New()
..()
spawn TimeUpdate()
proc
TimeH()
return round((world.time*TimeScale)/36000)
TimeM()
return round((world.time*TimeScale)%3600/600)
GameTime()
return "[TimeH()]:[TimeM()]"
TimeUp()
FullTime=GameTime()
spawn(72) TimeUp()
var
TimeScale=7.2
FullTime=""
TimeH=TimeH()
mob/Stat()
stat("Time",FullTime)


I used what was given before, just changed the wording, mostly.
In TimeM() - 3600/600 is 6. Is it supposed to be 36000 ?
probably...that would explain things(probably) since it only makes it to 5, then resets on 6. I'll make the change and see what happens, thanks.

EDIT: Well, it makes it over 5, but it now starts at 8 and increases in intervals of 8, would lowering the time between the clock's update cause problems? say, if I lower how long it takes between, will it slow the game's speed/increase lag for players 'cause it's updating so often?
It's pretty basic, and it's only time - so it shouldn't, but define debug and profile it. See what it gives you.
Page: 1 2