FUNCTION

PARAMETERS

RETURN

INFO

GLOBAL VARIABLES MANAGEMENT

setGlobal(string unique_name, string value)

string unique_name : Global variable unique name
string value : Value of the variable



string value getGlobal(string unique_name)

string unique_name : Global variable unique name

string value : Current value of the global variable


deleteGlobal(string unique_name)

string unique_name : Global variable unique name



AMBIENT EFFECTS

int r, int g, int b getAmbientLight()


int r : Red value (0, 1, ..., 255)
int g : Green value (0, 1, ..., 255)
int b : Blue value (0, 1, ..., 255)

Usage sample:
r,g,b =
getAmbientLight()

int r, int g, int b getFogColor()


int r : Red value (0, 1, ..., 255)
int g : Green value (0, 1, ..., 255)
int b : Blue value (0, 1, ..., 255)

Usage sample:
r,g,b =
getFogColor()

float near, float far getFogRange()


float near : Current near fog value
float far : Current far fog value

Usage sample:
near, far =
getFogRange()

setAmbientLight(table color_name)

table color_name : check "colors.lua" at "media/scripts/" folder.


Usage sample:
setAmbientLight(LIGHT_BLUE)

setAmbientLight(int r, int g, int b)

int r : Red value (0, 1, ..., 255)
int g : Green value (0, 1, ..., 255)
int b : Blue value (0, 1, ..., 255)


Usage sample:
setAmbientLight(125,125,255)

setFogColor(table color_name)

table color_name : check "colors.lua" at "media/scripts/" folder.


Usage sample:
setFogColor(LIGHT_BLUE)

setFogRange(float near, float far)

float near : Fog nearest distance
float far : Fog farest distance


Usage sample:
setFogRange(1,8)

setFogColor(int r, int g, int b)

int r : Red value (0, 1, ..., 255)
int g : Green value (0, 1, ..., 255)
int b : Blue value (0, 1, ..., 255)


Usage sample:
setFogColor(125,125,255)

setTimeOfDay(int time)

int time : Day time (0, 1, ..., 24)


Usage sample:
setTimeOfDay(20)

MENU AND SCREEN MANAGEMENT

hideBlackScreen()



Usage sample:
hideBlackScreen()

showBlackScreen(string optional_text)

string optional_text : Optional text, it is drawed at the center of the black screen


Usage sample:
showBlackScreen("Loading...")

DYNAMIC OBJECTS AND CAMERA

float x, float y, float z getCameraTarget()


float x : Camera target position X
float y : Camera target position Y
float z : Camera target position Z

Usage sample:
x,y,z =
getCameraTarget()

float x, float y, float z getObjectPosition(dynamic_object object_name)

dynamic_object object_name : global name of a dynamic object

float x : Object position X
float y : Object position Y
float z : Object position Z

Usage sample:
x,y,z =
getObjectPosition("frog1")

float x, float y, float z getPosition()


float x : Current object position X
float y : Current object position Y
float z : Current object position Z

Usage sample:
x,y,z = getPosition()

setCameraTarget(dynamic_object object_name)


dynamic_object object_name : global name of a dynamic object

Usage sample:
setCameraTarget("frog1")

setCameraTarget(float x, float y, float z)

float x : Camera target position X
float y : Camera target position Y
float z : Camera target position Z


Usage sample:
setCameraTarget(10.5, 0.0, 12.2)

setPosition(float x, float y, float z)

float x : Current object position X
float y : Current object position Y
float z : Current object position Z


Usage sample:
setPosition(10.5, 0.0, 12.2)

SOUND FUNCTIONS

playSound2D(string sound_filename, bool looped)

string sound_filename : Sound file of "media/sound/" folder
bool looped : Play looped (true/false)


Usage sample:
playSound2D("frog_sound.ogg",false)

playSound3D(string sound_filename, bool looped, float x, float y, float z)

string sound_filename : Sound file from "media/sound/" folder
bool looped : Play looped (true/false)
float x : 3D sound position X
float y : 3D sound position Y
float z : 3D sound position Z


Usage sample:
playSound2D("frog_sound.ogg",false, 5.0, 1.0, 7.0)

setSoundListenerPosition(float x, float y, float z)

float x : 3D sound listener position X
float y : 3D sound listener position Y
float z : 3D sound listener position Z


Usage sample:
setSoundListenerPosition(5.0,1.0,7.0)

setSoundVolume(float volume)

float volume : Global sound volume - volume 0 (silent) to 1.0 (full volume)


Usage sample:
setSoundVolume
(0.7)

stopSounds()



Usage sample:
stopSounds()

PLAYER FUNCTIONS

addPlayerItem(string item_name)

string item_name : Name of the item to be added to player bag


Usage sample:
addPlayerItem("health_potion")

int total_items getItemCount()


int total_items : Total of items in player bag

Usage sample:
total_items = getItemCount()

float life getPlayerLife()


float life : Current player Life

Usage sample:
life = getPlayerLife()

removePlayerItem(string item_name)

string item_name : Name of the item to be removed from player bag


Usage sample:
removePlayerItem("health_potion")

setPlayerLife(float life)

float life : New player life value


Usage sample:
setPlayerLife(99)

DIALOG FUNCTIONS

showDialogMessage(string text, string sound_filename)

string text : Message text
string sound_filename : Message sound (recorded voice) from "media/sound/" folder


Usage sample:
showDialogMessage("Hello world!", "hello_world.ogg")

bool answer showDialogQuestion(string text, string sound_filename)

string text : Message text
string sound_filename : Message sound (recorded voice) from "media/sound/" folder

bool answer : True/False according to user choice

Usage sample:
answer = showDialogQuestion("Hello world!", "hello_world.ogg")