2021-08-23 19:19:36 +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>
|
2021-08-23 20:16:01 +01:00
|
|
|
<title>TombEngine Lua API</title>
|
2021-08-23 19:19:36 +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>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li><a href="../index.html">Index</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<h2>Contents</h2>
|
|
|
|
<ul>
|
|
|
|
<li><a href="#Members">Members</a></li>
|
|
|
|
<li><a href="#Functions">Functions</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
<h2>Pre-game script classes</h2>
|
|
|
|
<ul class="nowrap">
|
|
|
|
<li><a href="../pre-game script classes/AudioTrack.html">AudioTrack</a></li>
|
|
|
|
<li><a href="../pre-game script classes/InventoryObject.html">InventoryObject</a></li>
|
|
|
|
<li><strong>Level</strong></li>
|
|
|
|
<li><a href="../pre-game script classes/Mirror.html">Mirror</a></li>
|
|
|
|
<li><a href="../pre-game script classes/Settings.html">Settings</a></li>
|
|
|
|
<li><a href="../pre-game script classes/SkyLayer.html">SkyLayer</a></li>
|
|
|
|
</ul>
|
|
|
|
<h2>Script Files</h2>
|
|
|
|
<ul class="nowrap">
|
|
|
|
<li><a href="../script files/Pre-game.html">Pre-game scripts</a></li>
|
|
|
|
<li><a href="../script files/Level-specific.html">Level-specific scripts</a></li>
|
|
|
|
</ul>
|
|
|
|
<h2>Enums</h2>
|
|
|
|
<ul class="nowrap">
|
|
|
|
<li><a href="../enums/InvItem.html">InvItem</a></li>
|
|
|
|
<li><a href="../enums/ObjID.html">ObjID</a></li>
|
|
|
|
</ul>
|
|
|
|
<h2>Entity classes</h2>
|
|
|
|
<ul class="nowrap">
|
|
|
|
<li><a href="../entity classes/AIObject.html">AIObject</a></li>
|
|
|
|
<li><a href="../entity classes/CameraInfo.html">CameraInfo</a></li>
|
|
|
|
<li><a href="../entity classes/ItemInfo.html">ItemInfo</a></li>
|
|
|
|
<li><a href="../entity classes/MeshInfo.html">MeshInfo</a></li>
|
|
|
|
<li><a href="../entity classes/SinkInfo.html">SinkInfo</a></li>
|
|
|
|
<li><a href="../entity classes/SoundSourceInfo.html">SoundSourceInfo</a></li>
|
|
|
|
</ul>
|
|
|
|
<h2>Misc classes</h2>
|
|
|
|
<ul class="nowrap">
|
|
|
|
<li><a href="../misc classes/Color.html">Color</a></li>
|
2021-08-30 18:46:48 +01:00
|
|
|
<li><a href="../misc classes/DisplayString.html">DisplayString</a></li>
|
2021-08-23 19:19:36 +01:00
|
|
|
<li><a href="../misc classes/Position.html">Position</a></li>
|
|
|
|
<li><a href="../misc classes/Rotation.html">Rotation</a></li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
<h1>Class <code>Level</code></h1>
|
|
|
|
<p>Stores level metadata.</p>
|
|
|
|
<p>These are things things which aren't present in the compiled level file itself.</p>
|
|
|
|
|
|
|
|
|
|
|
|
<h2><a href="#Members">Members</a></h2>
|
|
|
|
<table class="function_list">
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#nameKey">nameKey</a></td>
|
|
|
|
<td class="summary">(string) string key for the level's (localised) name.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#scriptFile">scriptFile</a></td>
|
|
|
|
<td class="summary">(string) Level-specific Lua script file.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#levelFile">levelFile</a></td>
|
|
|
|
<td class="summary">(string) Compiled file path.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#loadScreenFile">loadScreenFile</a></td>
|
|
|
|
<td class="summary">(string) Load screen image.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#ambientTrack">ambientTrack</a></td>
|
|
|
|
<td class="summary">(string) initial ambient sound track to play.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#layer1">layer1</a></td>
|
|
|
|
<td class="summary">(<a href="../pre-game script classes/SkyLayer.html#">SkyLayer</a>) Primary sky layer</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#layer2">layer2</a></td>
|
|
|
|
<td class="summary">(<a href="../pre-game script classes/SkyLayer.html#">SkyLayer</a>) Secondary sky layer
|
|
|
|
<strong>(not yet implemented)</strong></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#fog">fog</a></td>
|
|
|
|
<td class="summary">(<a href="../misc classes/Color.html#">Color</a>) distance fog RGB color.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#horizon">horizon</a></td>
|
|
|
|
<td class="summary">(bool) Draw sky layer?</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#colAddHorizon">colAddHorizon</a></td>
|
|
|
|
<td class="summary">(bool) Enable smooth transition from horizon graphic to sky layer.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2021-08-23 20:16:01 +01:00
|
|
|
<td class="name" ><a href="#storm">storm</a></td>
|
|
|
|
<td class="summary">(bool) Enable flickering lightning in the sky.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2021-08-23 19:19:36 +01:00
|
|
|
<td class="name" ><a href="#weather">weather</a></td>
|
|
|
|
<td class="summary">(WeatherType) Choose weather effect.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#laraType">laraType</a></td>
|
|
|
|
<td class="summary">(LaraType) Must be one of the LaraType values.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#rumble">rumble</a></td>
|
|
|
|
<td class="summary">(bool) Enable occasional screen shake effect.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#mirror">mirror</a></td>
|
|
|
|
<td class="summary">(<a href="../pre-game script classes/Mirror.html#">Mirror</a>) Location and size of the level's mirror, if present.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#UVRotate">UVRotate</a></td>
|
|
|
|
<td class="summary">(byte) Default speed of "UVRotate" animated textures.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#farView">farView</a></td>
|
|
|
|
<td class="summary">(byte) The maximum draw distance for level.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#unlimitedAir">unlimitedAir</a></td>
|
|
|
|
<td class="summary">(bool) Enable unlimited oxygen supply when in water.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#objects">objects</a></td>
|
|
|
|
<td class="summary">(table of <a href="../pre-game script classes/InventoryObject.html#">InventoryObject</a>s) table of inventory object overrides</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
|
|
<table class="function_list">
|
|
|
|
<tr>
|
|
|
|
<td class="name" ><a href="#Level.new">Level.new()</a></td>
|
|
|
|
<td class="summary">Make a new Level object.</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="section-header "><a name="Members"></a>Members</h2>
|
|
|
|
|
|
|
|
<dl class="function">
|
|
|
|
<dt>
|
|
|
|
<a name = "nameKey"></a>
|
|
|
|
<strong>nameKey</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(string) string key for the level's (localised) name.
|
|
|
|
Corresponds to an entry in strings.lua.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "scriptFile"></a>
|
|
|
|
<strong>scriptFile</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(string) Level-specific Lua script file.
|
|
|
|
Path of the Lua file holding the level's logic script, relative to the location of the tombengine executable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "levelFile"></a>
|
|
|
|
<strong>levelFile</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(string) Compiled file path.
|
|
|
|
This path is relative to the location of the TombEngine executable.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "loadScreenFile"></a>
|
|
|
|
<strong>loadScreenFile</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(string) Load screen image.
|
|
|
|
Path of the level's load screen file (.png or .jpg), relative to the location of the tombengine executable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "ambientTrack"></a>
|
|
|
|
<strong>ambientTrack</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(string) initial ambient sound track to play.
|
|
|
|
This is the filename of the track <strong>without</strong> the .wav extension.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "layer1"></a>
|
|
|
|
<strong>layer1</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(<a href="../pre-game script classes/SkyLayer.html#">SkyLayer</a>) Primary sky layer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "layer2"></a>
|
|
|
|
<strong>layer2</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(<a href="../pre-game script classes/SkyLayer.html#">SkyLayer</a>) Secondary sky layer
|
|
|
|
<strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "fog"></a>
|
|
|
|
<strong>fog</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(<a href="../misc classes/Color.html#">Color</a>) distance fog RGB color.
|
|
|
|
As seen in TR4's Desert Railroad.
|
|
|
|
If not provided, distance fog will be black.</p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "horizon"></a>
|
|
|
|
<strong>horizon</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(bool) Draw sky layer? (default: false)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "colAddHorizon"></a>
|
|
|
|
<strong>colAddHorizon</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(bool) Enable smooth transition from horizon graphic to sky layer.
|
|
|
|
If set to false, there will be a black band between the two.</p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 20:16:01 +01:00
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "storm"></a>
|
|
|
|
<strong>storm</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(bool) Enable flickering lightning in the sky.
|
|
|
|
Equivalent to classic TRLE's LIGHTNING setting. As in the TRC Ireland levels.</p>
|
|
|
|
|
|
|
|
<p> <strong>(thunder sounds not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-23 19:19:36 +01:00
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "weather"></a>
|
|
|
|
<strong>weather</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(WeatherType) Choose weather effect.
|
|
|
|
Must be one of the values <code>WeatherType.NORMAL</code>, <code>WeatherType.RAIN</code>, or <code>WeatherType.SNOW</code>.</p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "laraType"></a>
|
|
|
|
<strong>laraType</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(LaraType) Must be one of the LaraType values.
|
|
|
|
These are:</p>
|
|
|
|
|
|
|
|
<pre><code>NORMAL
|
|
|
|
YOUNG
|
|
|
|
BUNHEAD
|
|
|
|
CATSUIT
|
|
|
|
DIVESUIT
|
|
|
|
INVISIBLE
|
|
|
|
</code></pre>
|
|
|
|
|
|
|
|
<p>e.g. <code>myLevel.laraType = LaraType.DIVESUIT</code></p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet fully implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "rumble"></a>
|
|
|
|
<strong>rumble</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(bool) Enable occasional screen shake effect.
|
|
|
|
As seen in TRC's Sinking Submarine.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "mirror"></a>
|
|
|
|
<strong>mirror</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(<a href="../pre-game script classes/Mirror.html#">Mirror</a>) Location and size of the level's mirror, if present. </p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "UVRotate"></a>
|
|
|
|
<strong>UVRotate</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(byte) Default speed of "UVRotate" animated textures. </p>
|
|
|
|
|
|
|
|
<p>Must be in the range [-64, 64].</p>
|
|
|
|
|
|
|
|
<p>A level texture can be set in Tomb Editor to use "UVRotate" animation.
|
|
|
|
This gives the effect of the texture looping downwards or upwards in place.
|
|
|
|
Positive values will cause the texture to loop downwards, and negative values
|
|
|
|
will cause an upwards loop. The higher a positive number or the lower a negative
|
|
|
|
number, the faster the scroll will be.</p>
|
|
|
|
|
|
|
|
<p><strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "farView"></a>
|
|
|
|
<strong>farView</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(byte) The maximum draw distance for level.
|
|
|
|
Given in sectors (blocks).
|
|
|
|
Must be in the range [1, 127], and equal to or less than the value passed to SetGameFarView.</p>
|
|
|
|
|
|
|
|
<p>This is equivalent to TRNG's LevelFarView variable.</p>
|
|
|
|
|
|
|
|
<p><strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "unlimitedAir"></a>
|
|
|
|
<strong>unlimitedAir</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(bool) Enable unlimited oxygen supply when in water. </p>
|
|
|
|
|
|
|
|
<p> <strong>(not yet implemented)</strong>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
<dt>
|
|
|
|
<a name = "objects"></a>
|
|
|
|
<strong>objects</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
(table of <a href="../pre-game script classes/InventoryObject.html#">InventoryObject</a>s) table of inventory object overrides
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
|
|
|
|
<dl class="function">
|
|
|
|
<dt>
|
|
|
|
<a name = "Level.new"></a>
|
|
|
|
<strong>Level.new()</strong>
|
|
|
|
</dt>
|
|
|
|
<dd>
|
|
|
|
Make a new Level object.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
|
|
<ol>
|
|
|
|
|
|
|
|
a Level object
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
|
|
|
|
</div> <!-- id="content" -->
|
|
|
|
</div> <!-- id="main" -->
|
|
|
|
<div id="about">
|
|
|
|
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
|
2021-08-30 18:46:48 +01:00
|
|
|
<i style="float:right;">Last updated 2021-08-30 18:45:10 </i>
|
2021-08-23 19:19:36 +01:00
|
|
|
</div> <!-- id="about" -->
|
|
|
|
</div> <!-- id="container" -->
|
|
|
|
</body>
|
|
|
|
</html>
|