Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-09-2002, 09:44 PM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
Question question

im making a day/night script for a non-p2p server whats the best way to have so much time for and so much for night do i use tomouts or something.
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #2  
Old 03-10-2002, 02:20 AM
milotheman milotheman is offline
Banned
milotheman's Avatar
Join Date: Apr 2001
Posts: 0
milotheman is on a distinguished road
if (playerenters && !isweapon) {
toweapons -Day-Night;
}
if (isweapon && (playerenters || timeout)) {
if (disabledaynight==true) {
hideicons();
} else {
mytimervar = timevar;
daymins = (mytimevar%720)*2;
days = int(mytimevar/720);
months = int(days/24);
daysinmonth = days%24;
cyclus = int(months/32);
monthincyclus = months%32;
years = 1+cyclus*2+(monthincyclus>15 ? 1 : 0);
issilvester = ((monthincyclus in (14,31) && daysi
isredyear = (monthincyclus in <15, 31> || (monthi
setColors();
hideicons();
} else {
drawDate();
drawTime();
}
if (issilvester==true && isonmap && nightfactor>=
if (this.hurtcounter>=10) {
hurt int(nightfactor*4);
this.hurtcounter = 0;
} else {
this.hurtcounter = this.hurtcounter+(0.05);
}
} else {
this.hurtcounter = 0;
}
}
timeout = 0.05;
}
function setColors() {
redness = 0;
greenness = 0;
blueness = 0;
darkness = 0;
nightfactor = (abs(daymins-720)-180)/720;
if (nightfactor>0) {
if (issilvester==true) {
darkness = 0;
redness = nightfactor*0.7;
greenness = nightfactor*0.7;
blueness = nightfactor*0.4;
}
else if (isredyear==true) {
darkness = nightfactor*0.6;
redness = nightfactor*0.4;
} else {
darkness = nightfactor*0.8;
blueness = nightfactor*0.2;
}
}
redfactor = (180-abs(daymins-420))/1440;
if (redfactor>0) {
redness = redness+(redfactor);
}
if (!isonmap) {
redness = redness*(0.2);
greenness = greenness*(0.2);
blueness = blueness*(0.2);
darkness = darkness*(0.2);
}
seteffect redness,greenness,blueness,darkness;
}
function drawDate() {
setaray count,9;
drawx = 230;
drawy = 70;
count[0] = (monthincyclus<15 ? 15 : 12);
i = years;
count[2] = i%10;
count[1] = int(i/10);
count[3] = 13;
i = (monthincyclus>=15 ? monthincyclus-15 : monthin
count[5] = i%10;
count[4] = int(i/10);
count[6] = 14;
i = daysinmonth+1;
count[8] = i%10;
count[7] = int(i/10);
i = 0;
while (i<=8) {
imgindex = 1010+i;
showimg imgindex,state.png,drawx,drawy;
changeimgpart imgindex,count[i]*14,81,14,16;
changeimgvis imgindex,4;
drawx = drawx+(12);
if (i in {0,3,6}) {
drawx = drawx+(2);
}
i = i+1;
}
}
function drawTime() {
setarray count,2;
drawx = 350;
drawy = 70;
showimg 1000,state.png,drawx,drawy;
changeimgpart 1000,162,60,14,14;
changeimgvis 1000,4;
dayhour = int(daymins/60);
count[0] = int(dayhour/10);
count[1] = dayhour%10;
i = 0;
while (i<=1) {
if (i==0 && count[i]==0) {
hideimg 1001+i;
continue;
}
showimg 1001+i,state.png,drawx+16+i*12,drawy;
changeimgpart 1001+i,count[i]*14,81,14,16;
changeimgvis 1001+i,4;
i = i+1;
}
showimg 1003,state.png,drawx+40,drawy;
changeimgpart 1003,154,81,14,16;
changeimgvis 1003,4;
mins = daymins%60;
count[0] = int(mins/10);
count[1] = mins%10;
i = 0;
while (i<=1) {
showimg 1004+i,state.png,drawx+52+i*12,drawy;
changeimgpart 1004+1,count[i]*14,81,14,16;
changeimgvis 1004+i,4;
i = i+1;
}
}
function hideicons() {
showimg 1001+i,state.png,drawx+40,drawy;
changeimgpart 1003,4;
mins = daymins%10;
i = 0:
while (i<=1) {
showimg 1004+i,state.png,drawx+52+i*12,drawy;
changeimgpart 1004+i,count[i]*14,81,14,16;
changeimgvis 1004+i,4;
i = i+1;
}
showimg 1003,state.png,drawx+40,drawy;
changeimgpart 1003,154,81,14,16;
changeimgvis 1003,4;
mins = daymins%60;
count[0] = int(mins/10);
count[1] = mins%10;
i = 0;
while (i<=1) {
showimg 1004+i,state.png,drawx+52+i*12,drawy;
changeimgpart 1004+i,count[i]*14,81,14,16;
changeimgvis 1004+i,4;
i = i+1;
}
}
function hideicons() {
i = 0;
while (i<=20) {
hideimg 1000+i;
i = i+1;
}
}

y dont this work?
Reply With Quote
  #3  
Old 03-10-2002, 02:23 AM
milotheman milotheman is offline
Banned
milotheman's Avatar
Join Date: Apr 2001
Posts: 0
milotheman is on a distinguished road
oh ****
Reply With Quote
  #4  
Old 03-10-2002, 02:40 AM
milotheman milotheman is offline
Banned
milotheman's Avatar
Join Date: Apr 2001
Posts: 0
milotheman is on a distinguished road
Quote:
Originally posted by Kaimetsu


If I was one iota more sure that you did that to annoy me then I'd get quite annoyed.
what?
Reply With Quote
  #5  
Old 03-10-2002, 03:45 AM
LilNiglet LilNiglet is offline
Registered User
Join Date: Jun 2001
Posts: 3,178
LilNiglet is on a distinguished road
Quote:
Originally posted by Kaimetsu


Read the guidelines before I throw you in the pit of boiling sharks.
Boiling sharks? Woah. Err... yeah. I won't argue.

;D
Reply With Quote
  #6  
Old 03-10-2002, 05:18 AM
la_builder la_builder is offline
Registered User
Join Date: Jan 2002
Location: Holland
Posts: 154
la_builder is on a distinguished road
Talking

thanks kai it worked
__________________
Dark Frontier
The enemy is surrounding us all,more evil than a human could ever imagine.

Dark Fontier Coming Soon
Reply With Quote
  #7  
Old 03-10-2002, 05:55 AM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Re: Re: question

Quote:
Originally posted by Kaimetsu


Timevar is the way to go, use some formulae to extract from it the units you need.
Reply With Quote
  #8  
Old 03-10-2002, 07:42 AM
milotheman milotheman is offline
Banned
milotheman's Avatar
Join Date: Apr 2001
Posts: 0
milotheman is on a distinguished road
oh well
Reply With Quote
  #9  
Old 03-10-2002, 01:30 PM
nyghtGT nyghtGT is offline
Banned
nyghtGT's Avatar
Join Date: Jun 2001
Posts: 3,993
nyghtGT is on a distinguished road
Send a message via AIM to nyghtGT
Quote:
Originally posted by milotheman
oh well
thats not a good way to approach the issue ...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:20 PM.


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