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 → If you can't see it, it isn't there...
If you can't see it, it isn't there...
2002-09-09, 6:55 PM #1
...Unless, of course, you are referring to small architectural details, which can sometimes be hidden by poor texturing. Enter my latest cog; The Dflt-leveler. Upon activation, it will set all of the surfaces in a level to the default material (actully, my own dflt.mat 'clone', which has 9 cels, for reasons Ill explain later). When activated a second time, it will change the textures back to what they were before. Having said that, I will add, this is my second official use of the heap verbs... Mad props to SM, for his research.


Code:
# Simple script to change all of a level's surfaces to dflt, then back again.
#
# 09/2002 GBK - Packman573@aol.com
symbols

message   Activated

material  M=gbk_dflt.mat   local

int       I=0              local
int       P=0              local
int       H=0              local

end
code
activated:
	if(!P)
	{
		if(!H)
		{
			H = 1;
			Print("Saving original mats...");
			HeapNew(0, GetSurfaceCount() + 1);
			for(I = 0; I <= GetSurfaceCount(); I = I + 1) HeapSet(I, GetSurfaceMat(I));
		}
		P = 1;
		Print("Setting dflt material...");
		for(I = 0; I <= GetSurfaceCount(); I = I + 1) SetSurfaceMat(I, M);
	}
	else
	{
		P = 0;
		Print("Setting original mats...");
		for(I = 0; I <= GetSurfaceCount(); I = I + 1) SetSurfaceMat(I, HeapGet(I));
	}

Stop;
end



Do note, I ran it through Scribe, for those here who have difficulty reading my coding style. (which problably means everyone...)


Click here for the material.


About the material: The JK engine treats the dflt.mat differently than any other mat. When I modified it, and replaced it in my res2.gob, even with multiple cels, I couldnt set the wall cel. As a workaround, it isnt called dflt.mat... Place this material in your 'Jedi Knight/Resource/mat/' folder.


The cog itself can be implemented easist by saving it as "item_fieldlight.cog", andp placing it in 'Jedi Knight/Resouce/cog/'. Then, ingame, simply activate the fieldlight.


Or, if your lazy, just wait for my "GBK tools" mod, which I will be releasing soon. This cog will be included, along with quite a few others.


