2021-08-12 20:16:28 +01:00
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html >
< meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / >
< head >
2022-08-19 00:05:52 +01:00
< title > TombEngine 1.0.2 Lua API< / title >
2021-08-12 20:16:28 +01:00
< link rel = "stylesheet" href = "ldoc.css" type = "text/css" / >
< / head >
< body >
< div id = "container" >
< div id = "product" >
< div id = "product_logo" > < / div >
< div id = "product_name" > < big > < b > < / b > < / big > < / div >
< div id = "product_description" > < / div >
< / div > <!-- id="product" -->
< div id = "main" >
<!-- Menu -->
< div id = "navigation" >
< br / >
< h1 > TombEngine< / h1 >
2022-04-10 00:38:39 +01:00
< h2 > 1 Modules< / h2 >
2021-08-12 20:16:28 +01:00
< ul class = "nowrap" >
2022-07-11 22:35:30 +01:00
< li > < a href = "1 modules/Effects.html" > Effects< / a > < / li >
2022-04-10 00:38:39 +01:00
< li > < a href = "1 modules/Flow.html" > Flow< / a > < / li >
< li > < a href = "1 modules/Inventory.html" > Inventory< / a > < / li >
< li > < a href = "1 modules/Logic.html" > Logic< / a > < / li >
< li > < a href = "1 modules/Misc.html" > Misc< / a > < / li >
< li > < a href = "1 modules/Objects.html" > Objects< / a > < / li >
< li > < a href = "1 modules/Strings.html" > Strings< / a > < / li >
2021-08-12 20:16:28 +01:00
< / ul >
2022-04-10 00:38:39 +01:00
< h2 > 2 Classes< / h2 >
2021-08-12 20:16:28 +01:00
< ul class = "nowrap" >
2022-04-10 00:38:39 +01:00
< li > < a href = "2 classes/Flow.Animations.html" > Flow.Animations< / a > < / li >
< li > < a href = "2 classes/Flow.Fog.html" > Flow.Fog< / a > < / li >
< li > < a href = "2 classes/Flow.InventoryItem.html" > Flow.InventoryItem< / a > < / li >
< li > < a href = "2 classes/Flow.Level.html" > Flow.Level< / a > < / li >
< li > < a href = "2 classes/Flow.Mirror.html" > Flow.Mirror< / a > < / li >
< li > < a href = "2 classes/Flow.Settings.html" > Flow.Settings< / a > < / li >
< li > < a href = "2 classes/Flow.SkyLayer.html" > Flow.SkyLayer< / a > < / li >
< li > < a href = "2 classes/Objects.AIObject.html" > Objects.AIObject< / a > < / li >
< li > < a href = "2 classes/Objects.Camera.html" > Objects.Camera< / a > < / li >
< li > < a href = "2 classes/Objects.Moveable.html" > Objects.Moveable< / a > < / li >
< li > < a href = "2 classes/Objects.Sink.html" > Objects.Sink< / a > < / li >
< li > < a href = "2 classes/Objects.SoundSource.html" > Objects.SoundSource< / a > < / li >
< li > < a href = "2 classes/Objects.Static.html" > Objects.Static< / a > < / li >
< li > < a href = "2 classes/Strings.DisplayString.html" > Strings.DisplayString< / a > < / li >
2021-08-23 19:19:36 +01:00
< / ul >
2022-04-10 00:38:39 +01:00
< h2 > 3 Primitive Classes< / h2 >
2021-08-23 19:19:36 +01:00
< ul class = "nowrap" >
2022-04-10 00:38:39 +01:00
< li > < a href = "3 primitive classes/Color.html" > Color< / a > < / li >
< li > < a href = "3 primitive classes/Rotation.html" > Rotation< / a > < / li >
2022-04-18 17:53:06 +01:00
< li > < a href = "3 primitive classes/Vec3.html" > Vec3< / a > < / li >
2021-08-23 19:19:36 +01:00
< / ul >
2022-04-10 00:38:39 +01:00
< h2 > 4 Enums< / h2 >
2021-08-23 19:19:36 +01:00
< ul class = "nowrap" >
2022-07-31 20:39:07 +01:00
< li > < a href = "4 enums/Effects.BlendID.html" > Effects.BlendID< / a > < / li >
2022-04-10 00:38:39 +01:00
< li > < a href = "4 enums/Objects.ObjID.html" > Objects.ObjID< / a > < / li >
2021-08-12 20:16:28 +01:00
< / ul >
2022-07-29 21:12:54 +01:00
< h2 > 5 Lua utility modules< / h2 >
< ul class = "nowrap" >
2022-08-11 22:49:31 +01:00
< li > < a href = "5 lua utility modules/EventSequence.html" > EventSequence< / a > < / li >
2022-07-29 21:12:54 +01:00
< li > < a href = "5 lua utility modules/Timer.html" > Timer< / a > < / li >
< / ul >
2021-08-12 20:16:28 +01:00
< / div >
< div id = "content" >
2022-08-19 00:05:52 +01:00
< h2 > TombEngine 1.0.2 scripting interface< / h2 >
2022-08-14 20:35:23 +01:00
< p > Welcome to the TombEngine scripting API. This is a work in progress and some information might be wrong or outdated. Please also note that this is primarily a reference document, not a tutorial, so expect descriptions to be fairly sparse.< / p >
< p > At the time of writing, there is a tutorial describing the basics of Lua, as well as a number of example scripts, on the wiki < a href = "https://github.com/Stranger1992/Tomb-Engine-Demo-Levels/wiki" > here< / a > .< / p >
2022-05-13 14:31:04 +01:00
< h4 > Module Hierarchy (boring but important)< / h4 >
< p > Other than the "special tables" (GameVars, LevelVars and LevelFuncs), every module described herein is held in a master table called TEN.
2022-09-13 21:23:57 +01:00
For convenience, these modules and classes are automatically put in the global table. For example, you can call GetMoveableByName either of these two ways:< / p >
2022-05-13 14:31:04 +01:00
< pre > < code > local door = TEN.Objects.GetMoveableByName("door_type4_14")
2022-09-13 21:23:57 +01:00
local door = GetMoveableByName("door_type4_14")
2022-05-13 14:31:04 +01:00
< / code > < / pre >
2022-05-23 21:27:05 +01:00
< h4 > Always check logs/TENLog.txt< / h4 >
2022-08-08 23:31:09 +01:00
< p > If you are scripting levels, TombEngine will often kick you back to the title screen, even if < code > errorMode< / code > (see Flow.Settings) is set to < code > ErrorMode.WARN< / code > or < code > ErrorMode.SILENT< / code > .< / p >
2022-05-23 21:27:05 +01:00
< p > This might get annoying, but it's on purpose. If your Lua script contains a syntax error (e.g. you're missing < code > end< / code > at the end of a function), the Lua interpreter will not be able to continue running the script. If it tried to keep running, you'd probably see some pretty strange behaviour, and would possibly get a crash regardless.< / p >
< p > If this happens, check < strong > logs/TENLog.txt< / strong > and look for an error message with the word "unrecoverable".< / p >
2022-05-13 14:31:04 +01:00
< p > Enjoy.< / p >
< p > - < em > squidshire< / em > < / p >
2021-08-12 20:16:28 +01:00
2022-04-10 00:38:39 +01:00
< h2 > 1 Modules< / h2 >
2021-08-12 20:16:28 +01:00
< table class = "module_list" >
2022-07-11 22:35:30 +01:00
< tr >
< td class = "name" > < a href = "1 modules/Effects.html" > Effects< / a > < / td >
< td class = "summary" > Functions to generate effects.< / td >
< / tr >
2021-08-12 20:16:28 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "1 modules/Flow.html" > Flow< / a > < / td >
< td class = "summary" > Functions for use in Flow.lua, settings.lua and strings.lua< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "1 modules/Inventory.html" > Inventory< / a > < / td >
< td class = "summary" > Inventory manipulation< / td >
< / tr >
< tr >
< td class = "name" > < a href = "1 modules/Logic.html" > Logic< / a > < / td >
2022-05-13 14:31:04 +01:00
< td class = "summary" > Saving data, triggering functions, and callbacks for level-specific scripts.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "1 modules/Misc.html" > Misc< / a > < / td >
2022-05-23 21:27:05 +01:00
< td class = "summary" > Functions that don't fit in the other modules.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
2021-08-15 23:08:05 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "1 modules/Objects.html" > Objects< / a > < / td >
2022-05-23 21:27:05 +01:00
< td class = "summary" > Moveables, statics, cameras, and so on.< / td >
2022-04-10 00:38:39 +01:00
< / tr >
< tr >
< td class = "name" > < a href = "1 modules/Strings.html" > Strings< / a > < / td >
2022-05-13 14:34:57 +01:00
< td class = "summary" > On-screen strings.< / td >
2021-08-15 23:08:05 +01:00
< / tr >
2021-08-23 19:19:36 +01:00
< / table >
2022-04-10 00:38:39 +01:00
< h2 > 2 Classes< / h2 >
2021-08-23 19:19:36 +01:00
< table class = "module_list" >
2021-08-12 20:16:28 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.Animations.html" > Flow.Animations< / a > < / td >
< td class = "summary" > New custom animations which Lara can perform.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.Fog.html" > Flow.Fog< / a > < / td >
< td class = "summary" > Fog< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.InventoryItem.html" > Flow.InventoryItem< / a > < / td >
< td class = "summary" > Represents the properties of an object as it appears in the inventory.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.Level.html" > Flow.Level< / a > < / td >
< td class = "summary" > Stores level metadata.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.Mirror.html" > Flow.Mirror< / a > < / td >
< td class = "summary" > A mirror effect.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Flow.Settings.html" > Flow.Settings< / a > < / td >
< td class = "summary" > Settings that will be run on game startup.< / td >
< / tr >
< tr >
< td class = "name" > < a href = "2 classes/Flow.SkyLayer.html" > Flow.SkyLayer< / a > < / td >
< td class = "summary" > Describes a layer of moving clouds.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.AIObject.html" > Objects.AIObject< / a > < / td >
< td class = "summary" > AI object< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.Camera.html" > Objects.Camera< / a > < / td >
< td class = "summary" > Basic cameras that can point at Lara or at a CAMERA_TARGET.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.Moveable.html" > Objects.Moveable< / a > < / td >
< td class = "summary" > Represents any object inside the game world.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
2021-08-16 12:55:22 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.Sink.html" > Objects.Sink< / a > < / td >
< td class = "summary" > Sink< / td >
2021-08-16 12:55:22 +01:00
< / tr >
2021-08-12 20:16:28 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.SoundSource.html" > Objects.SoundSource< / a > < / td >
< td class = "summary" > Sound source< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "2 classes/Objects.Static.html" > Objects.Static< / a > < / td >
2022-05-13 14:31:04 +01:00
< td class = "summary" > Statics< / td >
2022-04-10 00:38:39 +01:00
< / tr >
< tr >
< td class = "name" > < a href = "2 classes/Strings.DisplayString.html" > Strings.DisplayString< / a > < / td >
< td class = "summary" > A string appearing on the screen.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
2021-08-23 19:19:36 +01:00
< / table >
2022-04-10 00:38:39 +01:00
< h2 > 3 Primitive Classes< / h2 >
2021-08-23 19:19:36 +01:00
< table class = "module_list" >
2021-08-12 20:16:28 +01:00
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "3 primitive classes/Color.html" > Color< / a > < / td >
2021-08-23 19:19:36 +01:00
< td class = "summary" > An RGBA or RGB color.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
< tr >
2022-04-10 00:38:39 +01:00
< td class = "name" > < a href = "3 primitive classes/Rotation.html" > Rotation< / a > < / td >
2021-08-23 19:19:36 +01:00
< td class = "summary" > Represents a rotation.< / td >
2021-08-12 20:16:28 +01:00
< / tr >
2022-04-18 17:53:06 +01:00
< tr >
< td class = "name" > < a href = "3 primitive classes/Vec3.html" > Vec3< / a > < / td >
< td class = "summary" > Represents a 3-dimensional vector.< / td >
< / tr >
2021-08-12 20:16:28 +01:00
< / table >
2022-04-10 00:38:39 +01:00
< h2 > 4 Enums< / h2 >
< table class = "module_list" >
2022-07-27 20:40:20 +01:00
< tr >
2022-07-31 20:39:07 +01:00
< td class = "name" > < a href = "4 enums/Effects.BlendID.html" > Effects.BlendID< / a > < / td >
2022-07-27 20:40:20 +01:00
< td class = "summary" > Constants for blend mode IDs.< / td >
< / tr >
2022-04-10 00:38:39 +01:00
< tr >
< td class = "name" > < a href = "4 enums/Objects.ObjID.html" > Objects.ObjID< / a > < / td >
< td class = "summary" > Constants for object IDs.< / td >
< / tr >
< / table >
2022-07-29 21:12:54 +01:00
< h2 > 5 Lua utility modules< / h2 >
< table class = "module_list" >
2022-08-11 22:49:31 +01:00
< tr >
< td class = "name" > < a href = "5 lua utility modules/EventSequence.html" > EventSequence< / a > < / td >
< td class = "summary" > Event sequence - a chain of functions to call at specified times, modeled after TRNG's organizers.< / td >
< / tr >
2022-07-29 21:12:54 +01:00
< tr >
< td class = "name" > < a href = "5 lua utility modules/Timer.html" > Timer< / a > < / td >
< td class = "summary" > Basic timer - after a specified number of seconds, the specified thing happens.< / td >
< / tr >
< / table >
2021-08-12 20:16:28 +01:00
< / div > <!-- id="content" -->
< / div > <!-- id="main" -->
< div id = "about" >
2022-08-08 23:31:09 +01:00
< i > generated by < a href = "http://github.com/stevedonovan/LDoc" > LDoc 1.4.6< / a > < / i >
2022-09-14 20:05:31 +01:00
< i style = "float:right;" > Last updated 2022-09-14 20:04:13 < / i >
2021-08-12 20:16:28 +01:00
< / div > <!-- id="about" -->
< / div > <!-- id="container" -->
< / body >
< / html >