Current revision

Contents

Using bug plug

The bug plug is a great feature in CS, to easily debug and tweak your 3d world. You can use it, like any other plugin. Just load and register it.

First start walktest for this example, because the castle map will be perfect for this lesson. When walktest has loaded completly, type into the walktest console:

bugplug

This will load the bug plugin.

If you want to use bug plug in your own applications you can use -plugin=bugplug on the commandline.

How it works

The bug plug is in action, when you can see the current fps (frames per second) on the lower left side of screen:

But, bug plug can do more than just displaying the actual framerate.
Press the ctrl+D keys, to see this message:

Now push ‘e’ key on your keyboard, to switch to the wireframe mode:

So the bug plug shows you the wireframe of the rendered meshes. Nice.

At any time, you can take a screenshot with the key combinations: ctrl+D, and F11. The bug plug saves the screenshot in png format into your CS directory (by default, this can be changed) . The first image will be named crystalspace000.png, then crystalspace001.png and so on. The plugin handles the correct numbering automatically, so be not afraid, you never overwrite your previously saved screenshots. When you need a really high resolution screenshot (an “überscreenshot”), press ctrl+D then shift+F11. It will make a 2048*1536 screenshot, I hope, this will satisfy your needs.

Working with meshes

When you press ctrl+s, you can select meshes with mouse click. Just try it now. Press ctrls+s, and click on a simphatic mesh. The result will be something like this:

You can select any mesh in the loaded map file.
The following example uses the castle map. Run walktest, then do the following:

Go to the table in the castle level:

Now press ctrl+s, and click on the table. The result should look like this:

Now we can move this mesh with some bug plug key. Press ctrl+D, then shift+Page up keys. The mesh will move 1 unit in Z direction (Z coordinate will be increased by one unit).

The Bugplug.Capture.FilenameFormat key gives the format of the screenshot picture names. When you add the scrshot000.png format, the bug plug will save your screenshots with this naming form (scrshot000,png, scrshot001.png) . The Bugplug.Capture.Image.MIME = image/png key stores the format of the screenshots. You can change it to any image format, that Crystal Space can handle (jpg, tga, bmp, etc).

The second config file has the name bugplug.key. It is a simple text file, which has this (default) content: