[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 3.4 celstart

``celstart'` is a simple application that is designed to fire up a game that uses CEL. If you use this application then you can write games using XML or python scripts without having to write a single line of C++ code.

``celstart'` has a single argument which can be of the form:

- ``zip archive'` In this case the zip archive should contain a config file called ``celstart.cfg'`.
- ``real filesystem directory'` In this case the directory should also contain a config file called ``celstart.cfg'`.
- ``vfs directory'` Same as with the real directory. It should contain ``celstart.cfg'`
- ``real path to config file'` In this case the config file can have another name.
- ``vfs path to config file'` In this case the config file can have another name.

After starting ``celstart'` will first try to open the config and then it will give that config file to Crystal Space. So basically the config file is treated like a normal Crystal Space configuration file and thus can contain information about which plugins to load, the desired resolution, and many other options. In addition to that ``celstart'` will understand the following additional configuration options:

- ``CelStart.MapFile.<somename> = <filename>'` With this option you can let ``celstart'` load the given map file. It is possible to have multiple of these in the same configuration in which case ``celstart'` will try to load them all.
- ``CelStart.Entity.<name> = <name>'` This is a way to let celstart create an entity from the start. If this option is present then ``celstart'` will also try to find ``CelStart.EntityBehaviour.<name>'` and ``CelStart.EntityBehaviourLayer.<name>'`. With those two you can specify the name of the behaviour (and optionally the name of the behaviour layer, otherwise the default name is taken).
- ``CelStart.BehaviourLayer.<bhname> = <classid>'` This is a way to load additional behaviour layers. Note that by default XML scripts will automatically load their behaviour layer so it is not needed to add this if you use only XML behaviours.
- ``CelStart.ClearScreen = true'` If you have a 2D only XML game then it might be needed to force ``celstart'` into clearing the screen every frame since there will be no 3D camera that will do this.
- ``CelStart.ConfigDir.<somename> = <dirname>'` With this option you can let ``celstart'` load all config files from the specified vfs dir (specified relative to the celstart.cfg path). It is possible to have multiple of these in the same configuration in which case ``celstart'` will load from them all.

Here is an example config file:

    ; We always need a dummy name after CelStart.MapFile. Even if we have only one map file.
    CelStart.MapFile.a = data/maingame.xml
    CelStart.MapFile.b = data/screenmanager.xml
    ; Use 'iCelBlLayer' for the default behaviour layer. Use another name for the others.
    CelStart.BehaviourLayer.iCelBlLayer = cel.behaviourlayer.python
    CelStart.BehaviourLayer.blxml = cel.behaviourlayer.xml
    ; Create one entity.
    CelStart.Entity.start = start
    CelStart.EntityBehaviourLayer.start = blxml
    CelStart.EntityBehaviour.start = start_behaviour
    ; Load config files from the 'config' dir (under map vfs).
    CelStart.ConfigDir.Behaviours = config
    ; Some CS stuff.
    Video.ScreenWidth = 1024
    Video.ScreenHeight = 768
    System.Plugins.iGraphics3D = crystalspace.graphics3d.opengl
    System.Plugins.iEngine = crystalspace.engine.3d
    ...

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ]

This document was generated using texi2html 1.76.