global functions

on_engine_start

function on_engine_start ()
  -- do something here
end
This function will be called once the core-engine has finished loading; if it is empty, the engine will just sit there doing nothing.
Whatever you want to do, do it here!

set_next_mapfile

set_next_mapfile("map_file")
That file will be loaded when you activate MapView GameState.
See: state_manager.activate

sub-system functions

audiomanager

Making noise -- or not.

setAmbientSound

audiomanager.setAmbientSound("music_filename")

setVolume

audiomanager.setVolume(1.0) -- 0.0 (silent) to 1.0 (loud)

guimanager

The central part of the GUI; all widgets defined in Lua must be added/removed here. Furthermore access to the ingame-console (default: F10 key).

add

guimanager.add(any_widget)

console_clear

guimanager.console_clear()

console_hide

console_println

guimanager.console_println("only strings please")

console_show

moveToBottom

guimanager.moveToBottom(added_widget)

moveToTop

guimanager.moveToTop(added_widget)

remove

guimanager.remove(added_widget)

inputmanager

mapKeyToEventId

inputmanager.mapKeyToEventId("map_view", SDLK_UP, GO_NORTH)
See: scripts/bindings.lua & scripts/keyboard_consts.lua

mapview

Modifies variables concerned with displaying the map; make sure MapView is active when you call these functions.

getCurrentElevation

displayed_elevation_number = mapview.getCurrentElevation()

getElevationCount

num_elevations_in_map = mapview.getElevationCount()

getFloorVisible

is_floor_visible = mapview.getFloorVisible()

getObjectsVisible

getRoofAlpha

getRootTransparent

getRoofVisible

getXPos

display_x_pos = mapview.getXPos()

getYPos

setCurrentElevation

mapview.setCurrentElevation(0)

setFloorVisible

mapview.setFloorVisible(false)

setObjectsVisible

setRoofAlpha

setRoofTransparent

setRoofVisible

setXPos

mapview.setXPos(10)

setYPos

mapview.setYPos(5)

state_manager

Handle the GameStates (by name); any number can be active at a time, at least one should be.

activate

state_manager.activate("MapView")

deactivate

state_manager.deactivate("MapView")

exists

does_stateX_exist = state_manager.exists("MapView")
Return value type: boolean

isActive

is_stateX_active = state_manager.isActive("MapView")
Return value type: boolean