From 751b955dcf95914bf8a79578fc48ca039fc0eeb1 Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sun, 14 Aug 2011 03:44:21 -0700 Subject: [PATCH] list available functions --- doc/script-apis.txt | 29 --------- doc/script-functions.txt | 162 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 29 deletions(-) delete mode 100644 doc/script-apis.txt create mode 100644 doc/script-functions.txt diff --git a/doc/script-apis.txt b/doc/script-apis.txt deleted file mode 100644 index 5dd2789..0000000 --- a/doc/script-apis.txt +++ /dev/null @@ -1,29 +0,0 @@ -ENGINE-PROVIDED SCRIPT APIS - - -All scripts have: - - - Sound API - - -preMove, postMove, tile onEnter, and tile onLeave scripts have: - - - an Entity object - - - -OBJECTS INTERFACES - - -Sound API is: - - - Sound:play(string filename) - - -Entity object is: - - - entity.x - - entity.y - - entity:gotoRandomTile() - - diff --git a/doc/script-functions.txt b/doc/script-functions.txt new file mode 100644 index 0000000..1e6efa7 --- /dev/null +++ b/doc/script-functions.txt @@ -0,0 +1,162 @@ +ENGINE-PROVIDED SCRIPT FUNCTIONS + + + All scripts have: + + standard Lua functions + Sound functions + + + entity preMove, entity postMove, tile onEnter, and tile onLeave scripts + have: + + an Entity object + + + + +TSUNAGARI FUNCTIONS + + Scripts need to be able to interface with and manipulate the game world. + Tsunagari provides access to several aspects of your world. + + + the Sound functions are: + + Sound:play(filename) + + + an Entity object is: + + entity.x + entity.y + entity:gotoRandomTile() + + + + +STANDARD LUA FUNCTIONS + + Lua comes with a library of functions that make it useful as a language. + Tsunagari includes most, but not all of these. In particular, there is no + support for coroutines, modules, loading external code, using raw get/set + functions, manipulating the garbage collector, exiting, running external + programs, or manipulating external files. + + You can find complete documentation for these functions here: + http://www.lua.org/manual/5.1/manual.html#5 + + + Basic Functions + assert() + error() + getfenv() + getmetatable() + ipairs() + next() + pairs() + pcall() + print() + select() + setfenv() + setmetatable() + tonumber() + tostring() + type() + unpack() + xpcall() + + String Manipulation + string:byte() + string:char() + string:dump() + string:find() + string:format() + string:gmatch() + string:gsub() + string:len() + string:lower() + string:match() + string:rep() + string:reverse() + string:sub() + string:upper() + + Table Manipulation + table:concat() + table:foreach() + table:foreachi() + table:getn() + table:maxn() + table:insert() + table:remove() + table:sort() + + Mathematical Functions + math.abs() + math.acos() + math.asin() + math.atan2() + math.atan() + math.ceil() + math.cosh() + math.cos() + math.deg() + math.exp() + math.floor() + math.fmod() + math.frexp() + math.ldexp() + math.log10() + math.log() + math.max() + math.min() + math.modf() + math.pow() + math.rad() + math.random() + math.randomseed() + math.sinh() + math.sin() + math.sqrt() + math.tanh() + math.tan() + + Input and Output Facilities + io.flush() + io.input() + io.output() + io.read() + io.type() + io.write() + + file:close() + file:flush() + file:lines() + file:read() + file:seek() + file:setvbuf() + file:write() + + Operating System Facilities + os.clock() + os.date() + os.difftime() + os.time() + + The Debug Library + debug.debug() + debug.getfenv() + debug.gethook() + debug.getinfo() + debug.getlocal() + debug.getregistry() + debug.getmetatable() + debug.getupvalue() + debug.setfenv() + debug.sethook() + debug.setlocal() + debug.setmetatable() + debug.setupvalue() + debug.traceback() + -- 2.11.4.GIT