mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-29 00:07:58 +03:00
1009 lines
27 KiB
HTML
1009 lines
27 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.1.0 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> <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> <here>Misc</here></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/Misc.SoundTrackType.html">Misc.SoundTrackType</a></li>
|
|
<li> <a href="../4 enums/Objects.AmmoType.html">Objects.AmmoType</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>Misc</code></h1>
|
|
<p>Functions that don't fit in the other modules.</p>
|
|
<p>
|
|
|
|
</p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" ><a href="#HasLineOfSight">HasLineOfSight(room1, pos1, pos2)</a></td>
|
|
<td class="summary">Determine if there's a line of sight between two points.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#Vibrate">Vibrate(strength, time)</a></td>
|
|
<td class="summary">Vibrate game controller, if function is available and setting is on.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#FadeOut">FadeOut(speed)</a></td>
|
|
<td class="summary">Do a full-screen fade-to-black.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#FadeIn">FadeIn(speed)</a></td>
|
|
<td class="summary">Do a full-screen fade-in from black.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetCineBars">SetCineBars(height, speed)</a></td>
|
|
<td class="summary">Move black cinematic bars in from the top and bottom of the game window.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetFOV">SetFOV(angle)</a></td>
|
|
<td class="summary">Set field of view.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetCameraType">GetCameraType()</a></td>
|
|
<td class="summary">Shows the mode of the game camera.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#PlayAudioTrack">PlayAudioTrack(name, type)</a></td>
|
|
<td class="summary">Play an audio track</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#SetAmbientTrack">SetAmbientTrack(name)</a></td>
|
|
<td class="summary">Set and play an ambient track</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#StopAudioTracks">StopAudioTracks()</a></td>
|
|
<td class="summary">Stop any audio tracks currently playing</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#StopAudioTrack">StopAudioTrack(type)</a></td>
|
|
<td class="summary">Stop audio track that is currently playing</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetAudioTrackLoudness">GetAudioTrackLoudness(type)</a></td>
|
|
<td class="summary">Get current loudness level for specified track type</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#GetCurrentSubtitle">GetCurrentSubtitle()</a></td>
|
|
<td class="summary">Get current subtitle string for a voice track currently playing.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#PlaySound">PlaySound(sound[, position])</a></td>
|
|
<td class="summary">Play sound effect</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#IsSoundPlaying">IsSoundPlaying(Sound)</a></td>
|
|
<td class="summary">Check if the sound effect is playing</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#IsAudioTrackPlaying">IsAudioTrackPlaying(Track)</a></td>
|
|
<td class="summary">Check if the audio track is playing</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#FlipMap">FlipMap(flipmap)</a></td>
|
|
<td class="summary">Do FlipMap with specific ID</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#PlayFlyBy">PlayFlyBy(flyby)</a></td>
|
|
<td class="summary">Enable FlyBy with specific ID</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#CalculateDistance">CalculateDistance(posA, posB)</a></td>
|
|
<td class="summary">Calculate the distance between two positions.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#CalculateHorizontalDistance">CalculateHorizontalDistance(posA, posB)</a></td>
|
|
<td class="summary">Calculate the horizontal distance between two positions.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#PercentToScreen">PercentToScreen(x, y)</a></td>
|
|
<td class="summary">Translate a pair of percentages to screen-space pixel coordinates.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#ScreenToPercent">ScreenToPercent(x, y)</a></td>
|
|
<td class="summary">Translate a pair of coordinates to percentages of window dimensions.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#ResetObjCamera">ResetObjCamera()</a></td>
|
|
<td class="summary">Reset object camera back to Lara and deactivate object camera.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#PrintLog">PrintLog(message, logLevel[, allowSpam])</a></td>
|
|
<td class="summary">Write messages within the Log file</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#Vibrate">Vibrate(strength, time)</a></td>
|
|
<td class="summary">Vibrate gamepad, if possible.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#KeyIsHeld">KeyIsHeld(action)</a></td>
|
|
<td class="summary">Check if particular action key is held</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#KeyIsHit">KeyIsHit(action)</a></td>
|
|
<td class="summary">Check if particular action key was hit (once)</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#KeyPush">KeyPush(action)</a></td>
|
|
<td class="summary">Emulate pushing of a certain action key</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" ><a href="#KeyClear">KeyClear(action)</a></td>
|
|
<td class="summary">Clears particular input from action key</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2 class="section-header "><a name="Functions"></a>Functions</h2>
|
|
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "HasLineOfSight"></a>
|
|
<strong>HasLineOfSight(room1, pos1, pos2)</strong>
|
|
</dt>
|
|
<dd>
|
|
Determine if there's a line of sight between two points. </p>
|
|
|
|
<p>i.e. if we run a direct line from one position to another
|
|
will any geometry get in the way?</p>
|
|
|
|
<p>Note: if you use this with Moveable:GetPosition to test if (for example)
|
|
two creatures can see one another, you might have to do some extra adjustments.</p>
|
|
|
|
<p>This is because the "position" for most objects refers to its base, i.e., the floor.
|
|
As a solution, you can increase the y-coordinate of this position to correspond to roughly where the
|
|
eyes of the creatures would be.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">room1</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
ID of the room where the first position is
|
|
</li>
|
|
<li><span class="parameter">pos1</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
first position
|
|
</li>
|
|
<li><span class="parameter">pos2</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
second position
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">bool</span></span>
|
|
is there a direct line of sight between the two positions?
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example"><span class="keyword">local</span> flamePlinthPos = flamePlinth:GetPosition() + Vec3(<span class="number">0</span>, flamePlinthHeight, <span class="number">0</span>);
|
|
<span class="global">print</span>(Misc.HasLineOfSight(enemyHead:GetRoomNumber(), enemyHead:GetPosition(), flamePlinthPos))</pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "Vibrate"></a>
|
|
<strong>Vibrate(strength, time)</strong>
|
|
</dt>
|
|
<dd>
|
|
Vibrate game controller, if function is available and setting is on.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">strength</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
Strength of the vibration
|
|
</li>
|
|
<li><span class="parameter">time</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
<strong>(default 0.3)</strong> Time of the vibration, in seconds
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "FadeOut"></a>
|
|
<strong>FadeOut(speed)</strong>
|
|
</dt>
|
|
<dd>
|
|
Do a full-screen fade-to-black. The screen will remain black until a call to FadeIn.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">speed</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
(default 1.0). Speed in "amount" per second. A value of 1 will make the fade take one second.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "FadeIn"></a>
|
|
<strong>FadeIn(speed)</strong>
|
|
</dt>
|
|
<dd>
|
|
Do a full-screen fade-in from black.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">speed</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
(default 1.0). Speed in "amount" per second. A value of 1 will make the fade take one second.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetCineBars"></a>
|
|
<strong>SetCineBars(height, speed)</strong>
|
|
</dt>
|
|
<dd>
|
|
Move black cinematic bars in from the top and bottom of the game window.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">height</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
<strong>(default 30)</strong> Percentage of the screen to be covered
|
|
</li>
|
|
<li><span class="parameter">speed</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
<strong>(default 30)</strong> Coverage percent per second
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetFOV"></a>
|
|
<strong>SetFOV(angle)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set field of view.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">angle</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
in degrees (clamped to [10, 170])
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetCameraType"></a>
|
|
<strong>GetCameraType()</strong>
|
|
</dt>
|
|
<dd>
|
|
Shows the mode of the game camera.
|
|
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="../4 enums/Misc.CameraType.html#">CameraType</a></span>
|
|
value used by the Main Camera.
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">LevelFuncs.OnControlPhase = <span class="keyword">function</span>()
|
|
<span class="keyword">if</span> (Misc.GetCameraType() == CameraType.Combat) <span class="keyword">then</span>
|
|
<span class="comment">--Do your Actions here.
|
|
</span> <span class="keyword">end</span>
|
|
<span class="keyword">end</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "PlayAudioTrack"></a>
|
|
<strong>PlayAudioTrack(name, type)</strong>
|
|
</dt>
|
|
<dd>
|
|
Play an audio track
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">name</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
of track (without file extension) to play
|
|
</li>
|
|
<li><span class="parameter">type</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.SoundTrackType.html#">SoundTrackType</a></span>
|
|
of the audio track to play
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SetAmbientTrack"></a>
|
|
<strong>SetAmbientTrack(name)</strong>
|
|
</dt>
|
|
<dd>
|
|
Set and play an ambient track
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">name</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
of track (without file extension) to play
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "StopAudioTracks"></a>
|
|
<strong>StopAudioTracks()</strong>
|
|
</dt>
|
|
<dd>
|
|
Stop any audio tracks currently playing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "StopAudioTrack"></a>
|
|
<strong>StopAudioTrack(type)</strong>
|
|
</dt>
|
|
<dd>
|
|
Stop audio track that is currently playing
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">type</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.SoundTrackType.html#">SoundTrackType</a></span>
|
|
of the audio track
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetAudioTrackLoudness"></a>
|
|
<strong>GetAudioTrackLoudness(type)</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current loudness level for specified track type
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">type</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.SoundTrackType.html#">SoundTrackType</a></span>
|
|
of the audio track
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">float</span></span>
|
|
current loudness of a specified audio track
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "GetCurrentSubtitle"></a>
|
|
<strong>GetCurrentSubtitle()</strong>
|
|
</dt>
|
|
<dd>
|
|
Get current subtitle string for a voice track currently playing.
|
|
Subtitle file must be in .srt format, have same filename as voice track, and be placed in same directory as voice track.
|
|
Returns nil if no voice track is playing or no subtitle present.
|
|
|
|
|
|
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
current subtitle string
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "PlaySound"></a>
|
|
<strong>PlaySound(sound[, position])</strong>
|
|
</dt>
|
|
<dd>
|
|
Play sound effect
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">sound</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
ID to play. Corresponds to the value in the sound XML file or Tomb Editor's "Sound Infos" window.
|
|
</li>
|
|
<li><span class="parameter">position</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
The 3D position of the sound, i.e. where the sound "comes from". If not given, the sound will not be positional.
|
|
(<em>optional</em>)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "IsSoundPlaying"></a>
|
|
<strong>IsSoundPlaying(Sound)</strong>
|
|
</dt>
|
|
<dd>
|
|
Check if the sound effect is playing
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">Sound</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
ID to check. Corresponds to the value in the sound XML file or Tomb Editor's "Sound Infos" window.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "IsAudioTrackPlaying"></a>
|
|
<strong>IsAudioTrackPlaying(Track)</strong>
|
|
</dt>
|
|
<dd>
|
|
Check if the audio track is playing
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">Track</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
filename to check. Should be without extension and without full directory path.
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "FlipMap"></a>
|
|
<strong>FlipMap(flipmap)</strong>
|
|
</dt>
|
|
<dd>
|
|
Do FlipMap with specific ID
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">flipmap</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
(ID of flipmap)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "PlayFlyBy"></a>
|
|
<strong>PlayFlyBy(flyby)</strong>
|
|
</dt>
|
|
<dd>
|
|
Enable FlyBy with specific ID
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">flyby</span>
|
|
<span class="types"><span class="type">short</span></span>
|
|
(ID of flyby)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "CalculateDistance"></a>
|
|
<strong>CalculateDistance(posA, posB)</strong>
|
|
</dt>
|
|
<dd>
|
|
Calculate the distance between two positions.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">posA</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
first position
|
|
</li>
|
|
<li><span class="parameter">posB</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
second position
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">int</span></span>
|
|
the direct distance from one position to the other
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "CalculateHorizontalDistance"></a>
|
|
<strong>CalculateHorizontalDistance(posA, posB)</strong>
|
|
</dt>
|
|
<dd>
|
|
Calculate the horizontal distance between two positions.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">posA</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
first position
|
|
</li>
|
|
<li><span class="parameter">posB</span>
|
|
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
|
second position
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
<span class="types"><span class="type">int</span></span>
|
|
the direct distance on the XZ plane from one position to the other
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "PercentToScreen"></a>
|
|
<strong>PercentToScreen(x, y)</strong>
|
|
</dt>
|
|
<dd>
|
|
Translate a pair of percentages to screen-space pixel coordinates.
|
|
To be used with <a href="../2 classes/Strings.DisplayString.html#DisplayString:SetPosition">Strings.DisplayString:SetPosition</a> and <a href="../2 classes/Strings.DisplayString.html#">Strings.DisplayString</a>.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">x</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
percent value to translate to x-coordinate
|
|
</li>
|
|
<li><span class="parameter">y</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
percent value to translate to y-coordinate
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
<li>
|
|
<span class="types"><span class="type">int</span></span>
|
|
x coordinate in pixels</li>
|
|
<li>
|
|
<span class="types"><span class="type">int</span></span>
|
|
y coordinate in pixels</li>
|
|
</ol>
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example"><span class="keyword">local</span> halfwayX, halfwayY = PercentToScreen(<span class="number">50</span>, <span class="number">50</span>)
|
|
<span class="keyword">local</span> baddy
|
|
<span class="keyword">local</span> spawnLocationNullmesh = GetMoveableByName(<span class="string">"position_behind_left_pillar"</span>)
|
|
<span class="keyword">local</span> str1 = DisplayString(<span class="string">"You spawned a baddy!"</span>, halfwayX, halfwayY, Color(<span class="number">255</span>, <span class="number">100</span>, <span class="number">100</span>), <span class="keyword">false</span>, {DisplayStringOption.SHADOW, DisplayStringOption.CENTER})
|
|
|
|
LevelFuncs.triggerOne = <span class="keyword">function</span>(obj)
|
|
ShowString(str1, <span class="number">4</span>)
|
|
<span class="keyword">end</span></pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "ScreenToPercent"></a>
|
|
<strong>ScreenToPercent(x, y)</strong>
|
|
</dt>
|
|
<dd>
|
|
Translate a pair of coordinates to percentages of window dimensions.
|
|
To be used with <a href="../2 classes/Strings.DisplayString.html#DisplayString:GetPosition">Strings.DisplayString:GetPosition</a>.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">x</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
pixel value to translate to a percentage of the window width
|
|
</li>
|
|
<li><span class="parameter">y</span>
|
|
<span class="types"><span class="type">int</span></span>
|
|
pixel value to translate to a percentage of the window height
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
<li>
|
|
<span class="types"><span class="type">float</span></span>
|
|
x coordinate as percentage</li>
|
|
<li>
|
|
<span class="types"><span class="type">float</span></span>
|
|
y coordinate as percentage</li>
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "ResetObjCamera"></a>
|
|
<strong>ResetObjCamera()</strong>
|
|
</dt>
|
|
<dd>
|
|
Reset object camera back to Lara and deactivate object camera.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "PrintLog"></a>
|
|
<strong>PrintLog(message, logLevel[, allowSpam])</strong>
|
|
</dt>
|
|
<dd>
|
|
Write messages within the Log file
|
|
|
|
<p>For native Lua handling of errors, see the official Lua website:</p>
|
|
|
|
<p><a href="https://www.lua.org/pil/8.3.html">Error management</a></p>
|
|
|
|
<p><a href="https://www.lua.org/manual/5.4/manual.html#pdf-debug.traceback">debug.traceback</a></p>
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">message</span>
|
|
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
|
|
to be displayed within the Log
|
|
</li>
|
|
<li><span class="parameter">logLevel</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.LogLevel.html#">LogLevel</a></span>
|
|
log level to be displayed
|
|
</li>
|
|
<li><span class="parameter">allowSpam</span>
|
|
<span class="types"><span class="type">bool</span></span>
|
|
true allows spamming of the message
|
|
(<em>optional</em>)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<ul>
|
|
<pre class="example">PrintLog(<span class="string">'test info log'</span>, LogLevel.INFO)
|
|
PrintLog(<span class="string">'test warning log'</span>, LogLevel.WARNING)
|
|
PrintLog(<span class="string">'test error log'</span>, LogLevel.ERROR)
|
|
<span class="comment">-- spammed message
|
|
</span>PrintLog(<span class="string">'test spam log'</span>, LogLevel.INFO, <span class="keyword">true</span>) </pre>
|
|
</ul>
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "Vibrate"></a>
|
|
<strong>Vibrate(strength, time)</strong>
|
|
</dt>
|
|
<dd>
|
|
Vibrate gamepad, if possible.
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">strength</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
|
|
|
|
|
|
</li>
|
|
<li><span class="parameter">time</span>
|
|
<span class="types"><span class="type">float</span></span>
|
|
(in seconds, default: 0.3)
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "KeyIsHeld"></a>
|
|
<strong>KeyIsHeld(action)</strong>
|
|
</dt>
|
|
<dd>
|
|
Check if particular action key is held
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">action</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.ActionID.html#">ActionID</a></span>
|
|
action mapping index to check
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "KeyIsHit"></a>
|
|
<strong>KeyIsHit(action)</strong>
|
|
</dt>
|
|
<dd>
|
|
Check if particular action key was hit (once)
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">action</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.ActionID.html#">ActionID</a></span>
|
|
action mapping index to check
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "KeyPush"></a>
|
|
<strong>KeyPush(action)</strong>
|
|
</dt>
|
|
<dd>
|
|
Emulate pushing of a certain action key
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">action</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.ActionID.html#">ActionID</a></span>
|
|
action mapping index to push
|
|
</li>
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "KeyClear"></a>
|
|
<strong>KeyClear(action)</strong>
|
|
</dt>
|
|
<dd>
|
|
Clears particular input from action key
|
|
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">action</span>
|
|
<span class="types"><a class="type" href="../4 enums/Misc.ActionID.html#">ActionID</a></span>
|
|
action mapping index to clear
|
|
</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-09-30 13:48:57 </i>
|
|
</div> <!-- id="about" -->
|
|
</div> <!-- id="container" -->
|
|
</body>
|
|
</html>
|