i got this script.. its um.. well cool. it just dosent work.
as your clearence is B4 you are alowed to see and fix it.. and know what it dose.. jsut not know why i need it... commader says so... sry![http://forums.massassi.net/html/frown.gif [http://forums.massassi.net/html/frown.gif]](http://forums.massassi.net/html/frown.gif)
(makes day/night/rain/fog/thunder/lightning/+more if it workes ever)
please please tell me its not totaly ruined... parsec says its clean.. i got a hint it may be a problem with the timers and there calling.. but after two days of searching i am totaly confused..
P.s. A get a feeling we are gonne need help...
-puts GBK on cellophane pops it on a big lamp on top of the police station and shines it inot the clouds-
------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's
-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO
Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
as your clearence is B4 you are alowed to see and fix it.. and know what it dose.. jsut not know why i need it... commader says so... sry
![http://forums.massassi.net/html/frown.gif [http://forums.massassi.net/html/frown.gif]](http://forums.massassi.net/html/frown.gif)
(makes day/night/rain/fog/thunder/lightning/+more if it workes ever)
Code:
# Jedi Knight Cog Script
#
# day.cog
#
# creates day and night, as well as surface rain.(and fog)
# thanks to DSLS_DeathSythe for his SURF_RAIN01.COG, the base of the rain in this.
#
# This Cog is Not supported by LucasArts Entertainment Co
flags=0x240
#=====
symbols
#-----
message startup
message timer
flex random=0 local
flex daynight=32400
flex addlight=0.8
sector i=0 local
surface x=0 local
material mat local
material day
material dusk
material dawn
material night
int daya=0 local
int debug=0
flex sec_lite=0.0 local
int fogr
int fogg
int fogb
int effecthandle local
#-----
flex x_maxr=1.0
flex y_maxr=1.0
template rain_tpl=+repeaterball local
template train_tpl=+repeaterball
template tunder_tpl=+repeaterball
template lightning_tpl=+repeaterball
template fog_tpl=+repeaterball
flex p=0.0
flex y=90.0
flex maxrain_delay=0.5
int rain_drips=3
flex range=3.0
#-----
thing player=-1 local
vector pyr_vec local
surface a local
int d=0 local
vector surf_vec01 local
vector rand_Svec01 local
sector surf_sec01 local
flex surf_Vx01 local
flex surf_Vy01 local
flex surf_Vz01 local
flex delay1=0.0 local
surface b local
int e=0 local
vector surf_vec02 local
vector rand_Svec02 local
sector surf_sec02 local
flex surf_Vx02 local
flex surf_Vy02 local
flex surf_Vz02 local
flex delay2=0.0 local
surface c local
int f=0 local
vector surf_vec03 local
vector rand_Svec03 local
sector surf_sec03 local
flex surf_Vx03 local
flex surf_Vy03 local
flex surf_Vz03 local
flex delay3=0.0 local
#-----
end
#=====
code
#-----
startup:
Sleep(2.0);
player = GetLocalPlayerThing();
//-Setup the PYR of the rain_tpl...
pyr_vec = VectorSet(p, y, 0.0);
if((IsServer()) || (!IsMulti()))
{
//-Make it DAY...
for(i=0; i<GetSectorCount(); i=i+1)
//-look for the special sector flag...
if(GetSectorFlags(i) & 0x100)
{
sec_lite = GetSectorLight(i);
sec_lite = sec_lite + addlight;
SetSectorLight(i, sec_lite, 0.0);
}
//-Set the sky to DAY...
for(x=0; x<GetSurfaceCount(); x=x+1)
//-look for the two types of sky flags...
if((GetSurfaceFlags(x) & 0x200) || (GetSurfaceFlags(x) & 0x400))
SetSurfaceMat(x, day);
daya = 0;
SetTimerEx((daynight / 2), 1, 0, 0);
SetTimerEx(daynight, 2, 0, 0);
SetTimerEx((daynight / 4), 3, 0, 0);
}
return;
#-----
timer:
if(GetSenderID()== 1)
{
//-Start the light fade...
if(daya == 0)
daya = 1;
else
if(daya == 1)
daya = 0;
for(i=0; i<GetSectorCount(); i=i+1)
//-look for the special sector flag...
if(GetSectorFlags(i) & 0x100)
{
if(daya == 0)
{
if(debug == 1)
Print("going to day...");
sec_lite = GetSectorLight(i);
sec_lite = sec_lite + addlight;
SetSectorLight(i, sec_lite, (daynight * 1.75));
}
else
if(daya == 1)
{
if(debug == 1)
Print("going to night...");
sec_lite = GetSectorLight(i);
sec_lite = sec_lite - addlight;
SetSectorLight(i, sec_lite, (daynight * 1.75));
}
}
return;
}
else
if(GetSenderID() == 2)
{
//-Change the sky...
for(x=0; x<GetSurfaceCount(); x=x+1)
//-look for the two types of sky flags...
if((GetSurfaceFlags(x) & 0x200) || (GetSurfaceFlags(x) & 0x400))
{
mat = GetSurfaceMat(x);
if(mat == day)
SetSurfaceMat(x, dusk);
else
if(mat == dusk)
{
SetSurfaceMat(x, night);
SetTimerEx((daynight / 2), 1, 0, 0);
}
else
if(mat == night)
SetSurfaceMat(x, dawn);
else
if(mat == dawn)
{
SetSurfaceMat(x, day);
SetTimerEx((daynight / 2), 1, 0, 0);
}
}
SetTimerEx(daynight, 2, 0, 0);
if(GetSenderID() == 3)
{
//this is the weather man speaking! muhahahaahaahah! (BBUUZZZZAAAPP!!!!)
//first make a random nuber appear, it will deside what weather to have.
random=Rand();
//mext find out what wether we are haveing. you just cant wait can you?
if (random<=0.5) //if more weather is needed put it ABOVE this line
{
call sun;
return;
}
if (random<=0.6)
{
call rain;
return;
}
if (random<=0.7)
{
call snow;
return;
}
if (random<=0.8)
{
call fog;
return;
}
if (random<=0.9)
{
call thunder;
return;
}
if (random<=1)
{
call death;
return;
}
#====
return;
}
return;
}
//time to rain on me :-(
//-TIMER - (1)
if(GetSenderID() == 4)
{
for(a=0; a<GetSurfaceCount(); a=a+1)
{
//-Look for all surfaces that are flaged as SKY...
if((GetSurfaceFlags(a) & 0x200) || (GetSurfaceFlags(a) & 0x400))
{
//-Check to see if the surface is flat and aiming down...
if(VectorZ(GetSurfaceNormal(a)) == -1.0)
{
//-Get the surfaces center vec, and the surfaces sector...
surf_sec01 = GetSurfaceSector(a);
surf_vec01 = GetSurfaceCenter(a);
surf_Vx01 = VectorX(surf_vec01);
surf_Vy01 = VectorY(surf_vec01);
surf_Vz01 = VectorZ(surf_vec01);
surf_Vz01 = surf_Vz01 - 0.025;
for(d=0; d<rain_drips; d=d+1)
{
//-Randomize the vector...
rand_Svec01 = VectorSet(((surf_Vx01 + (Rand() - 0.5) * x_maxr)), ((surf_Vy01 + (Rand() - 0.5) * y_maxr)), surf_Vz01);
//-Check to see if the rand_Svec is within the range...
if((VectorDist(rand_Svec01, GetThingPos(player)) <= range))
{
CreateThingAtPos(rain_tpl, surf_sec01, rand_Svec01, pyr_vec);
}
}
}
}
}
//-Reset the random timer...
delay1 = Rand();
if(delay1 > maxrain_delay)
delay1 = maxrain_delay;
SetTimerEx(delay1, 4, 0, 0);
return;
}
//-TIMER - (2)
else
if(GetSenderID() == 5)
{
for(b=0; b<GetSurfaceCount(); b=b+1)
{
//-Look for all surfaces that are flaged as SKY...
if((GetSurfaceFlags(b) & 0x200) || (GetSurfaceFlags(b) & 0x400))
{
//-Check to see if the surface is flat and aiming down...
if(VectorZ(GetSurfaceNormal(b)) == -1.0)
{
//-Get the surfaces center vec...
surf_vec02 = GetSurfaceCenter(b);
surf_sec02 = GetSurfaceSector(b);
surf_Vx02 = VectorX(surf_vec02);
surf_Vy02 = VectorY(surf_vec02);
surf_Vz02 = VectorZ(surf_vec02);
surf_Vz02 = surf_Vz02 - 0.025;
//-Make the amount of rain_drips for each surface...
for(e=0; e<rain_drips; e=e+1)
{
//-Randomize the vector...
rand_Svec02 = VectorSet(((surf_Vx02 + (Rand() - 0.5) * x_maxr)), ((surf_Vy02 + (Rand() - 0.5) * y_maxr)), surf_Vz02);
//-Check to see if the rand_Svec is within the range...
if((VectorDist(rand_Svec02, GetThingPos(player)) <= range))
{
CreateThingAtPos(rain_tpl, surf_sec02, rand_Svec02, pyr_vec);
}
}
}
}
}
//-Reset the random timer...
delay2 = Rand();
if(delay2 > maxrain_delay)
delay2 = maxrain_delay;
SetTimerEx(delay2, 5, 0, 0);
return;
}
//-TIMER - (3)
else
if(GetSenderID() == 6)
{
for(c=0; c<GetSurfaceCount(); c=c+1)
{
//-Look for all surfaces that are flaged as SKY...
if((GetSurfaceFlags(c) & 0x200) || (GetSurfaceFlags(c) & 0x400))
{
//-Check to see if the surface is flat and aiming down...
if(VectorZ(GetSurfaceNormal(c)) == -1.0)
{
//-Get the surfaces center vec...
surf_sec03 = GetSurfaceSector(c);
surf_vec03 = GetSurfaceCenter(c);
surf_Vx03 = VectorX(surf_vec03);
surf_Vy03 = VectorY(surf_vec03);
surf_Vz03 = VectorZ(surf_vec03);
surf_Vz03 = surf_Vz03 - 0.025;
//-Make the amount of rain_drips for each surface...
for(f=0; f<rain_drips; f=f+1)
{
//-Randomize the vector...
rand_Svec03 = VectorSet(((surf_Vx03 + (Rand() - 0.5) * x_maxr)), ((surf_Vy03 + (Rand() - 0.5) * y_maxr)), surf_Vz03);
//-Check to see if the rand_Svec is within the range...
if((VectorDist(rand_Svec03, GetThingPos(player)) <= range))
{
CreateThingAtPos(rain_tpl, surf_sec03, rand_Svec03, pyr_vec);
}
}
}
}
}
//-Reset the random timer...
delay3 = Rand();
if(delay3 > maxrain_delay)
delay3 = maxrain_delay;
SetTimerEx(delay3, 6, 0, 0);
return;
}
return;
#=====
//wether pattens go here
sun:
//its a perfect day, so do nothing but add light.
call addlight;
call returna;
return;
rain:
//its not a good forcast, lets make it dark.
call darklight;
//time for the rain
y=90.0;
rain_tpl=train_tpl;
call returna;
call rainme;
return;
snow:
//its not a good forcast, lets make it dark.
call darklight;
call returna;
return;
fog:
rain_tpl=fog_tpl;
effecthandle=newColorEffect(0, 0, 0, 0, 0, 0, fogr, fogg, fogb, 0);
//its not a good forcast, lets make it dark.
call darklight;
call returna;
return;
thunder:
//its not a good forcast, lets make it dark.
call darklight;
y=0.0;
rain_tpl=tunder_tpl;
call returna;
call rainme;
return;
death:
//its not a good forcast, lets make it dark.
call darklight;
y=90.0;
rain_tpl=lightning_tpl;
call returna;
call rainme;
return;
addlight:
for(i=0; i<GetSectorCount(); i=i+1)
if(GetSectorFlags(i) & 0x100)
{
sec_lite = GetSectorLight(i);
sec_lite = sec_lite + 0.5;
SetSectorLight(i, sec_lite, 0.0);
}
return;
darklight:
for(i=0; i<GetSectorCount(); i=i+1)
if(GetSectorFlags(i) & 0x100)
{
sec_lite = GetSectorLight(i);
sec_lite = sec_lite -0.5;
SetSectorLight(i, sec_lite, 0.0);
}
return;
returna:
#sleep(daynight / 4);
//clear all the problems from erlyer
FreeColorEffect(effecthandle);
SetTimerEx((daynight / 4), 3, 0, 0);
return;
rainme:
SetTimerEx(0.25, 4, 0, 0);
SetTimerEx(0.5, 5, 0, 0);
SetTimerEx(0.75, 6, 0, 0);
return;
#=====
endplease please tell me its not totaly ruined... parsec says its clean.. i got a hint it may be a problem with the timers and there calling.. but after two days of searching i am totaly confused..
P.s. A get a feeling we are gonne need help...
-puts GBK on cellophane pops it on a big lamp on top of the police station and shines it inot the clouds-
------------------
I am pjb.
Another post......
another moment of my life wasted.....
at least i made a level.
PJB's JK page's
-the PJB jedi rule book-
rule one, "never trust a bartender with bad grammar"-kyle katarn in JO
Rule Two, "Gravity is a crule misstress" -kyle katarn in MotS, and the alternatior MK I in AJTD
I am Darth PJB!
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
well, go on, run away!
i have a plastic lightsaber and a jedi cape.. am i a nerd?
If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
![http://forums.massassi.net/html/biggrin.gif [http://forums.massassi.net/html/biggrin.gif]](http://forums.massassi.net/html/biggrin.gif)
![http://forums.massassi.net/html/redface.gif [http://forums.massassi.net/html/redface.gif]](http://forums.massassi.net/html/redface.gif)