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

4.4.3 XML Scripts Addon

The ‘cel.addons.xmlscripts’ addon is specifically made for the XML behaviour layer (see section The XML Behaviour Layer) and gives you the option to define XML scripts directly in a world file. Here is an example:

<addon plugin="cel.addons.xmlscripts">

    <script name="chair_clicker">
        <event name="init">
            <var name="counter" value="0" />
        <event name="pcbillboard_select">
            <var name="counter" value="?counter+1" />
            <if eval="?counter < 10">
                   <print value="'You clicked '+?counter+' times.'" />
                    <print value="'It is time you stopped clicking!'" />

    <script name="chair_mover">
        <event name="pctimer_wakeup">
            <bb_move x="rand(1)*250000" y="rand(1)*250000" delta="500" />

This addon allows you to do two things: first you can load a property class factory with the ‘pcfactory’ operation. Secondly you can create scripts (corresponding with behaviours) for the XML behaviour layer.

This document was generated using texi2html 1.76.