Njam documentation |

Njam is a full-featured cross-platform pacman-like game written in C++ using SDL library | HOME >>

Level editor
NEW in version 1.05: You can change the order of levels by swapping them, read below for detailed explanation
Level editor enables anyone to modify the existing levels, and add new ones. Levels are grouped in levelsets, each having 20 levels. It is possible to have less than 20 levels in levelset, but not more.
There are two types of levelsets, which are used depending of the type of game. All levelsets are files placed in levels subdirectory of Njam instalation. If you wish to remove a levelset from the game, just delete its file. The files' extensions indicate levelset type:
.coop is used in cooperative games (both single and two-player games)
.duel is used in duel games (both local and networked).
Actually all filenames are uppercase (so be careful if your using case-sensitive OS like Linux).
During the network play only the hosting player needs to have levels installed (the player that joins the game gets all level data).
When level editor is started it creates one empty levelset. You can toggle the type (cooperative or duel) by pressing key K (stands for Kind of level). If you wish to modify some of already existing levelsets, select the load option (key L). If you have loaded some levelset and want to start a new one, just exit the level editor (ESC) and enter it again from the main menu.
Commands

- Load - gives you the menu to select levelset to load. The current levelset (in memory) is discarded without any warnings, so be careful.
- Save - save the current levelset. If you have previously loaded a levelset than it just saves it. Otherwise it asks for a filename. Also if you change the kind of levelset (duel/coop) then you will be prompted for a filename, since it cannot have the same file extension.
- Save As - save the current levelset, but first prompts for a filename.
- Kind - toggles the kind of levelset (type of game). Current kind is indicated by small blue text in the middle.

- Playable - toggles whether the level (on screen) is playable or not. When the game is loading levels it stops at first unplayable level, so all levels after first unplayable level are also considered unfinished.
- Undo - un-does all changes to current level (on screen). Not available after load/save and after testing the level.
- Clear - clears the current level.
- Test - tests the current level. If level is duel the powerups are added. Stop the testing by pressing ESC.
- sWap - to change order of levels you can swap any two levels. Press W to select current level for swapping, and then navigate to the other level (with X and Z) and press W again. Example: You wish to swap levels 3 and 7. Go to level 3, and press W, (SWAP:03 will show on screen), then go to level 7 and press W again. Thus the level 3 becomes level 7 and vice versa.
- previouZ - shows the previous level in levelset.
- neXt - shows the next level in levelset.

- Cursor arrows - move marker around the current level
- 0 - 9 - sets the tile under the marker (according to images in right-bottom part of screen)
- ESC - exit the level editor

When you're done editing, don't forget to mark all the levels you want to play playable. Then, just save the levelset and go back to main menu and start the game. The game detects when there is more than one levelset of that kind, and gives you the option to select the one you want to play.
All levelsets are plain files, you can copy/delete/rename freely. It's always a good idea to work on copies of files when modifying. Just enter the editor, load the leavelset and choose Save As option. In case you mess with original levels that come with the game and make something terribly wrong, you have backup copies in data subdirectory of your Njam instalation. The files are named original.coop and original.duel (both uppercase). Just copy these to levels subdirectory.
If you wish to copy/paste/etc levels from different levelsets (files), you can use scripts genCOOP and genDEF from contrib subdirectory of your Njam instalation. These are Perl scripts, contributed by Jalal A. Elhusseini. With these scripts you can convert Njam levelset files (.COOP and .DUEL files) into human readable form, which has .DEF extension. You can then edit .DEF files with any text editor (Notepad, vi, ...), copy/paste levels from different files, etc. When you're done editing, save the .DEF file, and convert it back to .COOP or .DUEL. The scripts only work with .COOP files, so if you wish to edit .DUEL files, you have to rename them to .COOP before doing conversion. After you're done with .DEF file, save it as .COOP and rename back to .DUEL.
When you make some nice levels be sure to send those to me at: mbabuskov@yahoo.com so I can include them in the game.

Copyright © Milan Babuskov 2003.
Contact me at: mbabuskov@yahoo.com