gbk
06-15-2002, 05:07 PM
..But sometimes, it just doesnt give enough light, if you know what I mean...
# Script to set all lighting in level to max upon activation, and return it to normal after deactivation.
#
# 06/2002 GBK
Symbols
Message Startup
Message Activated
Int Mode=0 Local
Int S=0 Local
Int I=0 Local
End
Code
Startup:
Sleep(1);
S = Getsectorcount();
Heapnew(0, S + 1);
For(I=0;I<=S;I=I+1) Heapset(I, Getsectorlight(I));
Sleep(1);
Printint(S);
Stop;
Activated:
If(!Mode) { Mode = 1;
For(I=0;I<=S;I=I+1) Setsectorlight(I, 1, 0);
JKstringclear(); JKstringconcatasciistring("Lighting set to maximum.");
JKstringoutput(-3, -1);}
Else If(Mode) { Mode = 0;
For(I=0;I<=S;I=I+1) Setsectorlight(I, Heapget(I), 0);
JKstringclear(); JKstringconcatasciistring("Lighting returned to normal.");
JKstringoutput(-3, -1);}
Stop;
End
This is, what I believe to be, the first practical application of the Heap verbs. Feel free to try it out, it works great. I suppose the same effect could be achieved by attaching a super-bright dynamic light to the player, but that just doesnt have the same dramatic appeal.... http://forums.massassi.net/html/biggrin.gif
This (or a similar cog) will be in a upcoming mod of mine, called the 'GBK tools'. Essentially a pack of cogs that Ive written (or will write) that make diagnosing problems in new levels easier... More on that to come later.
And please, respond! The last time I posted a cog like this, nobody commented, and it made me depressed. http://forums.massassi.net/html/frown.gif
------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.
JK editing resources (http://www.tbns.net/GBK/ol/index.htm).
# Script to set all lighting in level to max upon activation, and return it to normal after deactivation.
#
# 06/2002 GBK
Symbols
Message Startup
Message Activated
Int Mode=0 Local
Int S=0 Local
Int I=0 Local
End
Code
Startup:
Sleep(1);
S = Getsectorcount();
Heapnew(0, S + 1);
For(I=0;I<=S;I=I+1) Heapset(I, Getsectorlight(I));
Sleep(1);
Printint(S);
Stop;
Activated:
If(!Mode) { Mode = 1;
For(I=0;I<=S;I=I+1) Setsectorlight(I, 1, 0);
JKstringclear(); JKstringconcatasciistring("Lighting set to maximum.");
JKstringoutput(-3, -1);}
Else If(Mode) { Mode = 0;
For(I=0;I<=S;I=I+1) Setsectorlight(I, Heapget(I), 0);
JKstringclear(); JKstringconcatasciistring("Lighting returned to normal.");
JKstringoutput(-3, -1);}
Stop;
End
This is, what I believe to be, the first practical application of the Heap verbs. Feel free to try it out, it works great. I suppose the same effect could be achieved by attaching a super-bright dynamic light to the player, but that just doesnt have the same dramatic appeal.... http://forums.massassi.net/html/biggrin.gif
This (or a similar cog) will be in a upcoming mod of mine, called the 'GBK tools'. Essentially a pack of cogs that Ive written (or will write) that make diagnosing problems in new levels easier... More on that to come later.
And please, respond! The last time I posted a cog like this, nobody commented, and it made me depressed. http://forums.massassi.net/html/frown.gif
------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.
JK editing resources (http://www.tbns.net/GBK/ol/index.htm).