Oh, and please, respond. I could use some feedback. [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-09-09, 7:10 PM #2
cool....I wonder what I've overlooked in the LEC JK crevasses...

------------------
Try not, do; or do not.
Math is infinitely finite, while the universe is finitely infinite. PI = QED
2002-09-09, 10:25 PM #3
Very Impressive, except I don't know a thing about clogging.


I mean cogging.
Email me
2002-09-10, 4:06 AM #4
Ohhh, I could use that type of cog for my heat goggles. With simple modifacations, you can make that cog modify anything.


BTW - I can read your style.

edit - Sorry, I forgot to say I like it and its good.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited September 10, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-10, 8:17 AM #5
Fixing a few bugs...

Code:
# Simple script to change all of a level's materials to dflt, then back again.
#
# 09/2002 GBK - Packman573@aol.com
symbols

message   Startup
message   Activated

material  M=gbk_dflt.mat   local

int       I=0              local
int       P=0              local
int       H=0              local

end
code
startup:
	P = 0;
	H = 0;

Stop;
activated:
	if(!P)
	{
		if(!H)
		{
			H = 1;
			Print("Saving original mats...");
			HeapNew(0, GetSurfaceCount() + 1);
			for(I = 0; I <= GetSurfaceCount(); I = I + 1)
			{
				if(GetSurfaceMat(I) < 0) HeapSet(I, M);
				else HeapSet(I, GetSurfaceMat(I));
			}
		}
		Print("Setting dflt material...");
		P = 1;
		for(I = 0; I <= GetSurfaceCount(); I = I + 1) SetSurfaceMat(I, M);
	}
	else
	{
		Print("Setting original mats...");
		P = 0;
		for(I = 0; I <= GetSurfaceCount(); I = I + 1) SetSurfaceMat(I, HeapGet(I));
	}

Stop;
end


Again, gone through Scribe...


For a cog that uses the Heap verbs, this one seems quite stable. I havent had a single crash, and Ive been testing it hard for the past 2 days.


SM, I finally understand what you meant by "dflt.mat returning strange negative numbers"... Very strange indeed. [http://forums.massassi.net/html/eek.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.

[This message has been edited by GBK (edited September 10, 2002).]
And when the moment is right, I'm gonna fly a kite.
2002-09-10, 9:26 AM #6
Looks good, GBK. [http://forums.massassi.net/html/wink.gif] It should be useful to level authors.

And I'm glad Scribe is getting some use by the community.

Have you noticed any instability when using the Heap verbs? I know they can crash when used incorrectly, but I haven't had them crash without reason.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-10, 10:47 AM #7
Well, this cog works perfectly . . . so when used properly, the Heap verbs are as stable as any other verb.


[http://www.plauder-smilies.de/yellows/king.gif]

For those following it, the "GBK tools" now include the following:

  • The Superlight. (Fully illuminates the level)
  • The Dflt-Levler. (This cog)
  • X-ray vision. (See through walls!)
  • The Thing-counter. (Keeps a running count of the actual number of things in the level.)
  • The Rail. (Modification of the Rail det. Fires a slow moving projectile that goes through walls. Secondary teleports the player to the rail)



Thats what Ive completed so far. Id like to add a few more, like a tvtcs debugger, and other thing-related tools... As soon as its done, Ill ask for beta-testers.

------------------
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-09-10, 12:42 PM #8
I want the X-ray for my nightshot cog. I need it!

On "The Rail" cog, you have to come up with a way to test if the rail is in the world or not, otherwise you'll have alot of angry people. [http://forums.massassi.net/html/wink.gif] But I bet you already knew this. And if you've found a way to do this, can I have it, its for the nightshot as well. Please! Please! Please!

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited September 10, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-10, 2:51 PM #9
Well, once I release the tools, you can crack the gob and see how I did it... [http://forums.massassi.net/html/tongue.gif]


Oh, and about the 'if in world'... An earlier version of the Rail did just that, but it was as buggy as hell, and rarely worked. Sm, Seifer, and I came up with a method to do it, and you can find the code in SM's Datamaster. Goto tutorials, its under "Position's sector".

------------------
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-09-10, 2:54 PM #10
Stupid, stupid *whacks head agianst desk* stupid, stupid *desk breaks so starts wacking head agianst wall* continutes on...

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-10, 4:24 PM #11
I still don't get it. You guys are geniuses or something. I can only do the simplest cogs, and I even struggle with them. You guys C++ experts or something? I've been trying to learn it lately, and I find it easier than cog. I think my problem is that I cant figure out all JK's special verbs or something.

------------------
Watch the Skies.
2002-09-10, 4:28 PM #12
Im no programmer. Im just a mapper with Notepad and a copy of the JKspecs...

------------------
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-09-10, 4:44 PM #13
I know BASIC and alittle C/C++, C/C++ have so many different commands, I found it harder to master then C/C++. I'll I use is JKSpecs and my wordpad. It does take time to learn, but it takes longer to master C/C++ then to master cog. [http://forums.massassi.net/html/wink.gif] Edit - I'm only 13 *sneeze1sneeze4sneeze* and never in the future will we know everything. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

There ya go! [http://forums.massassi.net/html/wink.gif]

[This message has been edited by Descent_pilot (edited September 11, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-09-11, 7:50 AM #14
Quote:
<font face="Verdana, Arial" size="2">You guys C++ experts or something? I've been trying to learn it lately, and I find it easier than cog. I think my problem is that I cant figure out all JK's special verbs or something.</font>


No, you don't have to be a programming expert or know anything about other languages. But with time and practice, you will learn the fundamentals of programming - such as levels of abstraction, encapsulation, condition structuring, needed mathmatics, etc - no matter which language you use.

But if you know some C++, then you should find Cog easy to learn. If Cog is based on any language, it's C++.

First, Cog is obviously object-oriented. The Set and Get verbs used in Cog are very similar to OOP's accessor methods. The CreateThing() and DestroyThing() verbs are similar to constructors and destructors. The templates that JK uses are object classes. Ingame things are the objects to work with. So really, if you can understand C++, then you can understand Cog.

BTW, I'm a Delphi fan myself. [http://forums.massassi.net/html/smile.gif]

Thanks, Pilot. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited September 11, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-09-12, 12:32 AM #15
Kudos, GBK. I've been a bit out of the Cog Forum loop lately, but I must say, these cogs are looking excellent, and if you need a beta tester, just drop me a line at admin@gcwc.net.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!