Version 1 (modified by landauf, 17 years ago) (diff) |
---|
Lua Orxonox Interface
This is an archived page! This page is very old and the content is not up to date. Not everything (if any) which is written here will be in the final game! |
Overview
The goal is to make orxonox scriptable, so that it's easier to let the player interract with the world of orxonox. As scrtipting language we use lua, which we handel through the standart Lua API.
Basicly there is one object, the scriptManager, who manages all the lua scripts, which are wrapped up in a class called Script. A script class contains everything that is needed to run a lua script. The scriptManager executes a script by using a object of type executor. The executor handels everything the script needs to run correctly. (Parameters, etc.)
Specific Description
Uml-Diagram: https://www.orxonox.net/attachment/wiki/archive/LuaInterface/Lua_uml02.png?format=raw
Dependencies
Lua depends on history.h and readline.h which mus be included externally. On Tardis they are in /usr/pack/readline-5.0-mo/include.
Todo
Look up how to acces to C++ objects (member functions) in a lua script and how to pass them to the script.
Roadmap
Mi, 26. April Design start
Mi, 03. May Design finished and implementation start (define classes, make orxonox work with lua)
Mi, 10. May Implementation
Do, 18. May Implementation
Do, 25. May Implementation
Do, 01. June Implementation
Do, 08. June Project freeze: debug and documentation
Do, 15. June Code finished, start creation of the demo world
Mi, 21. June content creation
Mi, 28. June Content finished: all models work, the world is playable
Mi, 05. July Convention and big show
Comments
The Idea is good, althought there are some things that should be made differently:
- Loading scripts must happen on load-time. Scripts will be Resources, that can be allocated in a fast fashion.
- Scriptable is a Object, that has a list Scripts, and those scripts each have a unique (per object) ID
- Calling a Function can then be reached with one of the following:
- execute with scriptname (resolve the script by name and execute)
- execute with ID (resolve the script by ID (i'th number of an Array (much faster (much much faster)))
- can one also handle parameters given to the function? what form are they?? (strings, ints, values, …)
- Give some examples, where we will need the scripting engine inside of the game, and probably some links to lua and stuff…
Links and further reading
Attachments (5)
- Lua_uml01.dia (1.9 KB) - added by landauf 17 years ago.
- Lua_uml.dia (1.6 KB) - added by landauf 17 years ago.
- Lua_uml.png (12.6 KB) - added by landauf 17 years ago.
- Lua_uml01.png (37.0 KB) - added by landauf 17 years ago.
- Lua_uml02.png (47.4 KB) - added by landauf 17 years ago.
Download all attachments as: .zip