mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-01 09:18:00 +03:00
676 lines
17 KiB
HTML
676 lines
17 KiB
HTML
<!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>
|
|
<title>TombEngine 1.0.9 Lua API</title>
|
|
<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>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>1 Modules</h2>
|
|
<ul class="nowrap">
|
|
<li> <a href="../1 modules/Effects.html">Effects</a></li>
|
|
<li> <here>Flow</here></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>
|
|
</ul>
|
|
<h2>2 Classes</h2>
|
|
<ul class="nowrap">
|
|
<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.LaraObject.html">Objects.LaraObject</a></li>
|
|
<li> <a href="../2 classes/Objects.Moveable.html">Objects.Moveable</a></li>
|
|
<li> <a href="../2 classes/Objects.Room.html">Objects.Room</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/Objects.Volume.html">Objects.Volume</a></li>
|
|
<li> <a href="../2 classes/Strings.DisplayString.html">Strings.DisplayString</a></li>
|
|
</ul>
|
|
<h2>3 Primitive Classes</h2>
|
|
<ul class="nowrap">
|
|
<li> <a href="../3 primitive classes/Color.html">Color</a></li>
|
|
<li> <a href="../3 primitive classes/Rotation.html">Rotation</a></li>
|
|
<li> <a href="../3 primitive classes/Vec2.html">Vec2</a></li>
|
|
<li> <a href="../3 primitive classes/Vec3.html">Vec3</a></li>
|
|
</ul>
|
|
<h2>4 Enums</h2>
|
|
<ul class="nowrap">
|
|
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
|
|
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
|
|
<li> <a href="../4 enums/Misc.ActionID.html">Misc.ActionID</a></li>
|
|
<li> <a href="../4 enums/Misc.CameraType.html">Misc.CameraType</a></li>
|
|
<li> <a href="../4 enums/Misc.LogLevel.html">Misc.LogLevel</a></li>
|
|
<li> <a href="../4 enums/Objects.ObjID.html">Objects.ObjID</a></li>
|
|
<li> <a href="../4 enums/Objects.RoomFlagID.html">Objects.RoomFlagID</a></li>
|
|
<li> <a href="../4 enums/Objects.RoomReverb.html">Objects.RoomReverb</a></li>
|
|
</ul>
|
|
<h2>5 Lua utility modules</h2>
|
|
<ul class="nowrap">
|
|
<li> <a href="../5 lua utility modules/EventSequence.html">EventSequence</a></li>
|
|
<li> <a href="../5 lua utility modules/Timer.html">Timer</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Table <code>Flow</code></h1>
|
|
<p>Functions that (mostly) don't directly impact in-game mechanics.</p>
|
|
<p> Used for setup
|
|
in gameflow.lua, settings.lua and strings.lua; some can be used in level
|
|
scripts too.</p>
|
|
|
|
|
|
<h2><a href="#gameflow_lua">gameflow.lua </a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" ><a href="#AddLevel">AddLevel(level)</a></td>
|
|
<td class="summary">Add a level to the Flow.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetIntroImagePath">SetIntroImagePath(path)</a></td>
|
|
<td class="summary">Image to show when loading the game.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetTitleScreenImagePath">SetTitleScreenImagePath(path)</a></td>
|
|
<td class="summary">Image to show in the background of the title screen.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#EnableLaraInTitle">EnableLaraInTitle(enabled)</a></td>
|
|
<td class="summary">Enable or disable Lara drawing in title flyby.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#EnableLevelSelect">EnableLevelSelect(enabled)</a></td>
|
|
<td class="summary">Enable or disable level selection in title flyby.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#gameflow_lua_or_level_scripts">gameflow.lua or level scripts </a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" ><a href="#EnableFlyCheat">EnableFlyCheat(enabled)</a></td>
|
|
<td class="summary">Enable or disable DOZY mode (fly cheat).</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#EnableMassPickup">EnableMassPickup(enabled)</a></td>
|
|
<td class="summary">Enable or disable mass pickup.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetLevel">GetLevel(index)</a></td>
|
|
<td class="summary">Returns the level by index.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetCurrentLevel">GetCurrentLevel()</a></td>
|
|
<td class="summary">Returns the level that the game control is running in that moment.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#EndLevel">EndLevel([index])</a></td>
|
|
<td class="summary">Finishes the current level, with optional level index provided.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetSecretCount">GetSecretCount()</a></td>
|
|
<td class="summary">Returns the player's current per-game secret count.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetSecretCount">SetSecretCount(count)</a></td>
|
|
<td class="summary">Sets the player's current per-game secret count.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#AddSecret">AddSecret(index)</a></td>
|
|
<td class="summary">Adds one secret to current level secret count and also plays secret music track.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetTotalSecretCount">SetTotalSecretCount(total)</a></td>
|
|
<td class="summary">Total number of secrets in game.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#settings_lua">settings.lua </a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" ><a href="#SetSettings">SetSettings(settings)</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetAnimations">SetAnimations(animations)</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#strings_lua">strings.lua </a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" ><a href="#SetStrings">SetStrings(table)</a></td>
|
|
<td class="summary">Set string variable keys and their translations.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetString">GetString(string)</a></td>
|
|
<td class="summary">Get translated string</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetLanguageNames">SetLanguageNames(table)</a></td>
|
|
<td class="summary">Set language names for translations.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header has-description"><a name="gameflow_lua"></a>gameflow.lua </h2>
|
|
|
|
<div class="section-description">
|
|
These functions are called in gameflow.lua, a file loosely equivalent to winroomedit's SCRIPT.DAT.
|
|
They handle a game's 'metadata'; i.e., things such as level titles, loading screen paths, and default
|
|
ambient tracks.
|
|
</div>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "AddLevel"></a>
|
|
<strong>AddLevel(level)</strong>
|
|
</dt>
|
|
<dd>
|
|
Add a level to the Flow.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">level</span>
|
|
<span class="types"><a class="type" href="../2 classes/Flow.Level.html#">Level</a></span>
|
|
a level object
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetIntroImagePath"></a>
|
|
<strong>SetIntroImagePath(path)</strong>
|
|
</dt>
|
|
<dd>
|
|
Image to show when loading the game.
|
|
Must be a .jpg or .png image.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">path</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
the path to the image, relative to the TombEngine exe
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetTitleScreenImagePath"></a>
|
|
<strong>SetTitleScreenImagePath(path)</strong>
|
|
</dt>
|
|
<dd>
|
|
Image to show in the background of the title screen.
|
|
Must be a .jpg or .png image.
|
|
<strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">path</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
the path to the image, relative to the TombEngine exe
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "EnableLaraInTitle"></a>
|
|
<strong>EnableLaraInTitle(enabled)</strong>
|
|
</dt>
|
|
<dd>
|
|
Enable or disable Lara drawing in title flyby.
|
|
Must be true or false
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">enabled</span>
|
|
<span class="types"><span class="type">bool</span></span>
|
|
true or false
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "EnableLevelSelect"></a>
|
|
<strong>EnableLevelSelect(enabled)</strong>
|
|
</dt>
|
|
<dd>
|
|
Enable or disable level selection in title flyby.
|
|
Must be true or false
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">enabled</span>
|
|
<span class="types"><span class="type">bool</span></span>
|
|
true or false
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header "><a name="gameflow_lua_or_level_scripts"></a>gameflow.lua or level scripts </h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "EnableFlyCheat"></a>
|
|
<strong>EnableFlyCheat(enabled)</strong>
|
|
</dt>
|
|
<dd>
|
|
Enable or disable DOZY mode (fly cheat).
|
|
Must be true or false
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">enabled</span>
|
|
<span class="types"><span class="type">bool</span></span>
|
|
true or false
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "EnableMassPickup"></a>
|
|
<strong>EnableMassPickup(enabled)</strong>
|
|
</dt>
|
|
<dd>
|
|
Enable or disable mass pickup.
|
|
Must be true or false
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">enabled</span>
|
|
<span class="types"><span class="type">bool</span></span>
|
|
true or false
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetLevel"></a>
|
|
<strong>GetLevel(index)</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns the level by index.
|
|
Indices depend on the order in which AddLevel was called; the first added will
|
|
have an ID of 0, the second an ID of 1, and so on.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">index</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
of the level
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="../2 classes/Flow.Level.html#">Level</a></span>
|
|
the level indicated by the id
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetCurrentLevel"></a>
|
|
<strong>GetCurrentLevel()</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns the level that the game control is running in that moment.
|
|
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="../2 classes/Flow.Level.html#">Level</a></span>
|
|
the current level
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "EndLevel"></a>
|
|
<strong>EndLevel([index])</strong>
|
|
</dt>
|
|
<dd>
|
|
Finishes the current level, with optional level index provided. If level index
|
|
is not provided or is zero, jumps to next level. If level index is more than
|
|
level count, jumps to title.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">index</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
level index (default 0)
|
|
(<em>optional</em>)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetSecretCount"></a>
|
|
<strong>GetSecretCount()</strong>
|
|
</dt>
|
|
<dd>
|
|
Returns the player's current per-game secret count.
|
|
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">int</span></span>
|
|
Current game secret count.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetSecretCount"></a>
|
|
<strong>SetSecretCount(count)</strong>
|
|
</dt>
|
|
<dd>
|
|
Sets the player's current per-game secret count.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">count</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
new secret count.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "AddSecret"></a>
|
|
<strong>AddSecret(index)</strong>
|
|
</dt>
|
|
<dd>
|
|
Adds one secret to current level secret count and also plays secret music track.
|
|
The index argument corresponds to the secret's unique ID, the same that would go in a secret trigger's Param.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">index</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
an index of current level's secret (must be from 0 to 31).
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetTotalSecretCount"></a>
|
|
<strong>SetTotalSecretCount(total)</strong>
|
|
</dt>
|
|
<dd>
|
|
Total number of secrets in game.
|
|
Must be an integer value (0 means no secrets).
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">total</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
number of secrets
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header has-description"><a name="settings_lua"></a>settings.lua </h2>
|
|
|
|
<div class="section-description">
|
|
These functions are called in settings.lua, a file which holds your local settings.
|
|
settings.lua shouldn't be bundled with any finished levels/games.
|
|
</div>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "SetSettings"></a>
|
|
<strong>SetSettings(settings)</strong>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">settings</span>
|
|
<span class="types"><a class="type" href="../2 classes/Flow.Settings.html#">Settings</a></span>
|
|
a settings object
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetAnimations"></a>
|
|
<strong>SetAnimations(animations)</strong>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">animations</span>
|
|
<span class="types"><a class="type" href="../2 classes/Flow.Animations.html#">Animations</a></span>
|
|
an animations object
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2 class="section-header has-description"><a name="strings_lua"></a>strings.lua </h2>
|
|
|
|
<div class="section-description">
|
|
|
|
These functions used in strings.lua, which is generated by TombIDE.
|
|
You will not need to call them manually.
|
|
</div>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "SetStrings"></a>
|
|
<strong>SetStrings(table)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set string variable keys and their translations.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">table</span>
|
|
<span class="types"><span class="type">tab</span></span>
|
|
array-style table with strings
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetString"></a>
|
|
<strong>GetString(string)</strong>
|
|
</dt>
|
|
<dd>
|
|
Get translated string
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">string</span>
|
|
<span class="types"><span class="type">key</span></span>
|
|
key for translated string
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetLanguageNames"></a>
|
|
<strong>SetLanguageNames(table)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set language names for translations.
|
|
Specify which translations in the strings table correspond to which languages.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">table</span>
|
|
<span class="types"><span class="type">tab</span></span>
|
|
array-style table with language names
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
</div> <!-- id="main" -->
|
|
<div id="about">
|
|
<i>generated by <a href="https://github.com/hispidence/TEN-LDoc">TEN-LDoc</a> (a fork of <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a>)</i>
|
|
<i style="float:right;">Last updated 2023-06-03 11:42:57 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|