News Overview SceneEngine Downloads VideoTutorials Main Page SourceForge Get Involved Bookmark and Share

Lua > Getting started

Contents


The SceneEngine and GMT libraries are built for Lua 5.1.3. For convinience a copy of Lua 5.1.3 executable is provided.

Lua paths

The Lua tutorials in this wiki assume that you are running Lua from the SceneEngine folder, which has this basic layout:

SceneEngine
+ plugins
+ scenes
  + maps
+ scripts
+ system

So all scripts, scenes and bitmaps use paths relative to the SceneEngine folder. For example:

The scripts are called from the folder scripts:

dofile("scripts/do_all.lua")

The scenes are opened from the folder scenes:

sceng.OpenScene("scenes/dice.sceng")

The bitmaps are set saved to the scenes folder:

rp.output_file = "scenes/box_material_texture.tga"

Bitmap paths

When a sceng file is rendered, the bitmaps it uses are loaded from disk when needed.

The path of these bitmaps can be relative to the scene location:

bitmap_texture = sceng.BitmapTexture( { file_path="maps/flooring.bamboo.rough.jpg" } )

Or absolute to the system:

bitmap_texture = sceng.BitmapTexture( { file_path="c:/SceneEngine/scenes/maps/flooring.bamboo.rough.jpg" } )

Other paths can be registered in SceneEngine, so if the bitmap is not found in the scene path, then SceneEngine searches for it in the registered maps folders and loads them from the first folder where it is found.

Executing Lua

Open the folder SceneEngine (where the files lua5.1.exe, gmt.dll and sceng_base.dll are located) and double click lua5.1.exe.

start scripting or load a script using the command dofile().

Other Lua libraries

LuaForge hosts many other amazing Lua libraries that can help you getting your job done faster.

Views