Running Cogs


A Cog must be listed in a JKL or items.dat file to be recognized by Jedi Knight. If the cog is listed in the items.dat or the static.jkl, its symbols section will only be loaded once and the cog's variables will not be reset with every level that is loaded. With the level's JKL, the symbols section will be reloaded and variables that are assigned an initial value will have that value reassigned.


Items Cogs

To list a cog in the items.dat, create a new bin and assign a cog to it. For example:
cogBin     116     0   0   0x000   cog=yourCog.cog
The bin doesn't have to have anything special for the cog to be recognized.

JKL Cogs

There are two types of JKLs that you can list a cog in. The level's .jkl and the static.jkl. The static.jkl is a special JKL that is loaded for all levels. Cogs are normally added to both the Cog Placement and Cog Script sections of a JKL, but the Cog Placement section is the important one. Listing the cog there will make the exe run the messages of the cog. Here's the unmodified Cog Placement section from the static.jkl:
######### COG placement ########
Section: cogs
World cogs 50
end
############################
And if a cog is added:
######### COG placement ########
Section: cogs
World cogs 51
0: yourCog.cog
end
############################
The World Cog limit was incremented and the cog that needs to be recognized was added to the list. If this JKL is a level JKL and not the static.jkl, values listed after the cog in the World Cog list will be assigned to corresponding variables in the cog's symbols section. Read the Symbols General document for more on that.