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 → Ok, another quick question
Ok, another quick question
2004-04-13, 6:41 PM #1
I probably should've combined this with the vector topic I posted 3 days ago, but too late now [http://forums.massassi.net/html/rolleyes.gif].
Anyhoo, I was reading the tutorials in the Datamaster just after 061 was released, and I found something I had never heard before concerning templates and cogs.

Quote:
<font face="Verdana, Arial" size="2">From the DM tutorials, Chapter 2 - Writing Cogs:

... Let's go ahead and create our weapon template. Open up the static.jkl and paste this text at the end:

Section: templates
World templates 2

_base none orient=(0/0/0) type=weapon collide=1 move=physics thingflags=0x400 timer=10 mass=5
+grapple _base model3d=mana1.3do vel=(0/8/0) cog=class_grapple.cog typeflags=0x180

end

The first template in a jkl must be a base template because JK doesn't allow cogs to use the first template - the reason is unclear. So we'll make the first template a base for our +grapple template. When JK loads these templates, weap_bryar will be able to create grappling hooks in the game from them. For us, the most important part of this template is its class cog (class_grapple.cog) - which we'll write shortly. Now go up to the cogscripts section and add an entry for class_grapple.cog.

Section: cogscripts
World scripts 51
0: class_grapple.cog
end


Remember to up both the cogscripts and cogs counts. Now we're ready to start writing the cog that will do all of the work...
</font>


Now, is the italics part about adding the cog in the cogscripts section actually necessary? It seems to work exactly the same w/o doing that. And if it IS necessary, please explain why.

Thanks.

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-04-14, 4:43 PM #2
I think it might have something to do with crashing saves.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-04-17, 8:39 PM #3
*bump*
No other comments?

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-04-18, 1:39 AM #4
I have no idea, but did you ever experience the problem that some mods simply don't work in certain levels? Might have something to do with that?

------------------
"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)
2004-04-18, 8:49 AM #5
Yeah, my first crosshair attempt didn't work in specific levels (3, 4, 6, ... ,17 , few more). It wouldn't let me unzoom and it didn't fire the crosshairs in those levels (in all others it did). I moved hte code to my weapon cog instead and it worked all the time. It confused me but it hasn't happened since (except in my reloading ai cog -- I'm starting over though).

Anyway, I'm still wondering if the cog scripts section needs to be updated with each cog and if so, why.

I just saved the default Jed project to a jkl and apparently Jed does the same thing for soundclasses, puppets, etc. Maybe it's just a resource list so JK loads them in advance? I dunno... but someone else might.

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-04-20, 9:39 AM #6
Look at an LEC JKL and you'll see that every cog that is "placed" in the level is also in the cogscripts section. Here's the reason:

The cogscripts section lists all cogs that JK will load for the level. The cogs section is supposed to pass arguments to the cogs once they have been loaded. This why a JKL cog should be added to both sections.

To answer your question, though, you don't absolutely have to do it that way. As long as you up the counts, JK will allot memory for your cog, and it will be loaded as soon as JK finds an entry for it (in most cases).

Now as for upping both world counts when you're just adding a template cog: this is something LEC does - if you look at their jkl files, you'll see that the world cog number is always higher than the world scripts number. It doesn't really seem to be consistent though, and in my experience, as long as the cogs count is above the scripts count, everything works fine. The discrepancies in LEC .jkls may be something LEIA does.

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

[This message has been edited by SaberMaster (edited April 20, 2004).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2004-04-20, 4:09 PM #7
Thanks SaberMaster. That helped a lot. [http://forums.massassi.net/html/smile.gif]

(yay! SM came to visit [http://forums.massassi.net/html/biggrin.gif] )

------------------
Bond, Power, CA, The Force, Saber, IC, Epic, Oily Mexican Food, BG, /\ |> /\ /\/\, Sentences.
Now you know where I've been.
May the mass times acceleration be with you.
2004-04-22, 5:12 PM #8
*bows*

Glad to help. [http://forums.massassi.net/html/wink.gif]

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

↑ Up to the top!