Prospero's pages

Updated July 21, 2005



I thought I would start this topic to answer scripting questions and do mini tutorials on various Python stuff for the benefit of mappers.
(This is just how I do things, and I don't know everything by any means.)

Tut1. Starting...

OK, you have made a map, compiled and loaded it and your Player char is stood alone wondering how to fill this new world with interesting stuff.

All the gameplay flow is controlled from a file:

Create a file with this exact name and save it to your map folder in

This file is one of the Key files that is executed again when loading a saved game. For that reason it must always have this name. All your other
.py files that create objs, etc are only executed on first load.

In a basic map you will have three essential files: # initiates the map and loads all the files # creates the Player character
MyMap.lvl # loads all the texture files + dome (sky) and .bw (compiled 'Blade World' file)

*I will use the term MyMap to refer to the name of your map folder.(case sensitive)

The BODLoader will create these files automatically if they don't exist in the
BODLoader/Maps/MyMap folder. NEVER edit your files in the main Maps folder. ALWAYS edit in the BODLoader and unistall/install your map to test it. If you don't stick to this practice you risk hours of work being overwritten by older files.
(Yes, I have done this more than a few times.)

Next, open the file and add this line at the end:


All the files you create will be executed from here, but keep at the top of the list.

Now open

There is nothing to add yet, but for a start you can add the code to enable the savegame.

First add this:

import GameText

You will need lots of imports as you proceed, but at the mo you only need this one. An import statement allows you to access to all the code in the imported file from the file it is imported to. If you try to do this for example:


without importing the file, you will cause an error. Python reads code from the top of a file down, so put you imports before you use their code. (usually they are all at the top of the file.)

Underneath this import add:

GameText.MapList["MYMAP"] = ["MyMap"]
First box is a CAPITALIZED version of your map name.

Save and load your map (remember to uninst/inst). If all is well, your map will appear in the save menu screen. Try saving/loading the map. You should have no probs at this point as there is nothing else in the map to foul things up. Making the save games reliable can get very tricky as you add more things.....

Try the F1 key. This code also enables the Travel Book.