Anywho, about seven hours later...
Weapon cog for the items.dat:
And the class cog for the canon template.
There still needs to be written an inventory system for the canon balls and a canonball template, but that's easy enough to add.
For these to work, place a canon thing in your level (add the templates to your .jkl). Activate the canon ingame, and class_canon will take over. It will detect the player's movement (though the player doesn't really go anywhere) and move the canon accordingly. When the player presses the jump key, class_canon will bring the player back and stop controlling the canon.
Weap_canon is a simple inventory cog that is used as a weapon for the canon. That way, the canon can be fired with the normal firing keys. The player's other weapons are temporarily taken away so the player can't try to select a different weapon.
Class_canon uses some of the code from my chase cam patch to create its external camera.
I'm posting this now, Hellcat, because Brad won't be back for a while, and you wanted the code. When I get the models for the canon and canonball, I'll write the other templates and cogs. It's kind of pointless to work too much on fine-tuning it now when I don't know what it's going to look like.
Questions, comments?
------------------
Author of the
JK DataMaster,
Parsec,
Scribe, and the
EditPlus Cog Files.