Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of ScriptableController


Ignore:
Timestamp:
Dec 14, 2017, 4:52:12 PM (6 years ago)
Author:
kohlia
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • ScriptableController

    v1 v2  
    33With the ScriptableController you can easily make scripts to control various things in orxonox and react to certain events. To do that, add a script to your level:
    44
    5 {{{ <Level script="scripts/myLevelScript.lua ...> ... </Level> }}}
     5{{{ <Level script="scripts/myLevelScript.lua" ...> ... </Level> }}}
    66
    77The script has to be written in lua and will be executed as soon as the player spawns. The path to the script is relative to {{{data/levels}}} and you preferably put your scripts in the {{{scripts}}} folder with the same name as your level. You can find a list of all functions that are available in lua in the documentation of {{{ScriptableControllerAPI}}} in {{{src/orxonox/scriptablecontroller/scriptable_controller_api.h}}}. If you call a function, make sure it has the correct number of arguments, there are no optional arguments at the moment! Also keep the type of the arguments in mind, if the function expects a string, pass it a string and not a number.