Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Thank God for the fieldlight...
Thank God for the fieldlight...
2002-06-15, 2:07 PM #1
..But sometimes, it just doesnt give enough light, if you know what I mean...

Code:
# 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.
And when the moment is right, I'm gonna fly a kite.
2002-06-15, 2:10 PM #2
Not bad. If I understood the heap verbs well it might be even better!

You cog pack sounds like a real break through. I am interested to see what other cogs you have slapped in there.
Team Battle.
2002-06-15, 2:21 PM #3
Sabermaster did the research into the Heap verbs. His findings should be in the new version of his 'Datamaster', if not, you can find them here.

The mod is still on the drawing board, and I currently only have a few cogs for it. One other one of note, is the 'object counter' I posted awhile back. (An updated version of it, of course..). It prints out the actul number of objects in the level. Useful for diagnosing thinglimit problems...

------------------
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.
And when the moment is right, I'm gonna fly a kite.
2002-06-15, 11:49 PM #4
Sounds like a good idea.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-06-16, 2:03 AM #5
Looks cool.

In mots there's a really easy way to get to see everything, just use the scope in combination with force seeing, then everything will be fully lit.
Though the disadvantage is that you are zoomed in so that makes walking harder.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-06-16, 2:16 AM #6
Im problably not going to use this method in the release version... Its kinda buggy.... But at least I managed to create a good use for the Heap verbs.. [http://forums.massassi.net/html/wink.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.
And when the moment is right, I'm gonna fly a kite.
2002-06-16, 4:29 AM #7
Nice cog, GBK. [http://forums.massassi.net/html/wink.gif] I'm glad someone made use of those verbs. [http://forums.massassi.net/html/smile.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-06-16, 4:37 AM #8
Test tools? I like, I like.

Whilst you are a far better COGger than I, I might still be able to think up and build some COGs for this, should you want them.

And I have found another use for the Heap verbs: Objectless pathnode system for bots/AI. I'm working on a system with this so to make an AI that can "learn" levels dynamically, rather then have a predetermined setup.

------------------
His pot is blacker than his kettle!
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2002-06-16, 7:41 AM #9
Email me... [http://forums.massassi.net/html/smile.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.
And when the moment is right, I'm gonna fly a kite.
2002-06-16, 6:28 PM #10
GBK, have you tested this multiplayer?

The output lines lead me to believe that the effect was intended to be global.

I have noticed many times when working with for() and while() loops in multiplayer JK that they don't synchronize at all. It must have something to do with running so fast that JK doesnt even try to send all that data.

Say computer1 does this:

for(i = 0; i < GetSurfaceCount(); i = i + 1)
{
SetSurfaceFlags(i, 0x4000);
}

On computer1 every surface becomes magsealed. On computer2 there is no change in surface flags.

I'm thinking your fieldlight might be fine multiplayer if the level had a very low sector count. Otherwise I would bet your fieldlight effect is restricted to user.

Anyone else ever notice this? or am I a lone nutcase? I've always had to use triggers and run the loop on clients to ensure it works corectly.

[This message has been edited by The_New_Guy (edited June 16, 2002).]
- Wisdom is 99% experience, 1% knowledge. -
2002-06-17, 3:56 AM #11
Heap verbs and special multiplayer verbs confuse me. [http://forums.massassi.net/html/confused.gif] Live on forever, you will. The darkside shall never claim you. We, the non-masters of cog, the beginners, the intermedates, and the advance coggers, thank you for all of your help. [http://forums.massassi.net/html/smile.gif] (or at least I do)

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-06-17, 5:22 AM #12
To be honest, I never gave a single thought to MP compatability. But, if I used the dynamic light method, Im sure it would fix any problems...

------------------
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.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!