Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Timevar: Minutes/Hours/Days/Months/Years (https://forums.graalonline.com/forums/showthread.php?t=36841)

emortylone 08-29-2002 03:08 AM

Timevar: Minutes/Hours/Days/Months/Years
 
I decided to play w/ timevar yesterday, and it took me a bit to come up with the following, but I find it may be helpful for others if they intend to do some sort of server time system :)
NPC Code:

if (created || timeout)
{ this.minutes=timevar*5/60;
for (m=0;this.minutes>60;m++)
{ this.minutes=this.minutes-60;}
this.hours=timevar*5/60/60;
for (h=0;this.hours>24;h++)
{ this.hours=this.hours-24;}
showimg 237,@@bc@#v(this.hours):#v(this.minutes),screenwid th/3,screenheight/screenheight+40;
changeimgzoom 237,0.8;
changeimgvis 237,4;
timeout=0.05;
}


it should ALL be clientsided btw, I don't know if timevar works clientside yet because I haven't been home to test anything, I've done this ALL at school today, enjoy, you're welcome BTW.
---Shifter
P.S. If you DO end up using part(s) of my ideas here, please include //Timevar: hours/minutes by Projectshifter ([email protected]) thanks.
---Shifter

Legondary_MyTH 08-29-2002 04:27 AM

...
 
0.0

voicedcow6666 08-29-2002 04:35 AM

I just tested that offline......it was all screwed up, the time that is, PLUS it was LAGGY as hell....it's pretty bad when a script is THAT laggy OFFLINE

prozac424242 08-29-2002 05:42 AM

i tried that too
 
1 Attachment(s)
Since someone brought up timevar,
here is what I did with it.

reply what you will about it.

one thing i ask is that
if you have a gripe or complaint then
you MUST also post a suggested fix,
even if its in plain english or algorithm-ish.

Legondary_MyTH 08-29-2002 05:52 AM

whoa
 
cool and i think prozac is in the running for best sig award =D

Python523 08-29-2002 05:57 AM

prozac, look into string arrays, instead of having to set a string for each month, do
setstring this.months,January,February,March,April,May,June, July,August,September,October,November,December;
and use a var to get the month
#I(this.months,0) = January

emortylone 08-29-2002 08:01 AM

LOL, I did say however I didn't test the script. I didn't quite realize it couldn't process math quite like that =P I altered it a bit using w/ Commands, and it takes FOREVER to just CHUNK down the hours x.X So it sux0rz, he he.
---Shifter

Warcaptain 08-29-2002 12:36 PM

Quote:

Originally posted by Python523
prozac, look into string arrays, instead of having to set a string for each month, do
setstring this.months,January,February,March,April,May,June, July,August,September,October,November,December;
and use a var to get the month
#I(this.months,0) = January

yes thats how i have it set up on enigma... :cough:


All times are GMT +2. The time now is 02:38 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.