<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://df-21.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jerethk</id>
	<title>DF21 Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://df-21.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jerethk"/>
	<link rel="alternate" type="text/html" href="https://df-21.net/wiki/?title=Special:Contributions/Jerethk"/>
	<updated>2026-11-17T05:25:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1612</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1612"/>
		<updated>2026-11-15T15:57:25Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Enums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dark Forces types ==&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;&lt;br /&gt;
| a sector&lt;br /&gt;
| [[Script Sector]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt;&lt;br /&gt;
| a wall&lt;br /&gt;
| [[Script Wall]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&lt;br /&gt;
| a game object (includes the player, NPCs, scenery, 3d models, projectiles, effects/explosions, items, etc.)&lt;br /&gt;
| [[Script Object]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt;&lt;br /&gt;
| a level texture&lt;br /&gt;
| [[Script Texture]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Elevator&amp;lt;/code&amp;gt;&lt;br /&gt;
| an elevator&lt;br /&gt;
| [[Script Elevator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special objects ==&lt;br /&gt;
These are special ForceScript objects; there are (normally) only one of each in existence at any time.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
! Object name&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
! Reference article&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt;&lt;br /&gt;
| Game&lt;br /&gt;
| Exposes properties and methods on the game currently being played&lt;br /&gt;
| [[Game Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;&lt;br /&gt;
| Level&lt;br /&gt;
| Exposes properties and methods on the currently open level&lt;br /&gt;
| [[Level Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player&lt;br /&gt;
| Exposes properties and methods on the player&lt;br /&gt;
| [[Player Script API]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== MessageType ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M_TRIGGER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;NEXT_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PREV_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DONE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER_ON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER_OFF&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CRUSH&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SectorFlags1 === &lt;br /&gt;
&lt;br /&gt;
=== WallFlags1 ===&lt;br /&gt;
&lt;br /&gt;
=== WallFlags3 ===&lt;br /&gt;
&lt;br /&gt;
=== SectorProp ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_FLOOR_HEIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_CEIL_HEIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_SECOND_HEIGHT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_FLOOR_TEX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_CEIL_TEX&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;SECTORPROP_AMBIENT&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Items ===&lt;br /&gt;
&lt;br /&gt;
=== Weapons ===&lt;br /&gt;
&lt;br /&gt;
=== Ammo ===&lt;br /&gt;
&lt;br /&gt;
=== PlayerActions ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_MOVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_ROTATE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_FIRE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_ALL&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
&lt;br /&gt;
=== WallPart ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_MIDDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_TOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_BOTTOM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_SIGN&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1611</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1611"/>
		<updated>2026-11-15T15:55:14Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dark Forces types ==&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;&lt;br /&gt;
| a sector&lt;br /&gt;
| [[Script Sector]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt;&lt;br /&gt;
| a wall&lt;br /&gt;
| [[Script Wall]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&lt;br /&gt;
| a game object (includes the player, NPCs, scenery, 3d models, projectiles, effects/explosions, items, etc.)&lt;br /&gt;
| [[Script Object]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt;&lt;br /&gt;
| a level texture&lt;br /&gt;
| [[Script Texture]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Elevator&amp;lt;/code&amp;gt;&lt;br /&gt;
| an elevator&lt;br /&gt;
| [[Script Elevator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special objects ==&lt;br /&gt;
These are special ForceScript objects; there are (normally) only one of each in existence at any time.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
! Object name&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
! Reference article&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt;&lt;br /&gt;
| Game&lt;br /&gt;
| Exposes properties and methods on the game currently being played&lt;br /&gt;
| [[Game Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;&lt;br /&gt;
| Level&lt;br /&gt;
| Exposes properties and methods on the currently open level&lt;br /&gt;
| [[Level Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player&lt;br /&gt;
| Exposes properties and methods on the player&lt;br /&gt;
| [[Player Script API]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== MessageType ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M_TRIGGER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;NEXT_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;PREV_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;DONE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER_ON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;MASTER_OFF&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;CRUSH&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SectorFlags1 === &lt;br /&gt;
&lt;br /&gt;
=== WallFlags1 ===&lt;br /&gt;
&lt;br /&gt;
=== WallFlags3 ===&lt;br /&gt;
&lt;br /&gt;
=== SectorProp ===&lt;br /&gt;
&lt;br /&gt;
=== Items ===&lt;br /&gt;
&lt;br /&gt;
=== Weapons ===&lt;br /&gt;
&lt;br /&gt;
=== Ammo ===&lt;br /&gt;
&lt;br /&gt;
=== PlayerActions ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_MOVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_ROTATE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_FIRE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ACTION_ALL&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Projectiles ===&lt;br /&gt;
&lt;br /&gt;
=== WallPart ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_MIDDLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_TOP&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_BOTTOM&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;WP_SIGN&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Game_Script_API&amp;diff=1610</id>
		<title>Game Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Game_Script_API&amp;diff=1610"/>
		<updated>2026-11-15T15:39:28Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;The &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt; object exposes several methods on the game that is currently being played.  == Methods == === getGameTime() === * returns the current game time in seconds (float)  === text() === * displays text on the screen * parameter: message (string); the text to display  === random() === * returns a random integer using the Dark Forces random number generator (this is not the C/C++ random number function) * parameter: an integer value; the returned number will...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt; object exposes several methods on the game that is currently being played.&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== getGameTime() ===&lt;br /&gt;
* returns the current game time in seconds (float)&lt;br /&gt;
&lt;br /&gt;
=== text() ===&lt;br /&gt;
* displays text on the screen&lt;br /&gt;
* parameter: message (string); the text to display&lt;br /&gt;
&lt;br /&gt;
=== random() ===&lt;br /&gt;
* returns a random integer using the Dark Forces random number generator (this is not the C/C++ random number function)&lt;br /&gt;
* parameter: an integer value; the returned number will be between 0 and this value&lt;br /&gt;
&lt;br /&gt;
=== playCutscene() ===&lt;br /&gt;
* plays an OGV cutscene&lt;br /&gt;
* parameter: cutsceneName (string); the name of the cutscene to play&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1609</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1609"/>
		<updated>2026-11-15T15:10:08Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Special objects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dark Forces types ==&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;&lt;br /&gt;
| a sector&lt;br /&gt;
| [[Script Sector]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt;&lt;br /&gt;
| a wall&lt;br /&gt;
| [[Script Wall]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&lt;br /&gt;
| a game object (includes the player, NPCs, scenery, 3d models, projectiles, effects/explosions, items, etc.)&lt;br /&gt;
| [[Script Object]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt;&lt;br /&gt;
| a level texture&lt;br /&gt;
| [[Script Texture]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Elevator&amp;lt;/code&amp;gt;&lt;br /&gt;
| an elevator&lt;br /&gt;
| [[Script Elevator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special objects ==&lt;br /&gt;
These are special ForceScript objects; there are (normally) only one of each in existence at any time.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
! Object name&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
! Reference article&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt;&lt;br /&gt;
| Game&lt;br /&gt;
| Exposes properties and methods on the game currently being played&lt;br /&gt;
| [[Game Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;&lt;br /&gt;
| Level&lt;br /&gt;
| Exposes properties and methods on the currently open level&lt;br /&gt;
| [[Level Script API]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;player&amp;lt;/code&amp;gt;&lt;br /&gt;
| Player&lt;br /&gt;
| Exposes properties and methods on the player&lt;br /&gt;
| [[Player Script API]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1608</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1608"/>
		<updated>2026-11-15T15:08:18Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dark Forces types ==&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;&lt;br /&gt;
| a sector&lt;br /&gt;
| [[Script Sector]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt;&lt;br /&gt;
| a wall&lt;br /&gt;
| [[Script Wall]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&lt;br /&gt;
| a game object (includes the player, NPCs, scenery, 3d models, projectiles, effects/explosions, items, etc.)&lt;br /&gt;
| [[Script Object]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt;&lt;br /&gt;
| a level texture&lt;br /&gt;
| [[Script Texture]]&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Elevator&amp;lt;/code&amp;gt;&lt;br /&gt;
| an elevator&lt;br /&gt;
| [[Script Elevator]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Special objects ==&lt;br /&gt;
These are special ForceScript objects; there are (normally) only one of each in existence at any time.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=4px&lt;br /&gt;
|-&lt;br /&gt;
! Object name&lt;br /&gt;
! Type&lt;br /&gt;
! Description&lt;br /&gt;
! Reference article&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;game&amp;lt;/code&amp;gt;&lt;br /&gt;
| Game&lt;br /&gt;
| Exposes properties and methods on the game currently being played&lt;br /&gt;
| [[Game Script API]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1607</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1607"/>
		<updated>2026-11-15T14:52:49Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Dark Forces types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;&lt;br /&gt;
| a sector&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt;&lt;br /&gt;
| a wall&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Object&amp;lt;/code&amp;gt;&lt;br /&gt;
| an object&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt;&lt;br /&gt;
| a level texture&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Elevator&amp;lt;/code&amp;gt;&lt;br /&gt;
| an elevator&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1606</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1606"/>
		<updated>2026-11-15T14:50:23Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Arrays and vectors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2x2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 2x2 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3x3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 3x3 matrix of floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4x4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a 4x4 matrix of floats&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1605</id>
		<title>ForceScript API Quick Reference</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript_API_Quick_Reference&amp;diff=1605"/>
		<updated>2026-11-15T14:37:47Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;== Basic types == {| |- | &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt; | signed 32-bit integer |- | &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt; | unsigned 32-bit integer |- | &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt; | 32-bit floating point number |- | &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt; | boolean |- | &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; | string |}  == Arrays and vectors == {| |- | &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt; | an array |- | &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt; | a vector of 2 floats |- | &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt; | a vector of 3 floats |- | &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt; | a vector of 3 floats |}&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Basic types ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;int&amp;lt;/code&amp;gt;&lt;br /&gt;
| signed 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;uint&amp;lt;/code&amp;gt;&lt;br /&gt;
| unsigned 32-bit integer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float&amp;lt;/code&amp;gt;&lt;br /&gt;
| 32-bit floating point number&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;bool&amp;lt;/code&amp;gt;&lt;br /&gt;
| boolean&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt;&lt;br /&gt;
| string&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Arrays and vectors ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;array&amp;lt;/code&amp;gt;&lt;br /&gt;
| an array&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float2&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 2 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float3&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;float4&amp;lt;/code&amp;gt;&lt;br /&gt;
| a vector of 3 floats&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Wall&amp;diff=1604</id>
		<title>Script Wall</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Wall&amp;diff=1604"/>
		<updated>2026-11-15T14:24:45Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Type ==&lt;br /&gt;
&amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt; - represents a Dark Forces wall.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;WallPart&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
The values correspond to the TOP, MID, BOT and SIGN parts of a wall.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| WP_MIDDLE&lt;br /&gt;
|- &lt;br /&gt;
| WP_TOP&lt;br /&gt;
|- &lt;br /&gt;
| WP_BOTTOM&lt;br /&gt;
|- &lt;br /&gt;
| WP_SIGN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== adjoin ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== mirror ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== wallLight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== isValid() ===&lt;br /&gt;
&lt;br /&gt;
=== isFlagSet() ===&lt;br /&gt;
&lt;br /&gt;
=== clearFlag() ===&lt;br /&gt;
&lt;br /&gt;
=== setFlag() ===&lt;br /&gt;
&lt;br /&gt;
=== getVertex() ===&lt;br /&gt;
&lt;br /&gt;
=== getVertexBase() ===&lt;br /&gt;
&lt;br /&gt;
=== setVertex() ===&lt;br /&gt;
&lt;br /&gt;
=== getTexture() ===&lt;br /&gt;
&lt;br /&gt;
=== getTextureOffset() ===&lt;br /&gt;
&lt;br /&gt;
=== setTexture() ===&lt;br /&gt;
&lt;br /&gt;
=== setTextureOffset() ===&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Wall&amp;diff=1603</id>
		<title>Script Wall</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Wall&amp;diff=1603"/>
		<updated>2026-11-15T14:19:06Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;== Type == &amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt; - represents a Dark Forces wall.  == Enums == === &amp;lt;code&amp;gt;WallPart&amp;lt;/code&amp;gt; enum === The values correspond to the TOP, MID, BOT and SIGN parts of a wall.  {| |-  | WP_MIDDLE |-  | WP_TOP |-  | WP_BOTTOM |-  | WP_SIGN |}   == Properties ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Type ==&lt;br /&gt;
&amp;lt;code&amp;gt;Wall&amp;lt;/code&amp;gt; - represents a Dark Forces wall.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;WallPart&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
The values correspond to the TOP, MID, BOT and SIGN parts of a wall.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| WP_MIDDLE&lt;br /&gt;
|- &lt;br /&gt;
| WP_TOP&lt;br /&gt;
|- &lt;br /&gt;
| WP_BOTTOM&lt;br /&gt;
|- &lt;br /&gt;
| WP_SIGN&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1602</id>
		<title>Script Sector</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1602"/>
		<updated>2026-11-15T14:12:35Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Type ==&lt;br /&gt;
&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt; - represents a Dark Forces sector.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== floorHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== secondHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ambient ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== wallCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
&lt;br /&gt;
=== floorTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== floorTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== isValid() ===&lt;br /&gt;
&lt;br /&gt;
=== isFlagSet(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== clearFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== setFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== getCenterXZ() ===&lt;br /&gt;
&lt;br /&gt;
=== getWall(int) ===&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType) ===&lt;br /&gt;
* Sends a message to sector&lt;br /&gt;
* Parameters: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum&lt;br /&gt;
* Return value: void&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; that can be sent to sectors:&lt;br /&gt;
** &amp;lt;code&amp;gt;M_TRIGGER&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NEXT_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;PREV_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MASTER_ON&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MASTER_OFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Sector myElev = level.getSector(&amp;quot;elev1&amp;quot;);&lt;br /&gt;
myElev.sendMessage(NEXT_STOP);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType, uint) ===&lt;br /&gt;
* Sends a message to sector with an event&lt;br /&gt;
* Parameters: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum, event&lt;br /&gt;
* Return value: void&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; are as above.&lt;br /&gt;
&lt;br /&gt;
Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Sector myElev = level.getSector(&amp;quot;elev1&amp;quot;);&lt;br /&gt;
myElev.sendMessage(NEXT_STOP, 131072);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the equivalent of sending a message via INF like this - &amp;lt;code&amp;gt;message: 1 elev1 NEXT_STOP 131072&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Texture&amp;diff=1601</id>
		<title>Script Texture</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Texture&amp;diff=1601"/>
		<updated>2026-11-15T14:04:29Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;LevelTexture&amp;lt;/code&amp;gt; is the ForceScript type which represents Dark Forces level textures.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Texture&amp;diff=1600</id>
		<title>Script Texture</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Texture&amp;diff=1600"/>
		<updated>2026-11-15T14:04:06Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;`LevelTexture` is the ForceScript type which represents Dark Forces level textures.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;`LevelTexture` is the ForceScript type which represents Dark Forces level textures.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1599</id>
		<title>ForceScript</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1599"/>
		<updated>2026-11-15T14:02:56Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;ForceScript&#039;&#039;&#039; is the scripting language for The Force Engine. It is built on [https://www.angelcode.com/angelscript/ AngelScript].&lt;br /&gt;
&lt;br /&gt;
The following articles contain the reference for ForceScript.&lt;br /&gt;
&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
&lt;br /&gt;
* [[ForceScript API Quick Reference]]&lt;br /&gt;
&lt;br /&gt;
* [[Math Script API]]&lt;br /&gt;
* [[System Script API]]&lt;br /&gt;
* [[Level Script API]]&lt;br /&gt;
* [[Game Script API]]&lt;br /&gt;
* [[Player Script API]]&lt;br /&gt;
&lt;br /&gt;
* [[Script Sector]]&lt;br /&gt;
* [[Script Wall]]&lt;br /&gt;
* [[Script Object]]&lt;br /&gt;
* [[Script Texture]]&lt;br /&gt;
* [[Script Elevator]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1598</id>
		<title>ForceScript</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1598"/>
		<updated>2026-11-15T14:02:38Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;ForceScript&#039;&#039;&#039; is the scripting language for The Force Engine. It is built on [https://www.angelcode.com/angelscript/ AngelScript].&lt;br /&gt;
&lt;br /&gt;
The following articles contain the reference for ForceScript.&lt;br /&gt;
&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
&lt;br /&gt;
* [[ForceScript Quick Reference]]&lt;br /&gt;
&lt;br /&gt;
* [[Math Script API]]&lt;br /&gt;
* [[System Script API]]&lt;br /&gt;
* [[Level Script API]]&lt;br /&gt;
* [[Game Script API]]&lt;br /&gt;
* [[Player Script API]]&lt;br /&gt;
&lt;br /&gt;
* [[Script Sector]]&lt;br /&gt;
* [[Script Wall]]&lt;br /&gt;
* [[Script Object]]&lt;br /&gt;
* [[Script Texture]]&lt;br /&gt;
* [[Script Elevator]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Dark_Forces_Wiki&amp;diff=1597</id>
		<title>Dark Forces Wiki</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Dark_Forces_Wiki&amp;diff=1597"/>
		<updated>2026-11-15T13:58:01Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Move ForceScript articles to a dedicated page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;text-align: center; font-size: x-large; padding: 1em;&amp;quot;&amp;gt;[[File:WikiLogo.png|center|frameless|561x561px]]&#039;&#039;&#039;Welcome to the {{SITENAME}}!&#039;&#039;&#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This community is dedicated to the 1995 game &#039;&#039;Star Wars: Dark Forces&#039;&#039; with an emphasis on modding and map making .  &lt;br /&gt;
&lt;br /&gt;
If you would like to contribute please create an account and help expand this wiki. &lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Editors ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[[WDFUSE]]&#039;&#039;&#039; - (&#039;&#039;&#039;The original Dark Forces Editor)&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[[TFE-EDITOR]]&#039;&#039;&#039; - &#039;&#039;&#039;(The Force Engine Editor)&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[https://df-21.net/downloads/utilities.php CYBERDARK] - (Obsolete)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== How To Guides ===&lt;br /&gt;
* [https://df-21.net/wiki/?title=DF-21_Mission_Components Submitting DF-21 Missions]&lt;br /&gt;
* [https://df-21.net/wiki/?title=Converting_Classic_Maps Converting Old DF-21 Missions]&lt;br /&gt;
* [https://df-21.net/wiki/?title=How_To:_Good_MIDI How to get good sounding MIDI in Dark Forces]&lt;br /&gt;
* [https://df-21.net/wiki/?title=WAX_File_Generator How to generate an Enemy WAX file with Blender]]&lt;br /&gt;
* [https://df-21.net/wiki/?title=Blender_3DO_Guide How to create a 3DO file with Blender]]&lt;br /&gt;
* [[Level creation tips]]&lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Reference ===&lt;br /&gt;
* [[Dark Forces Unofficial Specifications]]&lt;br /&gt;
* [[Dark Forces Remaster Unofficial Specs]]&lt;br /&gt;
* [[Teleporter Basic]]&lt;br /&gt;
* [[VUE Camera transforms]]&lt;br /&gt;
* [[Logics and AI reference]]&lt;br /&gt;
* [[Weapons reference]]&lt;br /&gt;
&lt;br /&gt;
=== The Force Engine Reference ===&lt;br /&gt;
* [[TFE_Mod_Overrides|Mod Overrides with MOD_CONF]]&lt;br /&gt;
* [[TFE Custom Logics]]&lt;br /&gt;
* [[TFE Projectile Data]]&lt;br /&gt;
* [[TFE Pickup Data]]&lt;br /&gt;
* [[TFE Weapon Data]]&lt;br /&gt;
* [[Camera feature]]&lt;br /&gt;
&lt;br /&gt;
==== TFE Scripting ====&lt;br /&gt;
* [[ForceScript]]&lt;br /&gt;
&lt;br /&gt;
=== Vault ===&lt;br /&gt;
* [[:Category:Demo Assets|Assets included with the Dark Forces demo]]&lt;br /&gt;
&lt;br /&gt;
 [[Category:{{SITENAME}}]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1596</id>
		<title>ForceScript</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=ForceScript&amp;diff=1596"/>
		<updated>2026-11-15T13:56:19Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;ForceScript&amp;#039;&amp;#039;&amp;#039; is the scripting language for The Force Engine. It is built on [https://www.angelcode.com/angelscript/ AngelScript].  The following articles contain the reference for ForceScript.  * TFE Level Script  * Math Script API * System Script API * Level Script API * Game Script API * Player Script API  * Script Sector * Script Wall * Script Object * Script Texture * Script Elevator&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;ForceScript&#039;&#039;&#039; is the scripting language for The Force Engine. It is built on [https://www.angelcode.com/angelscript/ AngelScript].&lt;br /&gt;
&lt;br /&gt;
The following articles contain the reference for ForceScript.&lt;br /&gt;
&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
&lt;br /&gt;
* [[Math Script API]]&lt;br /&gt;
* [[System Script API]]&lt;br /&gt;
* [[Level Script API]]&lt;br /&gt;
* [[Game Script API]]&lt;br /&gt;
* [[Player Script API]]&lt;br /&gt;
&lt;br /&gt;
* [[Script Sector]]&lt;br /&gt;
* [[Script Wall]]&lt;br /&gt;
* [[Script Object]]&lt;br /&gt;
* [[Script Texture]]&lt;br /&gt;
* [[Script Elevator]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1574</id>
		<title>TFE Custom Logics</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1574"/>
		<updated>2026-01-31T11:59:28Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Data properties */  Add new moddable properties that will be available in the next TFE release&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how to use custom (user-defined) AI logics in TFE.&lt;br /&gt;
&lt;br /&gt;
This feature allows modders to create new enemy logics that behave similarly to the &amp;quot;standard&amp;quot; (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids. &lt;br /&gt;
&lt;br /&gt;
To use the feature, check that the &#039;&#039;&#039;Enhanced AI logics&#039;&#039;&#039; setting has been enabled, in Settings → Game Settings → Dark Forces Settings.&lt;br /&gt;
&lt;br /&gt;
=== JSON locations ===&lt;br /&gt;
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations&lt;br /&gt;
&lt;br /&gt;
* DARK\Logics&lt;br /&gt;
* TheForceEngine\Mods\Logics&lt;br /&gt;
* TheForceEngine\Mods\&amp;lt;code&amp;gt;[CURRENTLY LOADED MOD]&amp;lt;/code&amp;gt;\Logics&lt;br /&gt;
&lt;br /&gt;
where DARK is your Dark Forces game directory which TFE is pointing to.&lt;br /&gt;
&lt;br /&gt;
In addition, if you are running a Mod from a ZIP, TFE will look for a &amp;lt;code&amp;gt;\Logics&amp;lt;/code&amp;gt; subfolder inside the ZIP and load logics from any .JSON files found there.&lt;br /&gt;
&lt;br /&gt;
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.&lt;br /&gt;
&lt;br /&gt;
You can have as many logic .JSON files as you want, and each .JSON file can contain as many logics as you want. If multiple logics are loaded that have the same name, only the first one encountered with that name will be used. If you have multiple .JSON files, the order in which they are loaded by TFE is unpredictable, so the only way to be sure that your logics work the way you intend is to avoid duplicate names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Custom logics are loaded when entering Dark Forces from TFE, and cleared when the user exits back to the TFE main menu. Therefore, if JSON files are altered while the game is running, the change will take effect when you quit back to the TFE main menu and then re-enter the game.&lt;br /&gt;
&lt;br /&gt;
=== Logic JSON structure ===&lt;br /&gt;
A logic JSON should consist of a single array called &amp;quot;logics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each element of the &amp;quot;logics&amp;quot; array must consist of two items, in this order&lt;br /&gt;
* &amp;quot;logicName&amp;quot; - a string which is the name of the logic&lt;br /&gt;
* &amp;quot;data&amp;quot; - an object containing properties that are set for the logic&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
   &amp;quot;logics&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicA&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;rifle_bolt&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicB&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 39,&lt;br /&gt;
            &amp;quot;speed&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;thermal_det&amp;quot;,&lt;br /&gt;
            &amp;quot;dropItem&amp;quot;: &amp;quot;red_key&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logic JSONs are &#039;&#039;not&#039;&#039; case sensitive. The text inside the JSON can be all uppercase, all lowercase, or any mix of upper and lowercase; it will all be read the same.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;quot;alertsound&amp;quot;, &amp;quot;ALERTSOUND&amp;quot;, &amp;quot;AlertSound&amp;quot;, &amp;quot;alertSound&amp;quot; will all be accepted.&lt;br /&gt;
&lt;br /&gt;
Further tips about getting the JSON format right can be found on the [[TFE Mod Overrides#How_do_I_create_or_edit_a_MOD_CONF.txt_file_and_what_is_JSON?|TFE MOD Overrides]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data properties ===&lt;br /&gt;
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.&lt;br /&gt;
&lt;br /&gt;
You do not need to set every property. Unset properties will default to the values shown.&lt;br /&gt;
&lt;br /&gt;
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| isFlying || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, will be a flying enemy (like probe droid)&lt;br /&gt;
|-&lt;br /&gt;
| fieldOfView || number (integer) || 210 || Field of view, in degrees. If set to 360, the enemy will be able to see you even if you are standing behind it.&lt;br /&gt;
|- &lt;br /&gt;
| awareRange || number (integer) || 20 || If you are within this distance from the enemy (in DFU), it will be alerted even if you are outside its field of view. (However, this can be affected by other things, such as the ambient light.)&lt;br /&gt;
|-&lt;br /&gt;
| alertSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy is alerted&lt;br /&gt;
|-&lt;br /&gt;
| officerAlerts || boolean || false || If true, the logic will use the Officer alert sounds (eg. &amp;quot;You&#039;re not authorised in this area!&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
| troopAlerts || boolean || false || If true, the logic will use the Trooper alert sounds (eg. &amp;quot;Stop rebel scum!&amp;quot;)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Damage properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| painSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy takes pain&lt;br /&gt;
|- &lt;br /&gt;
| dieSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy dies&lt;br /&gt;
|-&lt;br /&gt;
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.&lt;br /&gt;
|-&lt;br /&gt;
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.&lt;br /&gt;
|- &lt;br /&gt;
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| stopOnDamage || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If false, enemy can keep moving while taking damage. (It is set to false for Gamorreans and Probe Droids)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Attack properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| attack1Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for primary attack&lt;br /&gt;
|- &lt;br /&gt;
| attack2Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| hasMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.&lt;br /&gt;
|-&lt;br /&gt;
| hasRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the enemy will have a ranged attack. If the enemy has a melee attack, the ranged attack will be the secondary attack. If it does not have a melee attack, the ranged attack will be the primary attack.&lt;br /&gt;
|- &lt;br /&gt;
| litWithMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the sprite will light up when it attacks with melee.&lt;br /&gt;
|- &lt;br /&gt;
| litWithRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the sprite will light up when it does its ranged attack.&lt;br /&gt;
|-&lt;br /&gt;
| projectile || string or number || &amp;lt;code&amp;gt;&amp;quot;rifle_bolt&amp;quot;&amp;lt;/code&amp;gt; || What projectile the enemy will fire for its ranged attack. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or &amp;quot;asleep&amp;quot; state. This time is reset when the enemy is re-alerted by the player.&lt;br /&gt;
|-&lt;br /&gt;
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)&lt;br /&gt;
|-&lt;br /&gt;
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks&lt;br /&gt;
|-&lt;br /&gt;
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.&lt;br /&gt;
|- &lt;br /&gt;
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.&lt;br /&gt;
|-&lt;br /&gt;
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.&lt;br /&gt;
|-&lt;br /&gt;
| fireOffset || array of decimal [x, y, z] || [0.0, default, 0.0] || Projectile spawn location relative to enemy&#039;s position and yaw. Default y value is 1 DFU above the middle of the enemy&#039;s vertical size (world height, determined by the size of the sprite)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Thinker properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| speed || number (integer) || 4 || Speed of enemy&#039;s movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.&lt;br /&gt;
|-&lt;br /&gt;
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.&lt;br /&gt;
|-&lt;br /&gt;
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.&lt;br /&gt;
|-&lt;br /&gt;
| approachVariation || number (integer) || 90 || An angle in degrees; affects the way enemies approach the player&lt;br /&gt;
|-&lt;br /&gt;
| approachOffset || number (integer) || 3 || Minimum distance (DFU) that the enemy will approach the player&lt;br /&gt;
|-&lt;br /&gt;
| thinkerDelay || number (integer) || 2 || Average time (in seconds) that the enemy will keep moving in one direction before turning back towards the player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Physics properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| collisionWidth || number (decimal) || default || Minimum distance (DFU) that enemy can approach walls, i.e. half the width of the smallest horizontal gap that it can fit through. Defaults to the the enemy&#039;s world width (determined by the size of the sprite)&lt;br /&gt;
|-&lt;br /&gt;
| collisionHeight || number (decimal) || default || Minimum vertical gap (DFU) that enemy can fit through. Defaults to the enemy&#039;s world height (determined by the size of the sprite)&lt;br /&gt;
|- &lt;br /&gt;
| stepUpHeight || number (decimal) || 3.5 || The maximum step height (difference between floor heights of adjoining sectors) the enemy will be able to &amp;quot;climb&amp;quot; up.&lt;br /&gt;
|-&lt;br /&gt;
| stepDownHeight || number (decimal) || 4.0 || The maximum step height (difference between floor heights of adjoining sectors) a non-flying enemy will be willing to &amp;quot;climb&amp;quot; down. Note 1: flying enemies will override any value set here. Note 2: if a very high value is set, the enemy will be willing to walk off a cliff and may fall to their death.&lt;br /&gt;
|-&lt;br /&gt;
| slideOnCollision || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; for flying enemies, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for non-flying enemies || If true, the enemy will slide against a wall that they collide with, when they are pushed by a force (eg. an explosion or projectile impact)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using custom logics ===&lt;br /&gt;
Logics that you have defined in JSON can be applied to a sprite in the .O file in the same way as other (hardcoded) enemy logics. For example, if you have the following logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;logicName&amp;quot;: &amp;quot;Rodian&amp;quot;,&lt;br /&gt;
      &amp;quot;data&amp;quot;: {&lt;br /&gt;
         &amp;quot;alertSound&amp;quot;: &amp;quot;rodian1.voc&amp;quot;,&lt;br /&gt;
         ....&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC: Rodian&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use JSON-defined logics with generators, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC:         GENERATOR Rodian&lt;br /&gt;
   DELAY:         10&lt;br /&gt;
   INTERVAL:      5&lt;br /&gt;
   NUM_TERMINATE: 6&lt;br /&gt;
   MAX_ALIVE:     1&lt;br /&gt;
   MAX_DIST:      800&lt;br /&gt;
   MIN_DIST:      50&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be &amp;quot;lifeless&amp;quot;. However, if the level has generators with a custom logic, this causes the original game to crash.&lt;br /&gt;
&lt;br /&gt;
=== Overriding hardcoded logics ===&lt;br /&gt;
You &#039;&#039;can&#039;&#039; override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, &amp;lt;code&amp;gt;storm1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;commando&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you override a boss logic, like &amp;lt;code&amp;gt;kell&amp;lt;/code&amp;gt; or one of the dark troopers, the enemy will behave like an ordinary enemy instead of a boss; they will lose their ability to trigger the BOSS elevator when they die.&lt;br /&gt;
&lt;br /&gt;
=== Custom logics and WAX files ===&lt;br /&gt;
A custom logic&#039;s behaviours/actions will correspond to WAX animations as follows&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Walking / moving&lt;br /&gt;
|- &lt;br /&gt;
| 1 || Primary attack&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Melee death&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shooting / explosion death&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Dead&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Idle / stationary&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Primary attack conclusion (eg. recoil)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Secondary attack conclusion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Pain&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This follows the same pattern as all the standard Dark Forces enemies.&lt;br /&gt;
&lt;br /&gt;
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has &#039;&#039;only&#039;&#039; a ranged attack, then this will be the primary attack (animations 1 and 6). If a logic has both melee and ranged attacks, the melee will be primary (animations 1 and 6) and the ranged attack will be secondary (animations 7 and 8).&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
==== Projectile list ====&lt;br /&gt;
You can assign projectiles with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a projectile&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;punch&amp;lt;/code&amp;gt; || This is a special projectile used for the player&#039;s fists, and may not work with logics&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;pistol_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;rifle_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;thermal_det&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;repeater&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;plasma&amp;lt;/code&amp;gt; || Fusion cutter projectile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;mortar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;land_mine&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;land_mine_prox&amp;lt;/code&amp;gt; || Proximity land mine&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;land_mine_placed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;concussion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;cannon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;turret_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;remote_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;exp_barrel&amp;lt;/code&amp;gt; || An invisible projectile that is normally spawned when a barrel explodes&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;homing_missile&amp;lt;/code&amp;gt; || Mohc&#039;s homing missiles&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;probe_proj&amp;lt;/code&amp;gt; || Green interrogator droid projectile&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;bobafett_ball&amp;lt;/code&amp;gt; || Boba Fett&#039;s missiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Drop item list ====&lt;br /&gt;
You can assign drop items with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not drop anything when they die&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;PLANS&amp;lt;/code&amp;gt; || Death Star plans&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;PHRIK&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;NAVA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;DT_WEAPON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;DATATAPE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;RIFLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;AUTOGUN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MORTAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;FUSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;CANNON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;ENERGY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;PLASMA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;DETONATOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;DETONATORS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; || Mortar shell&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;SHELLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;MINE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 19 || &amp;lt;code&amp;gt;MINES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 20 || &amp;lt;code&amp;gt;MISSILE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21 || &amp;lt;code&amp;gt;MISSILES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22 || &amp;lt;code&amp;gt;SHIELD&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 23 || &amp;lt;code&amp;gt;RED_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 24 || &amp;lt;code&amp;gt;YELLOW_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || &amp;lt;code&amp;gt;BLUE_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || &amp;lt;code&amp;gt;GOGGLES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || &amp;lt;code&amp;gt;CLEATS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || &amp;lt;code&amp;gt;MASK&amp;lt;/code&amp;gt; || Gas mask&lt;br /&gt;
|-&lt;br /&gt;
| 29 || &amp;lt;code&amp;gt;BATTERY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 30 || &amp;lt;code&amp;gt;CODE1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 31 || &amp;lt;code&amp;gt;CODE2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || &amp;lt;code&amp;gt;CODE3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 33 || &amp;lt;code&amp;gt;CODE4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &amp;lt;code&amp;gt;CODE5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 35 || &amp;lt;code&amp;gt;CODE6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 36 || &amp;lt;code&amp;gt;CODE7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 37 || &amp;lt;code&amp;gt;CODE8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 38 || &amp;lt;code&amp;gt;CODE9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 39 || &amp;lt;code&amp;gt;INVINCIBLE&amp;lt;/code&amp;gt; || Shield supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 40 || &amp;lt;code&amp;gt;SUPERCHARGE&amp;lt;/code&amp;gt; || Weapon supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 41 || &amp;lt;code&amp;gt;REVIVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 42 || &amp;lt;code&amp;gt;LIFE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 43 || &amp;lt;code&amp;gt;MEDKIT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 44 || &amp;lt;code&amp;gt;PILE&amp;lt;/code&amp;gt; || Kyle&#039;s pile of weapons&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Death effect list ====&lt;br /&gt;
You can assign death effects with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
Note that some effects inflict damage.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a death effect&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;SMALL_EXP&amp;lt;/code&amp;gt; || small &amp;quot;puff&amp;quot; - blaster weapons&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;THERMDET_EXP&amp;lt;/code&amp;gt; || thermal detonator explosion&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;PLASMA_EXP&amp;lt;/code&amp;gt; || Green plasma &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;MORTAR_EXP&amp;lt;/code&amp;gt; || mortar explosion&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt; || concussion - first stage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;CONCUSSION2&amp;lt;/code&amp;gt; || concussion - second stage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;MISSILE_EXP&amp;lt;/code&amp;gt; || missile explosion&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MISSILE_WEAK&amp;lt;/code&amp;gt; || weaker version of the missle explosion&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;PUNCH&amp;lt;/code&amp;gt; || punch&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CANNON_EXP&amp;lt;/code&amp;gt; || Blue cannon &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;REPEATER_EXP&amp;lt;/code&amp;gt; || repeater &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;LARGE_EXP&amp;lt;/code&amp;gt; || Land mine explosion&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;EXP_BARREL&amp;lt;/code&amp;gt; || exploding barrel&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;EXP_INVIS&amp;lt;/code&amp;gt; || an explosion that makes no sound and has no visual effect&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;SPLASH&amp;lt;/code&amp;gt; || water splash&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;EXP_35&amp;lt;/code&amp;gt; || medium explosion, 35 damage (used for probe droid death)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;EXP_NO_DMG&amp;lt;/code&amp;gt; || medium explosion, no damage (used for turret and welder deaths)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;EXP_25&amp;lt;/code&amp;gt; || medium explosion, 25 damage (used for Boba Fett missile explosions)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1573</id>
		<title>TFE Custom Logics</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1573"/>
		<updated>2026-01-31T11:37:45Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Data properties */  Update - divide into groups&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how to use custom (user-defined) AI logics in TFE.&lt;br /&gt;
&lt;br /&gt;
This feature allows modders to create new enemy logics that behave similarly to the &amp;quot;standard&amp;quot; (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids. &lt;br /&gt;
&lt;br /&gt;
To use the feature, check that the &#039;&#039;&#039;Enhanced AI logics&#039;&#039;&#039; setting has been enabled, in Settings → Game Settings → Dark Forces Settings.&lt;br /&gt;
&lt;br /&gt;
=== JSON locations ===&lt;br /&gt;
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations&lt;br /&gt;
&lt;br /&gt;
* DARK\Logics&lt;br /&gt;
* TheForceEngine\Mods\Logics&lt;br /&gt;
* TheForceEngine\Mods\&amp;lt;code&amp;gt;[CURRENTLY LOADED MOD]&amp;lt;/code&amp;gt;\Logics&lt;br /&gt;
&lt;br /&gt;
where DARK is your Dark Forces game directory which TFE is pointing to.&lt;br /&gt;
&lt;br /&gt;
In addition, if you are running a Mod from a ZIP, TFE will look for a &amp;lt;code&amp;gt;\Logics&amp;lt;/code&amp;gt; subfolder inside the ZIP and load logics from any .JSON files found there.&lt;br /&gt;
&lt;br /&gt;
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.&lt;br /&gt;
&lt;br /&gt;
You can have as many logic .JSON files as you want, and each .JSON file can contain as many logics as you want. If multiple logics are loaded that have the same name, only the first one encountered with that name will be used. If you have multiple .JSON files, the order in which they are loaded by TFE is unpredictable, so the only way to be sure that your logics work the way you intend is to avoid duplicate names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Custom logics are loaded when entering Dark Forces from TFE, and cleared when the user exits back to the TFE main menu. Therefore, if JSON files are altered while the game is running, the change will take effect when you quit back to the TFE main menu and then re-enter the game.&lt;br /&gt;
&lt;br /&gt;
=== Logic JSON structure ===&lt;br /&gt;
A logic JSON should consist of a single array called &amp;quot;logics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each element of the &amp;quot;logics&amp;quot; array must consist of two items, in this order&lt;br /&gt;
* &amp;quot;logicName&amp;quot; - a string which is the name of the logic&lt;br /&gt;
* &amp;quot;data&amp;quot; - an object containing properties that are set for the logic&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
   &amp;quot;logics&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicA&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;rifle_bolt&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicB&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 39,&lt;br /&gt;
            &amp;quot;speed&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;thermal_det&amp;quot;,&lt;br /&gt;
            &amp;quot;dropItem&amp;quot;: &amp;quot;red_key&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logic JSONs are &#039;&#039;not&#039;&#039; case sensitive. The text inside the JSON can be all uppercase, all lowercase, or any mix of upper and lowercase; it will all be read the same.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;quot;alertsound&amp;quot;, &amp;quot;ALERTSOUND&amp;quot;, &amp;quot;AlertSound&amp;quot;, &amp;quot;alertSound&amp;quot; will all be accepted.&lt;br /&gt;
&lt;br /&gt;
Further tips about getting the JSON format right can be found on the [[TFE Mod Overrides#How_do_I_create_or_edit_a_MOD_CONF.txt_file_and_what_is_JSON?|TFE MOD Overrides]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data properties ===&lt;br /&gt;
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.&lt;br /&gt;
&lt;br /&gt;
You do not need to set every property. Unset properties will default to the values shown.&lt;br /&gt;
&lt;br /&gt;
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| isFlying || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, will be a flying enemy (like probe droid)&lt;br /&gt;
|-&lt;br /&gt;
| fieldOfView || number (integer) || 210 || Field of view, in degrees. If set to 360, the enemy will be able to see you even if you are standing behind it.&lt;br /&gt;
|- &lt;br /&gt;
| awareRange || number (integer) || 20 || If you are within this distance from the enemy (in DFU), it will be alerted even if you are outside its field of view. (However, this can be affected by other things, such as the ambient light.)&lt;br /&gt;
|-&lt;br /&gt;
| alertSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy is alerted&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Damage properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| painSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy takes pain&lt;br /&gt;
|- &lt;br /&gt;
| dieSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy dies&lt;br /&gt;
|-&lt;br /&gt;
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.&lt;br /&gt;
|-&lt;br /&gt;
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.&lt;br /&gt;
|- &lt;br /&gt;
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| stopOnDamage || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If false, enemy can keep moving while taking damage. (It is set to false for Gamorreans and Probe Droids)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Attack properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| attack1Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for primary attack&lt;br /&gt;
|- &lt;br /&gt;
| attack2Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| hasMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.&lt;br /&gt;
|-&lt;br /&gt;
| hasRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the enemy will have a ranged attack. If the enemy has a melee attack, the ranged attack will be the secondary attack. If it does not have a melee attack, the ranged attack will be the primary attack.&lt;br /&gt;
|- &lt;br /&gt;
| litWithMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the sprite will light up when it attacks with melee.&lt;br /&gt;
|- &lt;br /&gt;
| litWithRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the sprite will light up when it does its ranged attack.&lt;br /&gt;
|-&lt;br /&gt;
| projectile || string or number || &amp;lt;code&amp;gt;&amp;quot;rifle_bolt&amp;quot;&amp;lt;/code&amp;gt; || What projectile the enemy will fire for its ranged attack. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or &amp;quot;asleep&amp;quot; state. This time is reset when the enemy is re-alerted by the player.&lt;br /&gt;
|-&lt;br /&gt;
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)&lt;br /&gt;
|-&lt;br /&gt;
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks&lt;br /&gt;
|-&lt;br /&gt;
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.&lt;br /&gt;
|- &lt;br /&gt;
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.&lt;br /&gt;
|-&lt;br /&gt;
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.&lt;br /&gt;
|-&lt;br /&gt;
| fireOffset || array of decimal [x, y, z] || [0.0, default, 0.0] || Projectile spawn location relative to enemy&#039;s position and yaw. Default y value is 1 DFU above the middle of the enemy&#039;s vertical size (world height, determined by the size of the sprite)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Thinker properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| speed || number (integer) || 4 || Speed of enemy&#039;s movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.&lt;br /&gt;
|-&lt;br /&gt;
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.&lt;br /&gt;
|-&lt;br /&gt;
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.&lt;br /&gt;
|-&lt;br /&gt;
| approachVariation || number (integer) || 90 || An angle in degrees; affects the way enemies approach the player&lt;br /&gt;
|-&lt;br /&gt;
| approachOffset || number (integer) || 3 || Minimum distance (DFU) that the enemy will approach the player&lt;br /&gt;
|-&lt;br /&gt;
| thinkerDelay || number (integer) || 2 || Average time (in seconds) that the enemy will keep moving in one direction before turning back towards the player&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Physics properties ====&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| collisionWidth || number (decimal) || default || Minimum distance (DFU) that enemy can approach walls, i.e. half the width of the smallest horizontal gap that it can fit through. Defaults to the the enemy&#039;s world width (determined by the size of the sprite)&lt;br /&gt;
|-&lt;br /&gt;
| collisionHeight || number (decimal) || default || Minimum vertical gap (DFU) that enemy can fit through. Defaults to the enemy&#039;s world height (determined by the size of the sprite)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using custom logics ===&lt;br /&gt;
Logics that you have defined in JSON can be applied to a sprite in the .O file in the same way as other (hardcoded) enemy logics. For example, if you have the following logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;logicName&amp;quot;: &amp;quot;Rodian&amp;quot;,&lt;br /&gt;
      &amp;quot;data&amp;quot;: {&lt;br /&gt;
         &amp;quot;alertSound&amp;quot;: &amp;quot;rodian1.voc&amp;quot;,&lt;br /&gt;
         ....&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC: Rodian&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use JSON-defined logics with generators, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC:         GENERATOR Rodian&lt;br /&gt;
   DELAY:         10&lt;br /&gt;
   INTERVAL:      5&lt;br /&gt;
   NUM_TERMINATE: 6&lt;br /&gt;
   MAX_ALIVE:     1&lt;br /&gt;
   MAX_DIST:      800&lt;br /&gt;
   MIN_DIST:      50&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be &amp;quot;lifeless&amp;quot;. However, if the level has generators with a custom logic, this causes the original game to crash.&lt;br /&gt;
&lt;br /&gt;
=== Overriding hardcoded logics ===&lt;br /&gt;
You &#039;&#039;can&#039;&#039; override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, &amp;lt;code&amp;gt;storm1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;commando&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you override a boss logic, like &amp;lt;code&amp;gt;kell&amp;lt;/code&amp;gt; or one of the dark troopers, the enemy will behave like an ordinary enemy instead of a boss; they will lose their ability to trigger the BOSS elevator when they die.&lt;br /&gt;
&lt;br /&gt;
=== Custom logics and WAX files ===&lt;br /&gt;
A custom logic&#039;s behaviours/actions will correspond to WAX animations as follows&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Walking / moving&lt;br /&gt;
|- &lt;br /&gt;
| 1 || Primary attack&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Melee death&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shooting / explosion death&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Dead&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Idle / stationary&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Primary attack conclusion (eg. recoil)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Secondary attack conclusion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Pain&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This follows the same pattern as all the standard Dark Forces enemies.&lt;br /&gt;
&lt;br /&gt;
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has &#039;&#039;only&#039;&#039; a ranged attack, then this will be the primary attack (animations 1 and 6). If a logic has both melee and ranged attacks, the melee will be primary (animations 1 and 6) and the ranged attack will be secondary (animations 7 and 8).&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
==== Projectile list ====&lt;br /&gt;
You can assign projectiles with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a projectile&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;punch&amp;lt;/code&amp;gt; || This is a special projectile used for the player&#039;s fists, and may not work with logics&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;pistol_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;rifle_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;thermal_det&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;repeater&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;plasma&amp;lt;/code&amp;gt; || Fusion cutter projectile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;mortar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;land_mine&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;land_mine_prox&amp;lt;/code&amp;gt; || Proximity land mine&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;land_mine_placed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;concussion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;cannon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;turret_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;remote_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;exp_barrel&amp;lt;/code&amp;gt; || An invisible projectile that is normally spawned when a barrel explodes&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;homing_missile&amp;lt;/code&amp;gt; || Mohc&#039;s homing missiles&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;probe_proj&amp;lt;/code&amp;gt; || Green interrogator droid projectile&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;bobafett_ball&amp;lt;/code&amp;gt; || Boba Fett&#039;s missiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Drop item list ====&lt;br /&gt;
You can assign drop items with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not drop anything when they die&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;PLANS&amp;lt;/code&amp;gt; || Death Star plans&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;PHRIK&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;NAVA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;DT_WEAPON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;DATATAPE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;RIFLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;AUTOGUN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MORTAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;FUSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;CANNON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;ENERGY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;PLASMA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;DETONATOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;DETONATORS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; || Mortar shell&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;SHELLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;MINE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 19 || &amp;lt;code&amp;gt;MINES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 20 || &amp;lt;code&amp;gt;MISSILE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21 || &amp;lt;code&amp;gt;MISSILES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22 || &amp;lt;code&amp;gt;SHIELD&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 23 || &amp;lt;code&amp;gt;RED_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 24 || &amp;lt;code&amp;gt;YELLOW_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || &amp;lt;code&amp;gt;BLUE_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || &amp;lt;code&amp;gt;GOGGLES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || &amp;lt;code&amp;gt;CLEATS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || &amp;lt;code&amp;gt;MASK&amp;lt;/code&amp;gt; || Gas mask&lt;br /&gt;
|-&lt;br /&gt;
| 29 || &amp;lt;code&amp;gt;BATTERY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 30 || &amp;lt;code&amp;gt;CODE1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 31 || &amp;lt;code&amp;gt;CODE2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || &amp;lt;code&amp;gt;CODE3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 33 || &amp;lt;code&amp;gt;CODE4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &amp;lt;code&amp;gt;CODE5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 35 || &amp;lt;code&amp;gt;CODE6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 36 || &amp;lt;code&amp;gt;CODE7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 37 || &amp;lt;code&amp;gt;CODE8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 38 || &amp;lt;code&amp;gt;CODE9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 39 || &amp;lt;code&amp;gt;INVINCIBLE&amp;lt;/code&amp;gt; || Shield supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 40 || &amp;lt;code&amp;gt;SUPERCHARGE&amp;lt;/code&amp;gt; || Weapon supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 41 || &amp;lt;code&amp;gt;REVIVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 42 || &amp;lt;code&amp;gt;LIFE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 43 || &amp;lt;code&amp;gt;MEDKIT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 44 || &amp;lt;code&amp;gt;PILE&amp;lt;/code&amp;gt; || Kyle&#039;s pile of weapons&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Death effect list ====&lt;br /&gt;
You can assign death effects with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
Note that some effects inflict damage.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a death effect&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;SMALL_EXP&amp;lt;/code&amp;gt; || small &amp;quot;puff&amp;quot; - blaster weapons&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;THERMDET_EXP&amp;lt;/code&amp;gt; || thermal detonator explosion&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;PLASMA_EXP&amp;lt;/code&amp;gt; || Green plasma &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;MORTAR_EXP&amp;lt;/code&amp;gt; || mortar explosion&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt; || concussion - first stage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;CONCUSSION2&amp;lt;/code&amp;gt; || concussion - second stage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;MISSILE_EXP&amp;lt;/code&amp;gt; || missile explosion&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MISSILE_WEAK&amp;lt;/code&amp;gt; || weaker version of the missle explosion&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;PUNCH&amp;lt;/code&amp;gt; || punch&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CANNON_EXP&amp;lt;/code&amp;gt; || Blue cannon &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;REPEATER_EXP&amp;lt;/code&amp;gt; || repeater &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;LARGE_EXP&amp;lt;/code&amp;gt; || Land mine explosion&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;EXP_BARREL&amp;lt;/code&amp;gt; || exploding barrel&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;EXP_INVIS&amp;lt;/code&amp;gt; || an explosion that makes no sound and has no visual effect&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;SPLASH&amp;lt;/code&amp;gt; || water splash&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;EXP_35&amp;lt;/code&amp;gt; || medium explosion, 35 damage (used for probe droid death)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;EXP_NO_DMG&amp;lt;/code&amp;gt; || medium explosion, no damage (used for turret and welder deaths)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;EXP_25&amp;lt;/code&amp;gt; || medium explosion, 25 damage (used for Boba Fett missile explosions)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1572</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1572"/>
		<updated>2025-09-26T07:14:47Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Object Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;Projectile&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PUNCH&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PISTOL_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_RIFLE_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_THERMAL_DET&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_REPEATER&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PLASMA&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_MORTAR&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE_PROX&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE_PLACED&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_CONCUSSION&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_CANNON&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_MISSILE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_TURRET_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_REMOTE_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_EXP_BARREL&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_HOMING_MISSILE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PROBE_PROJ&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_BOBAFETT_BALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;LogicSound&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SND_ALERT&lt;br /&gt;
|- &lt;br /&gt;
| SND_PAIN&lt;br /&gt;
|-&lt;br /&gt;
| SND_DIE&lt;br /&gt;
|-&lt;br /&gt;
| SND_ATTACK1&lt;br /&gt;
|- &lt;br /&gt;
| SND_ATTACK2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties: Logics ==&lt;br /&gt;
The following properties apply to objects that have an AI logic.&lt;br /&gt;
&lt;br /&gt;
=== hitPoints ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the logic&#039;s hitpoints. Works for all AIs including bosses, scenery, and barrels&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.hitpoints = 100;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the logic&#039;s velocity (float3). Works for bosses as well as ordinary AIs.&lt;br /&gt;
* Usage example: set logic&#039;s velocity to 60 units upwards and 40 units northward&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trooper.velocity = {0.0, 60.0, 40.0};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== projectile ===&lt;br /&gt;
* Set only&lt;br /&gt;
* Sets the logic&#039;s attack projectile. Only works on ordinary enemies (including custom logics), not bosses&lt;br /&gt;
* Usage example: change the logic&#039;s projectile to mortars&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
commando.projectile = PROJ_MORTAR;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Scripting functions will internally do an &#039;&#039;exists&#039;&#039; check before being executed. Therefore it is not necessary for you to check that an object exists in ForceScript before calling methods on it. If you try to manipulate an object (eg. set its position) that doesn&#039;t exist, nothing will happen. If you &#039;&#039;get&#039;&#039; a property from a non-existent object, a default value will be returned (usually zero).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;exists()&amp;lt;/code&amp;gt; function in ForceScript enables you to check for an object&#039;s existence so that you can make your script logic conditional on an object&#039;s existence. For example, you may want your script to do something only if a certain enemy has been killed, or a certain item has been collected.&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
ds.matchPosition(target);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== delete() ===&lt;br /&gt;
* Removes the object from the level&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;ewok2.delete();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addLogic(string) ===&lt;br /&gt;
* Adds a logic to the object. Works with scenery, enemy logics, and pickup items. (Still to do: enable adding a custom logic.)&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// turn the table into scenery so it becomes breakable&lt;br /&gt;
table.addLogic(&amp;quot;scenery&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add Nava card logic to the object so it can now be picked up&lt;br /&gt;
navcard.addLogic(&amp;quot;nava&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add commando logic&lt;br /&gt;
com5.addLogic(&amp;quot;commando&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setCamera() ===&lt;br /&gt;
* Set the camera (EYE) to the object&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object cutsceneCam = level.getObject(&amp;quot;camera9&amp;quot;);&lt;br /&gt;
cutsceneCam.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType) ===&lt;br /&gt;
* Sends a message to the object&lt;br /&gt;
* Parameter: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; that can be sent to objects&lt;br /&gt;
** &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt; - if the object has an AI logic, this message will change it from idle state to alerted state (does not work on bosses)&lt;br /&gt;
** &amp;lt;code&amp;gt;CRUSH&amp;lt;/code&amp;gt; - if the object has an AI logic, instantly kills it (does not work on bosses)&lt;br /&gt;
&lt;br /&gt;
Usage example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Alerts the gamorrean guard&lt;br /&gt;
Object gamor = level.getObject(&amp;quot;gamguard&amp;quot;);&lt;br /&gt;
gamor.sendMessage(WAKEUP);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1571</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1571"/>
		<updated>2025-09-26T06:54:35Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Enums&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
=== &amp;lt;code&amp;gt;Projectile&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PUNCH&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PISTOL_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_RIFLE_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_THERMAL_DET&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_REPEATER&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PLASMA&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_MORTAR&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE_PROX&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_LAND_MINE_PLACED&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_CONCUSSION&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_CANNON&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_MISSILE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_TURRET_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_REMOTE_BOLT&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_EXP_BARREL&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_HOMING_MISSILE&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_PROBE_PROJ&lt;br /&gt;
|- &lt;br /&gt;
| PROJ_BOBAFETT_BALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;LogicSound&amp;lt;/code&amp;gt; enum ===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| SND_ALERT&lt;br /&gt;
|- &lt;br /&gt;
| SND_PAIN&lt;br /&gt;
|-&lt;br /&gt;
| SND_DIE&lt;br /&gt;
|-&lt;br /&gt;
| SND_ATTACK1&lt;br /&gt;
|- &lt;br /&gt;
| SND_ATTACK2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Scripting functions will internally do an &#039;&#039;exists&#039;&#039; check before being executed. Therefore it is not necessary for you to check that an object exists in ForceScript before calling methods on it. If you try to manipulate an object (eg. set its position) that doesn&#039;t exist, nothing will happen. If you &#039;&#039;get&#039;&#039; a property from a non-existent object, a default value will be returned (usually zero).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;exists()&amp;lt;/code&amp;gt; function in ForceScript enables you to check for an object&#039;s existence so that you can make your script logic conditional on an object&#039;s existence. For example, you may want your script to do something only if a certain enemy has been killed, or a certain item has been collected.&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
ds.matchPosition(target);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== delete() ===&lt;br /&gt;
* Removes the object from the level&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;ewok2.delete();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addLogic(string) ===&lt;br /&gt;
* Adds a logic to the object. Works with scenery, enemy logics, and pickup items. (Still to do: enable adding a custom logic.)&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// turn the table into scenery so it becomes breakable&lt;br /&gt;
table.addLogic(&amp;quot;scenery&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add Nava card logic to the object so it can now be picked up&lt;br /&gt;
navcard.addLogic(&amp;quot;nava&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add commando logic&lt;br /&gt;
com5.addLogic(&amp;quot;commando&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setCamera() ===&lt;br /&gt;
* Set the camera (EYE) to the object&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object cutsceneCam = level.getObject(&amp;quot;camera9&amp;quot;);&lt;br /&gt;
cutsceneCam.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType) ===&lt;br /&gt;
* Sends a message to the object&lt;br /&gt;
* Parameter: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; that can be sent to objects&lt;br /&gt;
** &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt; - if the object has an AI logic, this message will change it from idle state to alerted state (does not work on bosses)&lt;br /&gt;
** &amp;lt;code&amp;gt;CRUSH&amp;lt;/code&amp;gt; - if the object has an AI logic, instantly kills it (does not work on bosses)&lt;br /&gt;
&lt;br /&gt;
Usage example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Alerts the gamorrean guard&lt;br /&gt;
Object gamor = level.getObject(&amp;quot;gamguard&amp;quot;);&lt;br /&gt;
gamor.sendMessage(WAKEUP);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1570</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1570"/>
		<updated>2025-09-26T06:41:16Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Object Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Scripting functions will internally do an &#039;&#039;exists&#039;&#039; check before being executed. Therefore it is not necessary for you to check that an object exists in ForceScript before calling methods on it. If you try to manipulate an object (eg. set its position) that doesn&#039;t exist, nothing will happen. If you &#039;&#039;get&#039;&#039; a property from a non-existent object, a default value will be returned (usually zero).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;exists()&amp;lt;/code&amp;gt; function in ForceScript enables you to check for an object&#039;s existence so that you can make your script logic conditional on an object&#039;s existence. For example, you may want your script to do something only if a certain enemy has been killed, or a certain item has been collected.&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
ds.matchPosition(target);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== delete() ===&lt;br /&gt;
* Removes the object from the level&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;ewok2.delete();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addLogic(string) ===&lt;br /&gt;
* Adds a logic to the object. Works with scenery, enemy logics, and pickup items. (Still to do: enable adding a custom logic.)&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// turn the table into scenery so it becomes breakable&lt;br /&gt;
table.addLogic(&amp;quot;scenery&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add Nava card logic to the object so it can now be picked up&lt;br /&gt;
navcard.addLogic(&amp;quot;nava&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add commando logic&lt;br /&gt;
com5.addLogic(&amp;quot;commando&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setCamera() ===&lt;br /&gt;
* Set the camera (EYE) to the object&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object cutsceneCam = level.getObject(&amp;quot;camera9&amp;quot;);&lt;br /&gt;
cutsceneCam.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType) ===&lt;br /&gt;
* Sends a message to the object&lt;br /&gt;
* Parameter: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; that can be sent to objects&lt;br /&gt;
** &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt; - if the object has an AI logic, this message will change it from idle state to alerted state (does not work on bosses)&lt;br /&gt;
** &amp;lt;code&amp;gt;CRUSH&amp;lt;/code&amp;gt; - if the object has an AI logic, instantly kills it (does not work on bosses)&lt;br /&gt;
&lt;br /&gt;
Usage example&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// Alerts the gamorrean guard&lt;br /&gt;
Object gamor = level.getObject(&amp;quot;gamguard&amp;quot;);&lt;br /&gt;
gamor.sendMessage(WAKEUP);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Elevator&amp;diff=1569</id>
		<title>Script Elevator</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Elevator&amp;diff=1569"/>
		<updated>2025-09-26T06:34:50Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;== Properties ==  === master === * Get only * Return value: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if master is on, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if master is off  === speed === * Get or set * Gets or sets the speed of an elevator&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== master ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Return value: &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if master is on, &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; if master is off&lt;br /&gt;
&lt;br /&gt;
=== speed ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the speed of an elevator&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1568</id>
		<title>Script Sector</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1568"/>
		<updated>2025-09-26T06:29:02Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== floorHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== secondHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ambient ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== wallCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
&lt;br /&gt;
=== floorTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== floorTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== isValid() ===&lt;br /&gt;
&lt;br /&gt;
=== isFlagSet(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== clearFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== setFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== getCenterXZ() ===&lt;br /&gt;
&lt;br /&gt;
=== getWall(int) ===&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType) ===&lt;br /&gt;
* Sends a message to sector&lt;br /&gt;
* Parameters: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum&lt;br /&gt;
* Return value: void&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; that can be sent to sectors:&lt;br /&gt;
** &amp;lt;code&amp;gt;M_TRIGGER&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;NEXT_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;PREV_STOP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;WAKEUP&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MASTER_ON&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;MASTER_OFF&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Sector myElev = level.getSector(&amp;quot;elev1&amp;quot;);&lt;br /&gt;
myElev.sendMessage(NEXT_STOP);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendMessage(MessageType, uint) ===&lt;br /&gt;
* Sends a message to sector with an event&lt;br /&gt;
* Parameters: &amp;lt;code&amp;gt;MessageType&amp;lt;/code&amp;gt; enum, event&lt;br /&gt;
* Return value: void&lt;br /&gt;
&lt;br /&gt;
* Valid &amp;lt;code&amp;gt;MessageTypes&amp;lt;/code&amp;gt; are as above.&lt;br /&gt;
&lt;br /&gt;
Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Sector myElev = level.getSector(&amp;quot;elev1&amp;quot;);&lt;br /&gt;
myElev.sendMessage(NEXT_STOP, 131072);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the equivalent of sending a message via INF like this - &amp;lt;code&amp;gt;message: 1 elev1 NEXT_STOP 131072&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1567</id>
		<title>Script Sector</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Sector&amp;diff=1567"/>
		<updated>2025-09-26T06:15:02Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;== Properties ==  === floorHeight === * Get or set  === ceilHeight === * Get or set  === secondHeight === * Get or set  === ambient === * Get or set  === wallCount === * Get only  === floorTexture === * Get or set  === ceilTexture === * Get or set  === floorTextureOffset === * Get or set  === ceilTextureOffset === * Get or set   == Methods ==  === isValid() ===  === isFlagSet(int, uint) ===  === clearFlag(int, uint) ===  === setFlag(int, uint) ===  === getCenterXZ() ===...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== floorHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== secondHeight ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ambient ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== wallCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
&lt;br /&gt;
=== floorTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTexture ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== floorTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
=== ceilTextureOffset ===&lt;br /&gt;
* Get or set&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== isValid() ===&lt;br /&gt;
&lt;br /&gt;
=== isFlagSet(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== clearFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== setFlag(int, uint) ===&lt;br /&gt;
&lt;br /&gt;
=== getCenterXZ() ===&lt;br /&gt;
&lt;br /&gt;
=== getWall(int) ===&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1565</id>
		<title>Camera feature</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1565"/>
		<updated>2025-09-02T12:15:25Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).&lt;br /&gt;
&lt;br /&gt;
TFE now allows the camera to be moved to a different object at any time during gameplay. This allows for various effects such as&lt;br /&gt;
* Being able to look through security cameras&lt;br /&gt;
* Better in-game &amp;quot;cutscenes&amp;quot; / cinematic sequences&lt;br /&gt;
* The ability to switch between first-person and third-person perspectives&lt;br /&gt;
&lt;br /&gt;
See also: [[VUE Camera transforms]]&lt;br /&gt;
&lt;br /&gt;
There are two ways to move the camera: via INF, or via ForceScript.&lt;br /&gt;
&lt;br /&gt;
The camera (Eye) can be moved to any kind of object: a Spirit (invisible), an enemy, a scenery, a 3DO, etc. Be warned that if the object is destroyed while the camera is on it (eg. the enemy is killed) the game will crash.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with INF ==&lt;br /&gt;
The first step is to designate an object as a camera. This is done in the O file by using the new keyword &amp;lt;code&amp;gt;CAMERA&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CLASS: 3D      DATA:  0 X: 160.00 Y: -18.00 Z: 332.00 PCH: -25.00 YAW: 90.00 ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  CAMERA&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new CAMERA message has been added to INF. It can be sent the same way as other messages, either from a trigger or from an elevator stop. The following example shows it being sent from a trigger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item: line   name: room1  num: 2&lt;br /&gt;
 seq&lt;br /&gt;
   class: trigger standard&lt;br /&gt;
     event_mask: 16&lt;br /&gt;
     client: camsec2&lt;br /&gt;
     message: CAMERA&lt;br /&gt;
 seqend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the message is sent:&lt;br /&gt;
* If the camera is currently on the player, the game will search the target sector (&amp;quot;camsec2&amp;quot; in this example) for a camera object. When it finds one, it will move the camera to that object. If no camera object is found in the target sector, nothing will happen.&lt;br /&gt;
* If the camera is currently &#039;&#039;not&#039;&#039; on the player, the camera will be moved back to the player.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with ForceScript ==&lt;br /&gt;
To move the camera to an object with ForceScript, call the &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; function on that object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myobject.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To move the camera to the player, call &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; on the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Freezing the player ==&lt;br /&gt;
When the camera is not on the player, the player can ordinarily still move around, jump, shoot and so on. It might be desirable (eg. during a cutscene) to freeze the player&#039;s movement while the camera is somewhere else.&lt;br /&gt;
&lt;br /&gt;
To do this, the &amp;lt;code&amp;gt;disableActions()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enableActions()&amp;lt;/code&amp;gt; functions from the [[Player_Script_API#Methods|Player Script API]] can be used.&lt;br /&gt;
&lt;br /&gt;
== Other player actions ==&lt;br /&gt;
Night vision goggles are automatically disabled when the camera is not on the player.&lt;br /&gt;
&lt;br /&gt;
Gas mask and headlamp are still usable when the camera is not on the player, and will continue to drain battery. (Headlamp light will not be visible.)&lt;br /&gt;
&lt;br /&gt;
The player will still take damage and can be killed while the camera is somewhere else. If the player dies while the camera is somewhere else, the camera will be reset to the player when he respawns.&lt;br /&gt;
&lt;br /&gt;
== Enemy behaviour ==&lt;br /&gt;
As per default Dark Forces behaviour, enemies will shoot towards the camera (EYE) instead of the player. This is something that might be changed at a later point.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1564</id>
		<title>Camera feature</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1564"/>
		<updated>2025-09-02T12:12:42Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).&lt;br /&gt;
&lt;br /&gt;
TFE now allows the camera to be moved to a different object at any time during gameplay. This allows for various effects such as&lt;br /&gt;
* Being able to look through security cameras&lt;br /&gt;
* Better in-game &amp;quot;cutscenes&amp;quot; / cinematic sequences&lt;br /&gt;
* The ability to switch between first-person and third-person perspectives&lt;br /&gt;
&lt;br /&gt;
See also: [[VUE Camera transforms]]&lt;br /&gt;
&lt;br /&gt;
There are two ways to move the camera: via INF, or via ForceScript.&lt;br /&gt;
&lt;br /&gt;
The camera (Eye) can be moved to any kind of object: a Spirit (invisible), an enemy, a scenery, a 3DO, etc. Be warned that if the object is destroyed while the camera is on it (eg. the enemy is killed) the game will crash.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with INF ==&lt;br /&gt;
The first step is to designate an object as a camera. This is done in the O file by using the new keyword &amp;lt;code&amp;gt;CAMERA&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CLASS: 3D      DATA:  0 X: 160.00 Y: -18.00 Z: 332.00 PCH: -25.00 YAW: 90.00 ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  CAMERA&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new CAMERA message has been added to INF. It can be sent the same way as other messages, either from a trigger or from an elevator stop. The following example shows it being sent from a trigger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item: line   name: room1  num: 2&lt;br /&gt;
 seq&lt;br /&gt;
   class: trigger standard&lt;br /&gt;
     event_mask: 16&lt;br /&gt;
     client: camsec2&lt;br /&gt;
     message: CAMERA&lt;br /&gt;
 seqend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the message is sent:&lt;br /&gt;
* If the camera is currently on the player, the game will search the target sector (&amp;quot;camsec2&amp;quot; in this example) for a camera object. When it finds one, it will move the camera to that object. If no camera object is found in the target sector, nothing will happen.&lt;br /&gt;
* If the camera is currently &#039;&#039;not&#039;&#039; on the player, the camera will be moved back to the player.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with ForceScript ==&lt;br /&gt;
To move the camera to an object with ForceScript, call the &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; function on that object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myobject.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To move the camera to the player, call &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; on the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Freezing the player ==&lt;br /&gt;
When the camera is not on the player, the player can ordinarily still move around, jump, shoot and so on. It might be desirable (eg. during a cutscene) to freeze the player&#039;s movement while the camera is somewhere else.&lt;br /&gt;
&lt;br /&gt;
To do this, the &amp;lt;code&amp;gt;disableActions()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enableActions()&amp;lt;/code&amp;gt; functions from the [[Player_Script_API#Methods|Player Script API]] can be used.&lt;br /&gt;
&lt;br /&gt;
== Other player actions ==&lt;br /&gt;
Night vision goggles are automatically disabled when the camera is not on the player.&lt;br /&gt;
&lt;br /&gt;
Gas mask and headlamp are still usable when the camera is not on the player, and will continue to drain battery. (Headlamp light will not be visible.)&lt;br /&gt;
&lt;br /&gt;
The player will still take damage and can be killed while the camera is somewhere else. If the player dies while the camera is somewhere else, the camera will be reset to the player when he respawns.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1563</id>
		<title>Camera feature</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1563"/>
		<updated>2025-09-02T12:06:25Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Move with ForceScript&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).&lt;br /&gt;
&lt;br /&gt;
TFE now allows the camera to be moved to a different object at any time during gameplay. This allows for various effects such as&lt;br /&gt;
* Being able to look through security cameras&lt;br /&gt;
* Better in-game &amp;quot;cutscenes&amp;quot; / cinematic sequences&lt;br /&gt;
* The ability to switch between first-person and third-person perspectives&lt;br /&gt;
&lt;br /&gt;
See also: [[VUE Camera transforms]]&lt;br /&gt;
&lt;br /&gt;
There are two ways to move the camera: via INF, or via ForceScript.&lt;br /&gt;
&lt;br /&gt;
The camera (Eye) can be moved to any kind of object: a Spirit (invisible), an enemy, a scenery, a 3DO, etc. Be warned that if the object is destroyed while the camera is on it (eg. the enemy is killed) the game will crash.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with INF ==&lt;br /&gt;
The first step is to designate an object as a camera. This is done in the O file by using the new keyword &amp;lt;code&amp;gt;CAMERA&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CLASS: 3D      DATA:  0 X: 160.00 Y: -18.00 Z: 332.00 PCH: -25.00 YAW: 90.00 ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  CAMERA&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new CAMERA message has been added to INF. It can be sent the same way as other messages, either from a trigger or from an elevator stop. The following example shows it being sent from a trigger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item: line   name: room1  num: 2&lt;br /&gt;
 seq&lt;br /&gt;
   class: trigger standard&lt;br /&gt;
     event_mask: 16&lt;br /&gt;
     client: camsec2&lt;br /&gt;
     message: CAMERA&lt;br /&gt;
 seqend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the message is sent:&lt;br /&gt;
* If the camera is currently on the player, the game will search the target sector (&amp;quot;camsec2&amp;quot; in this example) for a camera object. When it finds one, it will move the camera to that object. If no camera object is found in the target sector, nothing will happen.&lt;br /&gt;
* If the camera is currently &#039;&#039;not&#039;&#039; on the player, the camera will be moved back to the player.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with ForceScript ==&lt;br /&gt;
To move the camera to an object with ForceScript, call the &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; function on that object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myobject.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To move the camera to the player, call &amp;lt;code&amp;gt;setCamera()&amp;lt;/code&amp;gt; on the player.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Freezing the player ==&lt;br /&gt;
When the camera is not on the player, the player can ordinarily still move around, jump, shoot and so on. It might be desirable (eg. during a cutscene) to freeze the player&#039;s movement while the camera is somewhere else.&lt;br /&gt;
&lt;br /&gt;
To do this, the &amp;lt;code&amp;gt;disableActions()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;enableActions()&amp;lt;/code&amp;gt; functions from the [[Player_Script_API#Methods|Player Script API]] can be used.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1562</id>
		<title>Camera feature</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1562"/>
		<updated>2025-09-02T11:55:06Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Move by INF&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).&lt;br /&gt;
&lt;br /&gt;
TFE now allows the camera to be moved to a different object at any time during gameplay. This allows for various effects such as&lt;br /&gt;
* Being able to look through security cameras&lt;br /&gt;
* Better in-game &amp;quot;cutscenes&amp;quot; / cinematic sequences&lt;br /&gt;
* The ability to switch between first-person and third-person perspectives&lt;br /&gt;
&lt;br /&gt;
See also: [[VUE Camera transforms]]&lt;br /&gt;
&lt;br /&gt;
There are two ways to move the camera: via INF, or via ForceScript.&lt;br /&gt;
&lt;br /&gt;
The camera (Eye) can be moved to any kind of object: a Spirit (invisible), an enemy, a scenery, a 3DO, etc. Be warned that if the object is destroyed while the camera is on it (eg. the enemy is killed) the game will crash.&lt;br /&gt;
&lt;br /&gt;
== Moving the camera with INF ==&lt;br /&gt;
The first step is to designate an object as a camera. This is done in the O file by using the new keyword &amp;lt;code&amp;gt;CAMERA&amp;lt;/code&amp;gt; as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CLASS: 3D      DATA:  0 X: 160.00 Y: -18.00 Z: 332.00 PCH: -25.00 YAW: 90.00 ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  CAMERA&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A new CAMERA message has been added to INF. It can be sent the same way as other messages, either from a trigger or from an elevator stop. The following example shows it being sent from a trigger.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
item: line   name: room1  num: 2&lt;br /&gt;
 seq&lt;br /&gt;
   class: trigger standard&lt;br /&gt;
     event_mask: 16&lt;br /&gt;
     client: camsec2&lt;br /&gt;
     message: CAMERA&lt;br /&gt;
 seqend&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the message is sent:&lt;br /&gt;
* If the camera is currently on the player, the game will search the target sector (&amp;quot;camsec2&amp;quot; in this example) for a camera object. When it finds one, it will move the camera to that object. If no camera object is found in the target sector, nothing will happen.&lt;br /&gt;
* If the camera is currently &#039;&#039;not&#039;&#039; on the player, the camera will be moved back to the player.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=VUE_Camera_transforms&amp;diff=1561</id>
		<title>VUE Camera transforms</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=VUE_Camera_transforms&amp;diff=1561"/>
		<updated>2025-09-02T11:39:10Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Dark Forces has built-in support for transforming a camera&#039;s location and orientation with &#039;&#039;&#039;VUE files&#039;&#039;&#039;. This functionality was &amp;quot;discovered&amp;quot; when the source code was reverse engineered.&lt;br /&gt;
&lt;br /&gt;
The camera in DF is normally called the &amp;quot;EYE object&amp;quot;. The EYE (camera) is assigned to an object at level startup and is normally assigned to the PLAYER object, but this is not mandatory, and there are a few mods which exploit the possibility of separate PLAYER and EYE objects.&lt;br /&gt;
&lt;br /&gt;
Vanilla Dark Forces does not support moving the EYE (camera) from one object to another object after level load, but [[Camera feature|this can be done in The Force Engine]].&lt;br /&gt;
&lt;br /&gt;
=== How to use ===&lt;br /&gt;
In a VUE file, each keyframe for the camera has the following syntax:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;camera [x-pos] [z-pos] [y-pos] [x-target] [z-target] [y-target] [roll] [lens]&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;x-pos z-pos y-pos&amp;lt;/code&amp;gt; are the location (absolute) of the camera in the map&lt;br /&gt;
* &amp;lt;code&amp;gt;x-target z-target y-target&amp;lt;/code&amp;gt; are the coordinates where the camera is pointing at. The camera&#039;s yaw and pitch orientation are calculated from the vector between the camera&#039;s location and its target.&lt;br /&gt;
* &amp;lt;code&amp;gt;roll&amp;lt;/code&amp;gt; is the camera&#039;s roll (note: rolling of the camera is not supported by DF&#039;s renderer; no matter what number is set here, the scene will always be rendered with a roll of 0)&lt;br /&gt;
* &amp;lt;code&amp;gt;lens&amp;lt;/code&amp;gt; is presumably meant to be a zoom factor, which is not used by the DF engine.&lt;br /&gt;
&lt;br /&gt;
Examples of camera instructions can be seen in the VUE files used for the original Gromas and Detention levels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Vanilla DF did not calculate the camera&#039;s pitch, therefore pitch will always be set at 0. In The Force Engine, the code has been amended to calculate the pitch.&lt;br /&gt;
&lt;br /&gt;
=== O file ===&lt;br /&gt;
The camera object needs to be given the following code in the level&#039;s O file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  LOGIC: KEY&lt;br /&gt;
  VUE:   filename.VUE  camera&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1560</id>
		<title>Camera feature</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Camera_feature&amp;diff=1560"/>
		<updated>2025-09-02T11:38:07Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).  TFE now allows the camera to be moved to a different object at any time during gameplay. This allows fo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In vanilla Dark Forces, the camera (&amp;quot;EYE&amp;quot;) is usually attached to the same object as the PLAYER, meaning that the level is viewed from the perspective of the player. It is possible for the camera to be placed on a non-player object, allowing for a third-person rather than first-person experience -- this is exploited in some mods (eg. Dark Tide, Enter the Kell Dragon).&lt;br /&gt;
&lt;br /&gt;
TFE now allows the camera to be moved to a different object at any time during gameplay. This allows for various effects such as&lt;br /&gt;
* Being able to look through security cameras&lt;br /&gt;
* Better in-game &amp;quot;cutscenes&amp;quot; / cinematic sequences&lt;br /&gt;
* The ability to switch between first-person and third-person perspectives&lt;br /&gt;
&lt;br /&gt;
See also: [[VUE Camera transforms]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Dark_Forces_Wiki&amp;diff=1559</id>
		<title>Dark Forces Wiki</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Dark_Forces_Wiki&amp;diff=1559"/>
		<updated>2025-09-02T11:26:07Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* The Force Engine Reference */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;text-align: center; font-size: x-large; padding: 1em;&amp;quot;&amp;gt;[[File:WikiLogo.png|center|frameless|561x561px]]&#039;&#039;&#039;Welcome to the {{SITENAME}}!&#039;&#039;&#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This community is dedicated to the 1995 game &#039;&#039;Star Wars: Dark Forces&#039;&#039; with an emphasis on modding and map making .  &lt;br /&gt;
&lt;br /&gt;
If you would like to contribute please create an account and help expand this wiki. &lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Editors ===&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;[[WDFUSE]]&#039;&#039;&#039; - (&#039;&#039;&#039;The original Dark Forces Editor)&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[[TFE-EDITOR]]&#039;&#039;&#039; - &#039;&#039;&#039;(The Force Engine Editor)&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;[https://df-21.net/downloads/utilities.php CYBERDARK] - (Obsolete)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== How To Guides ===&lt;br /&gt;
* [https://df-21.net/wiki/?title=DF-21_Mission_Components Submitting DF-21 Missions]&lt;br /&gt;
* [https://df-21.net/wiki/?title=Converting_Classic_Maps Converting Old DF-21 Missions]&lt;br /&gt;
* [https://df-21.net/wiki/?title=How_To:_Good_MIDI How to get good sounding MIDI in Dark Forces]&lt;br /&gt;
* [https://df-21.net/wiki/?title=WAX_File_Generator How to generate an Enemy WAX file with Blender]]&lt;br /&gt;
* [https://df-21.net/wiki/?title=Blender_3DO_Guide How to create a 3DO file with Blender]]&lt;br /&gt;
* [[Level creation tips]]&lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Reference ===&lt;br /&gt;
* [[Dark Forces Unofficial Specifications]]&lt;br /&gt;
* [[Dark Forces Remaster Unofficial Specs]]&lt;br /&gt;
* [[Teleporter Basic]]&lt;br /&gt;
* [[VUE Camera transforms]]&lt;br /&gt;
* [[Logics and AI reference]]&lt;br /&gt;
* [[Weapons reference]]&lt;br /&gt;
&lt;br /&gt;
=== The Force Engine Reference ===&lt;br /&gt;
* [[TFE_Mod_Overrides|Mod Overrides with MOD_CONF]]&lt;br /&gt;
* [[TFE Custom Logics]]&lt;br /&gt;
* [[TFE Projectile Data]]&lt;br /&gt;
* [[TFE Pickup Data]]&lt;br /&gt;
* [[TFE Weapon Data]]&lt;br /&gt;
* [[Camera feature]]&lt;br /&gt;
&lt;br /&gt;
==== TFE Scripting ====&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
* [[Math Script API]]&lt;br /&gt;
* [[System Script API]]&lt;br /&gt;
* [[Level Script API]]&lt;br /&gt;
* [[Game Script API]]&lt;br /&gt;
* [[Player Script API]]&lt;br /&gt;
&lt;br /&gt;
* [[Script Sector]]&lt;br /&gt;
* [[Script Wall]]&lt;br /&gt;
* [[Script Object]]&lt;br /&gt;
* [[Script Texture]]&lt;br /&gt;
* [[Script Elevator]]&lt;br /&gt;
&lt;br /&gt;
=== Vault ===&lt;br /&gt;
* [[:Category:Demo Assets|Assets included with the Dark Forces demo]]&lt;br /&gt;
&lt;br /&gt;
 [[Category:{{SITENAME}}]]&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1558</id>
		<title>TFE Custom Logics</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1558"/>
		<updated>2025-09-02T11:19:34Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Data properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how to use custom (user-defined) AI logics in TFE.&lt;br /&gt;
&lt;br /&gt;
This feature allows modders to create new enemy logics that behave similarly to the &amp;quot;standard&amp;quot; (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids. &lt;br /&gt;
&lt;br /&gt;
To use the feature, check that the &#039;&#039;&#039;Enhanced AI logics&#039;&#039;&#039; setting has been enabled, in Settings → Game Settings → Dark Forces Settings.&lt;br /&gt;
&lt;br /&gt;
=== JSON locations ===&lt;br /&gt;
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations&lt;br /&gt;
&lt;br /&gt;
* DARK\Logics&lt;br /&gt;
* TheForceEngine\Mods\Logics&lt;br /&gt;
* TheForceEngine\Mods\&amp;lt;code&amp;gt;[CURRENTLY LOADED MOD]&amp;lt;/code&amp;gt;\Logics&lt;br /&gt;
&lt;br /&gt;
where DARK is your Dark Forces game directory which TFE is pointing to.&lt;br /&gt;
&lt;br /&gt;
In addition, if you are running a Mod from a ZIP, TFE will look for a &amp;lt;code&amp;gt;\Logics&amp;lt;/code&amp;gt; subfolder inside the ZIP and load logics from any .JSON files found there.&lt;br /&gt;
&lt;br /&gt;
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.&lt;br /&gt;
&lt;br /&gt;
You can have as many logic .JSON files as you want, and each .JSON file can contain as many logics as you want. If multiple logics are loaded that have the same name, only the first one encountered with that name will be used. If you have multiple .JSON files, the order in which they are loaded by TFE is unpredictable, so the only way to be sure that your logics work the way you intend is to avoid duplicate names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Custom logics are loaded when entering Dark Forces from TFE, and cleared when the user exits back to the TFE main menu. Therefore, if JSON files are altered while the game is running, the change will take effect when you quit back to the TFE main menu and then re-enter the game.&lt;br /&gt;
&lt;br /&gt;
=== Logic JSON structure ===&lt;br /&gt;
A logic JSON should consist of a single array called &amp;quot;logics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each element of the &amp;quot;logics&amp;quot; array must consist of two items, in this order&lt;br /&gt;
* &amp;quot;logicName&amp;quot; - a string which is the name of the logic&lt;br /&gt;
* &amp;quot;data&amp;quot; - an object containing properties that are set for the logic&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
   &amp;quot;logics&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicA&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;rifle_bolt&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicB&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 39,&lt;br /&gt;
            &amp;quot;speed&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;thermal_det&amp;quot;,&lt;br /&gt;
            &amp;quot;dropItem&amp;quot;: &amp;quot;red_key&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logic JSONs are &#039;&#039;not&#039;&#039; case sensitive. The text inside the JSON can be all uppercase, all lowercase, or any mix of upper and lowercase; it will all be read the same.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;quot;alertsound&amp;quot;, &amp;quot;ALERTSOUND&amp;quot;, &amp;quot;AlertSound&amp;quot;, &amp;quot;alertSound&amp;quot; will all be accepted.&lt;br /&gt;
&lt;br /&gt;
Further tips about getting the JSON format right can be found on the [[TFE Mod Overrides#How_do_I_create_or_edit_a_MOD_CONF.txt_file_and_what_is_JSON?|TFE MOD Overrides]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data properties ===&lt;br /&gt;
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.&lt;br /&gt;
&lt;br /&gt;
You do not need to set every property. Unset properties will default to the values shown.&lt;br /&gt;
&lt;br /&gt;
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| hasGravity || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, will be affected by gravity&lt;br /&gt;
|-&lt;br /&gt;
| isFlying || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, will be a flying enemy (like probe droid)&lt;br /&gt;
|-&lt;br /&gt;
| fieldOfView || number (integer) || 210 || Field of view, in degrees. If set to 360, the enemy will be able to see you even if you are standing behind it.&lt;br /&gt;
|- &lt;br /&gt;
| awareRange || number (integer) || 20 || If you are within this distance from the enemy (in DFU), it will be alerted even if you are outside its field of view. (However, this can be affected by other things, such as the ambient light.)&lt;br /&gt;
|-&lt;br /&gt;
| alertSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy is alerted&lt;br /&gt;
|-&lt;br /&gt;
| painSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy takes pain&lt;br /&gt;
|- &lt;br /&gt;
| dieSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy dies&lt;br /&gt;
|-&lt;br /&gt;
| attack1Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for primary attack&lt;br /&gt;
|- &lt;br /&gt;
| attack2Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.&lt;br /&gt;
|-&lt;br /&gt;
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.&lt;br /&gt;
|- &lt;br /&gt;
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| stopOnDamage || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If false, enemy can keep moving while taking damage. (It is set to false for Gamorreans and Probe Droids)&lt;br /&gt;
|-&lt;br /&gt;
| hasMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.&lt;br /&gt;
|-&lt;br /&gt;
| hasRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the enemy will have a ranged attack. If the enemy has a melee attack, the ranged attack will be the secondary attack. If it does not have a melee attack, the ranged attack will be the primary attack.&lt;br /&gt;
|- &lt;br /&gt;
| litWithMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the sprite will light up when it attacks with melee.&lt;br /&gt;
|- &lt;br /&gt;
| litWithRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the sprite will light up when it does its ranged attack.&lt;br /&gt;
|-&lt;br /&gt;
| projectile || string or number || &amp;lt;code&amp;gt;&amp;quot;rifle_bolt&amp;quot;&amp;lt;/code&amp;gt; || What projectile the enemy will fire for its ranged attack. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or &amp;quot;asleep&amp;quot; state. This time is reset when the enemy is re-alerted by the player.&lt;br /&gt;
|-&lt;br /&gt;
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)&lt;br /&gt;
|-&lt;br /&gt;
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks&lt;br /&gt;
|-&lt;br /&gt;
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.&lt;br /&gt;
|- &lt;br /&gt;
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.&lt;br /&gt;
|-&lt;br /&gt;
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.&lt;br /&gt;
|-&lt;br /&gt;
| fireOffset || array of decimal [x, y, z] || [0.0, default, 0.0] || Projectile spawn location relative to enemy&#039;s position and yaw. Default y value is 1 DFU above the middle of the enemy&#039;s vertical size (world height, determined by the size of the sprite)&lt;br /&gt;
|- &lt;br /&gt;
| speed || number (integer) || 4 || Speed of enemy&#039;s movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.&lt;br /&gt;
|-&lt;br /&gt;
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.&lt;br /&gt;
|-&lt;br /&gt;
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.&lt;br /&gt;
|-&lt;br /&gt;
| approachVariation || number (integer) || 90 || An angle in degrees; affects the way enemies approach the player&lt;br /&gt;
|-&lt;br /&gt;
| approachOffset || number (integer) || 3 || Minimum distance (DFU) that the enemy will approach the player&lt;br /&gt;
|-&lt;br /&gt;
| thinkerDelay || number (integer) || 2 || Average time (in seconds) that the enemy will keep moving in one direction before turning back towards the player&lt;br /&gt;
|-&lt;br /&gt;
| collisionWidth || number (decimal) || default || Minimum distance (DFU) that enemy can approach walls, i.e. half the width of the smallest horizontal gap that it can fit through. Defaults to the the enemy&#039;s world width (determined by the size of the sprite)&lt;br /&gt;
|-&lt;br /&gt;
| collisionHeight || number (decimal) || default || Minimum vertical gap (DFU) that enemy can fit through. Defaults to the enemy&#039;s world height (determined by the size of the sprite)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using custom logics ===&lt;br /&gt;
Logics that you have defined in JSON can be applied to a sprite in the .O file in the same way as other (hardcoded) enemy logics. For example, if you have the following logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;logicName&amp;quot;: &amp;quot;Rodian&amp;quot;,&lt;br /&gt;
      &amp;quot;data&amp;quot;: {&lt;br /&gt;
         &amp;quot;alertSound&amp;quot;: &amp;quot;rodian1.voc&amp;quot;,&lt;br /&gt;
         ....&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC: Rodian&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use JSON-defined logics with generators, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC:         GENERATOR Rodian&lt;br /&gt;
   DELAY:         10&lt;br /&gt;
   INTERVAL:      5&lt;br /&gt;
   NUM_TERMINATE: 6&lt;br /&gt;
   MAX_ALIVE:     1&lt;br /&gt;
   MAX_DIST:      800&lt;br /&gt;
   MIN_DIST:      50&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be &amp;quot;lifeless&amp;quot;. However, if the level has generators with a custom logic, this causes the original game to crash.&lt;br /&gt;
&lt;br /&gt;
=== Overriding hardcoded logics ===&lt;br /&gt;
You &#039;&#039;can&#039;&#039; override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, &amp;lt;code&amp;gt;storm1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;commando&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you override a boss logic, like &amp;lt;code&amp;gt;kell&amp;lt;/code&amp;gt; or one of the dark troopers, the enemy will behave like an ordinary enemy instead of a boss; they will lose their ability to trigger the BOSS elevator when they die.&lt;br /&gt;
&lt;br /&gt;
=== Custom logics and WAX files ===&lt;br /&gt;
A custom logic&#039;s behaviours/actions will correspond to WAX animations as follows&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Walking / moving&lt;br /&gt;
|- &lt;br /&gt;
| 1 || Primary attack&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Melee death&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shooting / explosion death&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Dead&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Idle / stationary&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Primary attack conclusion (eg. recoil)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Secondary attack conclusion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Pain&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This follows the same pattern as all the standard Dark Forces enemies.&lt;br /&gt;
&lt;br /&gt;
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has &#039;&#039;only&#039;&#039; a ranged attack, then this will be the primary attack (animations 1 and 6). If a logic has both melee and ranged attacks, the melee will be primary (animations 1 and 6) and the ranged attack will be secondary (animations 7 and 8).&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
==== Projectile list ====&lt;br /&gt;
You can assign projectiles with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a projectile&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;punch&amp;lt;/code&amp;gt; || This is a special projectile used for the player&#039;s fists, and may not work with logics&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;pistol_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;rifle_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;thermal_det&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;repeater&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;plasma&amp;lt;/code&amp;gt; || Fusion cutter projectile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;mortar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;land_mine&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;land_mine_prox&amp;lt;/code&amp;gt; || Proximity land mine&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;land_mine_placed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;concussion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;cannon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;turret_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;remote_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;exp_barrel&amp;lt;/code&amp;gt; || An invisible projectile that is normally spawned when a barrel explodes&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;homing_missile&amp;lt;/code&amp;gt; || Mohc&#039;s homing missiles&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;probe_proj&amp;lt;/code&amp;gt; || Green interrogator droid projectile&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;bobafett_ball&amp;lt;/code&amp;gt; || Boba Fett&#039;s missiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Drop item list ====&lt;br /&gt;
You can assign drop items with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not drop anything when they die&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;PLANS&amp;lt;/code&amp;gt; || Death Star plans&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;PHRIK&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;NAVA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;DT_WEAPON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;DATATAPE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;RIFLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;AUTOGUN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MORTAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;FUSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;CANNON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;ENERGY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;PLASMA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;DETONATOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;DETONATORS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; || Mortar shell&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;SHELLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;MINE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 19 || &amp;lt;code&amp;gt;MINES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 20 || &amp;lt;code&amp;gt;MISSILE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21 || &amp;lt;code&amp;gt;MISSILES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22 || &amp;lt;code&amp;gt;SHIELD&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 23 || &amp;lt;code&amp;gt;RED_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 24 || &amp;lt;code&amp;gt;YELLOW_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || &amp;lt;code&amp;gt;BLUE_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || &amp;lt;code&amp;gt;GOGGLES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || &amp;lt;code&amp;gt;CLEATS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || &amp;lt;code&amp;gt;MASK&amp;lt;/code&amp;gt; || Gas mask&lt;br /&gt;
|-&lt;br /&gt;
| 29 || &amp;lt;code&amp;gt;BATTERY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 30 || &amp;lt;code&amp;gt;CODE1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 31 || &amp;lt;code&amp;gt;CODE2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || &amp;lt;code&amp;gt;CODE3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 33 || &amp;lt;code&amp;gt;CODE4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &amp;lt;code&amp;gt;CODE5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 35 || &amp;lt;code&amp;gt;CODE6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 36 || &amp;lt;code&amp;gt;CODE7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 37 || &amp;lt;code&amp;gt;CODE8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 38 || &amp;lt;code&amp;gt;CODE9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 39 || &amp;lt;code&amp;gt;INVINCIBLE&amp;lt;/code&amp;gt; || Shield supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 40 || &amp;lt;code&amp;gt;SUPERCHARGE&amp;lt;/code&amp;gt; || Weapon supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 41 || &amp;lt;code&amp;gt;REVIVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 42 || &amp;lt;code&amp;gt;LIFE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 43 || &amp;lt;code&amp;gt;MEDKIT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 44 || &amp;lt;code&amp;gt;PILE&amp;lt;/code&amp;gt; || Kyle&#039;s pile of weapons&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Death effect list ====&lt;br /&gt;
You can assign death effects with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
Note that some effects inflict damage.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a death effect&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;SMALL_EXP&amp;lt;/code&amp;gt; || small &amp;quot;puff&amp;quot; - blaster weapons&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;THERMDET_EXP&amp;lt;/code&amp;gt; || thermal detonator explosion&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;PLASMA_EXP&amp;lt;/code&amp;gt; || Green plasma &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;MORTAR_EXP&amp;lt;/code&amp;gt; || mortar explosion&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt; || concussion - first stage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;CONCUSSION2&amp;lt;/code&amp;gt; || concussion - second stage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;MISSILE_EXP&amp;lt;/code&amp;gt; || missile explosion&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MISSILE_WEAK&amp;lt;/code&amp;gt; || weaker version of the missle explosion&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;PUNCH&amp;lt;/code&amp;gt; || punch&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CANNON_EXP&amp;lt;/code&amp;gt; || Blue cannon &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;REPEATER_EXP&amp;lt;/code&amp;gt; || repeater &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;LARGE_EXP&amp;lt;/code&amp;gt; || Land mine explosion&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;EXP_BARREL&amp;lt;/code&amp;gt; || exploding barrel&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;EXP_INVIS&amp;lt;/code&amp;gt; || an explosion that makes no sound and has no visual effect&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;SPLASH&amp;lt;/code&amp;gt; || water splash&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;EXP_35&amp;lt;/code&amp;gt; || medium explosion, 35 damage (used for probe droid death)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;EXP_NO_DMG&amp;lt;/code&amp;gt; || medium explosion, no damage (used for turret and welder deaths)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;EXP_25&amp;lt;/code&amp;gt; || medium explosion, 25 damage (used for Boba Fett missile explosions)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1557</id>
		<title>TFE Custom Logics</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1557"/>
		<updated>2025-09-02T11:16:19Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Add new properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how to use custom (user-defined) AI logics in TFE.&lt;br /&gt;
&lt;br /&gt;
This feature allows modders to create new enemy logics that behave similarly to the &amp;quot;standard&amp;quot; (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids. &lt;br /&gt;
&lt;br /&gt;
To use the feature, check that the &#039;&#039;&#039;Enhanced AI logics&#039;&#039;&#039; setting has been enabled, in Settings → Game Settings → Dark Forces Settings.&lt;br /&gt;
&lt;br /&gt;
=== JSON locations ===&lt;br /&gt;
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations&lt;br /&gt;
&lt;br /&gt;
* DARK\Logics&lt;br /&gt;
* TheForceEngine\Mods\Logics&lt;br /&gt;
* TheForceEngine\Mods\&amp;lt;code&amp;gt;[CURRENTLY LOADED MOD]&amp;lt;/code&amp;gt;\Logics&lt;br /&gt;
&lt;br /&gt;
where DARK is your Dark Forces game directory which TFE is pointing to.&lt;br /&gt;
&lt;br /&gt;
In addition, if you are running a Mod from a ZIP, TFE will look for a &amp;lt;code&amp;gt;\Logics&amp;lt;/code&amp;gt; subfolder inside the ZIP and load logics from any .JSON files found there.&lt;br /&gt;
&lt;br /&gt;
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.&lt;br /&gt;
&lt;br /&gt;
You can have as many logic .JSON files as you want, and each .JSON file can contain as many logics as you want. If multiple logics are loaded that have the same name, only the first one encountered with that name will be used. If you have multiple .JSON files, the order in which they are loaded by TFE is unpredictable, so the only way to be sure that your logics work the way you intend is to avoid duplicate names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Custom logics are loaded when entering Dark Forces from TFE, and cleared when the user exits back to the TFE main menu. Therefore, if JSON files are altered while the game is running, the change will take effect when you quit back to the TFE main menu and then re-enter the game.&lt;br /&gt;
&lt;br /&gt;
=== Logic JSON structure ===&lt;br /&gt;
A logic JSON should consist of a single array called &amp;quot;logics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each element of the &amp;quot;logics&amp;quot; array must consist of two items, in this order&lt;br /&gt;
* &amp;quot;logicName&amp;quot; - a string which is the name of the logic&lt;br /&gt;
* &amp;quot;data&amp;quot; - an object containing properties that are set for the logic&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
   &amp;quot;logics&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicA&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;rifle_bolt&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicB&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 39,&lt;br /&gt;
            &amp;quot;speed&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;thermal_det&amp;quot;,&lt;br /&gt;
            &amp;quot;dropItem&amp;quot;: &amp;quot;red_key&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logic JSONs are &#039;&#039;not&#039;&#039; case sensitive. The text inside the JSON can be all uppercase, all lowercase, or any mix of upper and lowercase; it will all be read the same.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;quot;alertsound&amp;quot;, &amp;quot;ALERTSOUND&amp;quot;, &amp;quot;AlertSound&amp;quot;, &amp;quot;alertSound&amp;quot; will all be accepted.&lt;br /&gt;
&lt;br /&gt;
Further tips about getting the JSON format right can be found on the [[TFE Mod Overrides#How_do_I_create_or_edit_a_MOD_CONF.txt_file_and_what_is_JSON?|TFE MOD Overrides]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data properties ===&lt;br /&gt;
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.&lt;br /&gt;
&lt;br /&gt;
You do not need to set every property. Unset properties will default to the values shown.&lt;br /&gt;
&lt;br /&gt;
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| hasGravity || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, will be affected by gravity&lt;br /&gt;
|-&lt;br /&gt;
| isFlying || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, will be a flying enemy (like probe droid)&lt;br /&gt;
|-&lt;br /&gt;
| fieldOfView || number (integer) || 210 || Field of view, in degrees. If set to 360, the enemy will be able to see you even if you are standing behind it.&lt;br /&gt;
|- &lt;br /&gt;
| awareRange || number (integer) || 20 || If you are within this distance from the enemy (in DFU), it will be alerted even if you are outside its field of view. (However, this can be affected by other things, such as the ambient light.)&lt;br /&gt;
|-&lt;br /&gt;
| alertSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy is alerted&lt;br /&gt;
|-&lt;br /&gt;
| painSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy takes pain&lt;br /&gt;
|- &lt;br /&gt;
| dieSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy dies&lt;br /&gt;
|-&lt;br /&gt;
| attack1Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for primary attack&lt;br /&gt;
|- &lt;br /&gt;
| attack2Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.&lt;br /&gt;
|-&lt;br /&gt;
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.&lt;br /&gt;
|- &lt;br /&gt;
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| stopOnDamage || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If false, enemy can keep moving while taking damage&lt;br /&gt;
|-&lt;br /&gt;
| hasMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.&lt;br /&gt;
|-&lt;br /&gt;
| hasRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the enemy will have a ranged attack. If the enemy has a melee attack, the ranged attack will be the secondary attack. If it does not have a melee attack, the ranged attack will be the primary attack.&lt;br /&gt;
|- &lt;br /&gt;
| litWithMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the sprite will light up when it attacks with melee.&lt;br /&gt;
|- &lt;br /&gt;
| litWithRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the sprite will light up when it does its ranged attack.&lt;br /&gt;
|-&lt;br /&gt;
| projectile || string or number || &amp;lt;code&amp;gt;&amp;quot;rifle_bolt&amp;quot;&amp;lt;/code&amp;gt; || What projectile the enemy will fire for its ranged attack. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or &amp;quot;asleep&amp;quot; state. This time is reset when the enemy is re-alerted by the player.&lt;br /&gt;
|-&lt;br /&gt;
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)&lt;br /&gt;
|-&lt;br /&gt;
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks&lt;br /&gt;
|-&lt;br /&gt;
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.&lt;br /&gt;
|- &lt;br /&gt;
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.&lt;br /&gt;
|-&lt;br /&gt;
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.&lt;br /&gt;
|-&lt;br /&gt;
| fireOffset || array of decimal [x, y, z] || {0.0, default, 0.0 } || Projectile spawn location relative to enemy&#039;s position and yaw. Default y value is 1 DFU above the middle of the enemy&#039;s vertical size (world height, determined by the size of the sprite)&lt;br /&gt;
|- &lt;br /&gt;
| speed || number (integer) || 4 || Speed of enemy&#039;s movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.&lt;br /&gt;
|-&lt;br /&gt;
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.&lt;br /&gt;
|-&lt;br /&gt;
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.&lt;br /&gt;
|-&lt;br /&gt;
| approachVariation || number (integer) || 90 || An angle in degrees; affects the way enemies approach the player&lt;br /&gt;
|-&lt;br /&gt;
| approachOffset || number (integer) || 3 || Minimum distance (DFU) that the enemy will approach the player&lt;br /&gt;
|-&lt;br /&gt;
| thinkerDelay || number (integer) || 2 || Average time (in seconds) that the enemy will keep moving in one direction before turning back towards the player&lt;br /&gt;
|-&lt;br /&gt;
| collisionWidth || number (decimal) || default || Minimum distance (DFU) that enemy can approach walls, i.e. half the width of the smallest horizontal gap that it can fit through. Defaults to the the enemy&#039;s world width (determined by the size of the sprite)&lt;br /&gt;
|-&lt;br /&gt;
| collisionHeight || number (decimal) || default || Minimum vertical gap (DFU) that enemy can fit through. Defaults to the enemy&#039;s world height (determined by the size of the sprite)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using custom logics ===&lt;br /&gt;
Logics that you have defined in JSON can be applied to a sprite in the .O file in the same way as other (hardcoded) enemy logics. For example, if you have the following logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;logicName&amp;quot;: &amp;quot;Rodian&amp;quot;,&lt;br /&gt;
      &amp;quot;data&amp;quot;: {&lt;br /&gt;
         &amp;quot;alertSound&amp;quot;: &amp;quot;rodian1.voc&amp;quot;,&lt;br /&gt;
         ....&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC: Rodian&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use JSON-defined logics with generators, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC:         GENERATOR Rodian&lt;br /&gt;
   DELAY:         10&lt;br /&gt;
   INTERVAL:      5&lt;br /&gt;
   NUM_TERMINATE: 6&lt;br /&gt;
   MAX_ALIVE:     1&lt;br /&gt;
   MAX_DIST:      800&lt;br /&gt;
   MIN_DIST:      50&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be &amp;quot;lifeless&amp;quot;. However, if the level has generators with a custom logic, this causes the original game to crash.&lt;br /&gt;
&lt;br /&gt;
=== Overriding hardcoded logics ===&lt;br /&gt;
You &#039;&#039;can&#039;&#039; override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, &amp;lt;code&amp;gt;storm1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;commando&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you override a boss logic, like &amp;lt;code&amp;gt;kell&amp;lt;/code&amp;gt; or one of the dark troopers, the enemy will behave like an ordinary enemy instead of a boss; they will lose their ability to trigger the BOSS elevator when they die.&lt;br /&gt;
&lt;br /&gt;
=== Custom logics and WAX files ===&lt;br /&gt;
A custom logic&#039;s behaviours/actions will correspond to WAX animations as follows&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Walking / moving&lt;br /&gt;
|- &lt;br /&gt;
| 1 || Primary attack&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Melee death&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shooting / explosion death&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Dead&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Idle / stationary&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Primary attack conclusion (eg. recoil)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Secondary attack conclusion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Pain&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This follows the same pattern as all the standard Dark Forces enemies.&lt;br /&gt;
&lt;br /&gt;
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has &#039;&#039;only&#039;&#039; a ranged attack, then this will be the primary attack (animations 1 and 6). If a logic has both melee and ranged attacks, the melee will be primary (animations 1 and 6) and the ranged attack will be secondary (animations 7 and 8).&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
==== Projectile list ====&lt;br /&gt;
You can assign projectiles with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a projectile&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;punch&amp;lt;/code&amp;gt; || This is a special projectile used for the player&#039;s fists, and may not work with logics&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;pistol_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;rifle_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;thermal_det&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;repeater&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;plasma&amp;lt;/code&amp;gt; || Fusion cutter projectile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;mortar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;land_mine&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;land_mine_prox&amp;lt;/code&amp;gt; || Proximity land mine&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;land_mine_placed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;concussion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;cannon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;turret_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;remote_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;exp_barrel&amp;lt;/code&amp;gt; || An invisible projectile that is normally spawned when a barrel explodes&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;homing_missile&amp;lt;/code&amp;gt; || Mohc&#039;s homing missiles&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;probe_proj&amp;lt;/code&amp;gt; || Green interrogator droid projectile&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;bobafett_ball&amp;lt;/code&amp;gt; || Boba Fett&#039;s missiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Drop item list ====&lt;br /&gt;
You can assign drop items with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not drop anything when they die&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;PLANS&amp;lt;/code&amp;gt; || Death Star plans&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;PHRIK&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;NAVA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;DT_WEAPON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;DATATAPE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;RIFLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;AUTOGUN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MORTAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;FUSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;CANNON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;ENERGY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;PLASMA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;DETONATOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;DETONATORS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; || Mortar shell&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;SHELLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;MINE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 19 || &amp;lt;code&amp;gt;MINES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 20 || &amp;lt;code&amp;gt;MISSILE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21 || &amp;lt;code&amp;gt;MISSILES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22 || &amp;lt;code&amp;gt;SHIELD&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 23 || &amp;lt;code&amp;gt;RED_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 24 || &amp;lt;code&amp;gt;YELLOW_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || &amp;lt;code&amp;gt;BLUE_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || &amp;lt;code&amp;gt;GOGGLES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || &amp;lt;code&amp;gt;CLEATS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || &amp;lt;code&amp;gt;MASK&amp;lt;/code&amp;gt; || Gas mask&lt;br /&gt;
|-&lt;br /&gt;
| 29 || &amp;lt;code&amp;gt;BATTERY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 30 || &amp;lt;code&amp;gt;CODE1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 31 || &amp;lt;code&amp;gt;CODE2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || &amp;lt;code&amp;gt;CODE3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 33 || &amp;lt;code&amp;gt;CODE4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &amp;lt;code&amp;gt;CODE5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 35 || &amp;lt;code&amp;gt;CODE6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 36 || &amp;lt;code&amp;gt;CODE7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 37 || &amp;lt;code&amp;gt;CODE8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 38 || &amp;lt;code&amp;gt;CODE9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 39 || &amp;lt;code&amp;gt;INVINCIBLE&amp;lt;/code&amp;gt; || Shield supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 40 || &amp;lt;code&amp;gt;SUPERCHARGE&amp;lt;/code&amp;gt; || Weapon supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 41 || &amp;lt;code&amp;gt;REVIVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 42 || &amp;lt;code&amp;gt;LIFE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 43 || &amp;lt;code&amp;gt;MEDKIT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 44 || &amp;lt;code&amp;gt;PILE&amp;lt;/code&amp;gt; || Kyle&#039;s pile of weapons&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Death effect list ====&lt;br /&gt;
You can assign death effects with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
Note that some effects inflict damage.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a death effect&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;SMALL_EXP&amp;lt;/code&amp;gt; || small &amp;quot;puff&amp;quot; - blaster weapons&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;THERMDET_EXP&amp;lt;/code&amp;gt; || thermal detonator explosion&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;PLASMA_EXP&amp;lt;/code&amp;gt; || Green plasma &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;MORTAR_EXP&amp;lt;/code&amp;gt; || mortar explosion&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt; || concussion - first stage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;CONCUSSION2&amp;lt;/code&amp;gt; || concussion - second stage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;MISSILE_EXP&amp;lt;/code&amp;gt; || missile explosion&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MISSILE_WEAK&amp;lt;/code&amp;gt; || weaker version of the missle explosion&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;PUNCH&amp;lt;/code&amp;gt; || punch&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CANNON_EXP&amp;lt;/code&amp;gt; || Blue cannon &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;REPEATER_EXP&amp;lt;/code&amp;gt; || repeater &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;LARGE_EXP&amp;lt;/code&amp;gt; || Land mine explosion&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;EXP_BARREL&amp;lt;/code&amp;gt; || exploding barrel&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;EXP_INVIS&amp;lt;/code&amp;gt; || an explosion that makes no sound and has no visual effect&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;SPLASH&amp;lt;/code&amp;gt; || water splash&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;EXP_35&amp;lt;/code&amp;gt; || medium explosion, 35 damage (used for probe droid death)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;EXP_NO_DMG&amp;lt;/code&amp;gt; || medium explosion, no damage (used for turret and welder deaths)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;EXP_25&amp;lt;/code&amp;gt; || medium explosion, 25 damage (used for Boba Fett missile explosions)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1556</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1556"/>
		<updated>2025-09-02T10:24:20Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: setCamera&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Scripting functions will internally do an &#039;&#039;exists&#039;&#039; check before being executed. Therefore it is not necessary for you to check that an object exists in ForceScript before calling methods on it. If you try to manipulate an object (eg. set its position) that doesn&#039;t exist, nothing will happen. If you &#039;&#039;get&#039;&#039; a property from a non-existent object, a default value will be returned (usually zero).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;exists()&amp;lt;/code&amp;gt; function in ForceScript enables you to check for an object&#039;s existence so that you can make your script logic conditional on an object&#039;s existence. For example, you may want your script to do something only if a certain enemy has been killed, or a certain item has been collected.&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
ds.matchPosition(target);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== delete() ===&lt;br /&gt;
* Removes the object from the level&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;ewok2.delete();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addLogic(string) ===&lt;br /&gt;
* Adds a logic to the object. Works with scenery, enemy logics, and pickup items. (Still to do: enable adding a custom logic.)&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// turn the table into scenery so it becomes breakable&lt;br /&gt;
table.addLogic(&amp;quot;scenery&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add Nava card logic to the object so it can now be picked up&lt;br /&gt;
navcard.addLogic(&amp;quot;nava&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add commando logic&lt;br /&gt;
com5.addLogic(&amp;quot;commando&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setCamera() ===&lt;br /&gt;
* Set the camera (EYE) to the object&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object cutsceneCam = level.getObject(&amp;quot;camera9&amp;quot;);&lt;br /&gt;
cutsceneCam.setCamera();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1555</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1555"/>
		<updated>2025-09-02T10:21:10Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: setCamera&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disabledActions ===&lt;br /&gt;
* Get the player actions that have currently been disabled&lt;br /&gt;
* Usage example: check if firing has been disabled&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.disabledActions &amp;amp; ACTION_FIRE)&lt;br /&gt;
{&lt;br /&gt;
   // firing has been disabled&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setCamera() ===&lt;br /&gt;
* Move the camera (EYE) to the player&lt;br /&gt;
* Usage: &amp;lt;code&amp;gt;player.setCamera();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disableActions(PlayerActions) ===&lt;br /&gt;
* Disable the player&#039;s actions&lt;br /&gt;
* Parameter: actions to disable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: disable player&#039;s movement and weapon firing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_MOVE | ACTION_FIRE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable all actions (movement, rotation and firing)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_ALL);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== enableActions(PlayerActions) ===&lt;br /&gt;
* Enable the player&#039;s actions if they have been disabled&lt;br /&gt;
* Parameter: actions to enable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: enable player&#039;s movement and rotation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.enableActions(ACTION_MOVE | ACTION_ROTATE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1554</id>
		<title>TFE Custom Logics</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Custom_Logics&amp;diff=1554"/>
		<updated>2025-08-31T04:19:13Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article explains how to use custom (user-defined) AI logics in TFE.&lt;br /&gt;
&lt;br /&gt;
This feature allows modders to create new enemy logics that behave similarly to the &amp;quot;standard&amp;quot; (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids. &lt;br /&gt;
&lt;br /&gt;
To use the feature, check that the &#039;&#039;&#039;Enhanced AI logics&#039;&#039;&#039; setting has been enabled, in Settings → Game Settings → Dark Forces Settings.&lt;br /&gt;
&lt;br /&gt;
=== JSON locations ===&lt;br /&gt;
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations&lt;br /&gt;
&lt;br /&gt;
* DARK\Logics&lt;br /&gt;
* TheForceEngine\Mods\Logics&lt;br /&gt;
* TheForceEngine\Mods\&amp;lt;code&amp;gt;[CURRENTLY LOADED MOD]&amp;lt;/code&amp;gt;\Logics&lt;br /&gt;
&lt;br /&gt;
where DARK is your Dark Forces game directory which TFE is pointing to.&lt;br /&gt;
&lt;br /&gt;
In addition, if you are running a Mod from a ZIP, TFE will look for a &amp;lt;code&amp;gt;\Logics&amp;lt;/code&amp;gt; subfolder inside the ZIP and load logics from any .JSON files found there.&lt;br /&gt;
&lt;br /&gt;
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.&lt;br /&gt;
&lt;br /&gt;
You can have as many logic .JSON files as you want, and each .JSON file can contain as many logics as you want. If multiple logics are loaded that have the same name, only the first one encountered with that name will be used. If you have multiple .JSON files, the order in which they are loaded by TFE is unpredictable, so the only way to be sure that your logics work the way you intend is to avoid duplicate names.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Custom logics are loaded when entering Dark Forces from TFE, and cleared when the user exits back to the TFE main menu. Therefore, if JSON files are altered while the game is running, the change will take effect when you quit back to the TFE main menu and then re-enter the game.&lt;br /&gt;
&lt;br /&gt;
=== Logic JSON structure ===&lt;br /&gt;
A logic JSON should consist of a single array called &amp;quot;logics&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Each element of the &amp;quot;logics&amp;quot; array must consist of two items, in this order&lt;br /&gt;
* &amp;quot;logicName&amp;quot; - a string which is the name of the logic&lt;br /&gt;
* &amp;quot;data&amp;quot; - an object containing properties that are set for the logic&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
   &amp;quot;logics&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicA&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain1.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 25,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;rifle_bolt&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      },&lt;br /&gt;
      {&lt;br /&gt;
         &amp;quot;logicName&amp;quot;: &amp;quot;LogicB&amp;quot;,&lt;br /&gt;
         &amp;quot;data&amp;quot;: {&lt;br /&gt;
            &amp;quot;alertSound&amp;quot;: &amp;quot;alert2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;painSound&amp;quot;: &amp;quot;pain2.voc&amp;quot;,&lt;br /&gt;
            &amp;quot;hitpoints&amp;quot;: 39,&lt;br /&gt;
            &amp;quot;speed&amp;quot;: 20,&lt;br /&gt;
            &amp;quot;projectile&amp;quot;: &amp;quot;thermal_det&amp;quot;,&lt;br /&gt;
            &amp;quot;dropItem&amp;quot;: &amp;quot;red_key&amp;quot;&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Logic JSONs are &#039;&#039;not&#039;&#039; case sensitive. The text inside the JSON can be all uppercase, all lowercase, or any mix of upper and lowercase; it will all be read the same.&lt;br /&gt;
&lt;br /&gt;
For example, &amp;quot;alertsound&amp;quot;, &amp;quot;ALERTSOUND&amp;quot;, &amp;quot;AlertSound&amp;quot;, &amp;quot;alertSound&amp;quot; will all be accepted.&lt;br /&gt;
&lt;br /&gt;
Further tips about getting the JSON format right can be found on the [[TFE Mod Overrides#How_do_I_create_or_edit_a_MOD_CONF.txt_file_and_what_is_JSON?|TFE MOD Overrides]] article.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Data properties ===&lt;br /&gt;
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.&lt;br /&gt;
&lt;br /&gt;
You do not need to set every property. Unset properties will default to the values shown.&lt;br /&gt;
&lt;br /&gt;
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Property !! Type !! Default value !! Description&lt;br /&gt;
|- &lt;br /&gt;
| hasGravity || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, will be affected by gravity&lt;br /&gt;
|-&lt;br /&gt;
| isFlying || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, will be a flying enemy (like probe droid)&lt;br /&gt;
|-&lt;br /&gt;
| fieldOfView || number (integer) || 210 || Field of view, in degrees. If set to 360, the enemy will be able to see you even if you are standing behind it.&lt;br /&gt;
|- &lt;br /&gt;
| awareRange || number (integer) || 20 || If you are within this distance from the enemy (in DFU), it will be alerted even if you are outside its field of view. (However, this can be affected by other things, such as the ambient light.)&lt;br /&gt;
|-&lt;br /&gt;
| alertSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy is alerted&lt;br /&gt;
|-&lt;br /&gt;
| painSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy takes pain&lt;br /&gt;
|- &lt;br /&gt;
| dieSound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play when enemy dies&lt;br /&gt;
|-&lt;br /&gt;
| attack1Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for primary attack&lt;br /&gt;
|- &lt;br /&gt;
| attack2Sound || string || &#039;&#039;no sound&#039;&#039; || VOC file to play for secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.&lt;br /&gt;
|-&lt;br /&gt;
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.&lt;br /&gt;
|- &lt;br /&gt;
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| hasMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.&lt;br /&gt;
|-&lt;br /&gt;
| hasRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the enemy will have a ranged attack. If the enemy has a melee attack, the ranged attack will be the secondary attack. If it does not have a melee attack, the ranged attack will be the primary attack.&lt;br /&gt;
|- &lt;br /&gt;
| litWithMeleeAttack || boolean || &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; || If true, the sprite will light up when it attacks with melee.&lt;br /&gt;
|- &lt;br /&gt;
| litWithRangedAttack || boolean || &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; || If true, the sprite will light up when it does its ranged attack.&lt;br /&gt;
|-&lt;br /&gt;
| projectile || string or number || &amp;lt;code&amp;gt;&amp;quot;rifle_bolt&amp;quot;&amp;lt;/code&amp;gt; || What projectile the enemy will fire for its ranged attack. See reference table below for options.&lt;br /&gt;
|-&lt;br /&gt;
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or &amp;quot;asleep&amp;quot; state. This time is reset when the enemy is re-alerted by the player.&lt;br /&gt;
|-&lt;br /&gt;
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)&lt;br /&gt;
|-&lt;br /&gt;
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks&lt;br /&gt;
|-&lt;br /&gt;
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.&lt;br /&gt;
|- &lt;br /&gt;
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.&lt;br /&gt;
|-&lt;br /&gt;
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.&lt;br /&gt;
|-&lt;br /&gt;
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.&lt;br /&gt;
|- &lt;br /&gt;
| speed || number (integer) || 4 || Speed of enemy&#039;s movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.&lt;br /&gt;
|-&lt;br /&gt;
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.&lt;br /&gt;
|-&lt;br /&gt;
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Using custom logics ===&lt;br /&gt;
Logics that you have defined in JSON can be applied to a sprite in the .O file in the same way as other (hardcoded) enemy logics. For example, if you have the following logic&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      &amp;quot;logicName&amp;quot;: &amp;quot;Rodian&amp;quot;,&lt;br /&gt;
      &amp;quot;data&amp;quot;: {&lt;br /&gt;
         &amp;quot;alertSound&amp;quot;: &amp;quot;rodian1.voc&amp;quot;,&lt;br /&gt;
         ....&lt;br /&gt;
      }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC: Rodian&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use JSON-defined logics with generators, for example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SEQ&lt;br /&gt;
   LOGIC:         GENERATOR Rodian&lt;br /&gt;
   DELAY:         10&lt;br /&gt;
   INTERVAL:      5&lt;br /&gt;
   NUM_TERMINATE: 6&lt;br /&gt;
   MAX_ALIVE:     1&lt;br /&gt;
   MAX_DIST:      800&lt;br /&gt;
   MIN_DIST:      50&lt;br /&gt;
SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be &amp;quot;lifeless&amp;quot;. However, if the level has generators with a custom logic, this causes the original game to crash.&lt;br /&gt;
&lt;br /&gt;
=== Overriding hardcoded logics ===&lt;br /&gt;
You &#039;&#039;can&#039;&#039; override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, &amp;lt;code&amp;gt;storm1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;commando&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
If you override a boss logic, like &amp;lt;code&amp;gt;kell&amp;lt;/code&amp;gt; or one of the dark troopers, the enemy will behave like an ordinary enemy instead of a boss; they will lose their ability to trigger the BOSS elevator when they die.&lt;br /&gt;
&lt;br /&gt;
=== Custom logics and WAX files ===&lt;br /&gt;
A custom logic&#039;s behaviours/actions will correspond to WAX animations as follows&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Walking / moving&lt;br /&gt;
|- &lt;br /&gt;
| 1 || Primary attack&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Melee death&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Shooting / explosion death&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Dead&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Idle / stationary&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Primary attack conclusion (eg. recoil)&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Secondary attack&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Secondary attack conclusion&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &#039;&#039;unused&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || Pain&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This follows the same pattern as all the standard Dark Forces enemies.&lt;br /&gt;
&lt;br /&gt;
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has &#039;&#039;only&#039;&#039; a ranged attack, then this will be the primary attack (animations 1 and 6). If a logic has both melee and ranged attacks, the melee will be primary (animations 1 and 6) and the ranged attack will be secondary (animations 7 and 8).&lt;br /&gt;
&lt;br /&gt;
=== Reference ===&lt;br /&gt;
==== Projectile list ====&lt;br /&gt;
You can assign projectiles with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a projectile&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;punch&amp;lt;/code&amp;gt; || This is a special projectile used for the player&#039;s fists, and may not work with logics&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;pistol_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;rifle_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;thermal_det&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;repeater&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;plasma&amp;lt;/code&amp;gt; || Fusion cutter projectile&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;mortar&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;land_mine&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;land_mine_prox&amp;lt;/code&amp;gt; || Proximity land mine&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;land_mine_placed&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;concussion&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;cannon&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;missile&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;turret_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;remote_bolt&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;exp_barrel&amp;lt;/code&amp;gt; || An invisible projectile that is normally spawned when a barrel explodes&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;homing_missile&amp;lt;/code&amp;gt; || Mohc&#039;s homing missiles&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;probe_proj&amp;lt;/code&amp;gt; || Green interrogator droid projectile&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;bobafett_ball&amp;lt;/code&amp;gt; || Boba Fett&#039;s missiles&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Drop item list ====&lt;br /&gt;
You can assign drop items with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not drop anything when they die&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;PLANS&amp;lt;/code&amp;gt; || Death Star plans&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;PHRIK&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;NAVA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;DT_WEAPON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;DATATAPE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;RIFLE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;AUTOGUN&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MORTAR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;FUSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;CANNON&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;ENERGY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;POWER&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;PLASMA&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;DETONATOR&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;DETONATORS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;SHELL&amp;lt;/code&amp;gt; || Mortar shell&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;SHELLS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 18 || &amp;lt;code&amp;gt;MINE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 19 || &amp;lt;code&amp;gt;MINES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 20 || &amp;lt;code&amp;gt;MISSILE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 21 || &amp;lt;code&amp;gt;MISSILES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 22 || &amp;lt;code&amp;gt;SHIELD&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 23 || &amp;lt;code&amp;gt;RED_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 24 || &amp;lt;code&amp;gt;YELLOW_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 25 || &amp;lt;code&amp;gt;BLUE_KEY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 26 || &amp;lt;code&amp;gt;GOGGLES&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 27 || &amp;lt;code&amp;gt;CLEATS&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 28 || &amp;lt;code&amp;gt;MASK&amp;lt;/code&amp;gt; || Gas mask&lt;br /&gt;
|-&lt;br /&gt;
| 29 || &amp;lt;code&amp;gt;BATTERY&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 30 || &amp;lt;code&amp;gt;CODE1&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 31 || &amp;lt;code&amp;gt;CODE2&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 32 || &amp;lt;code&amp;gt;CODE3&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 33 || &amp;lt;code&amp;gt;CODE4&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 34 || &amp;lt;code&amp;gt;CODE5&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 35 || &amp;lt;code&amp;gt;CODE6&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 36 || &amp;lt;code&amp;gt;CODE7&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 37 || &amp;lt;code&amp;gt;CODE8&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 38 || &amp;lt;code&amp;gt;CODE9&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 39 || &amp;lt;code&amp;gt;INVINCIBLE&amp;lt;/code&amp;gt; || Shield supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 40 || &amp;lt;code&amp;gt;SUPERCHARGE&amp;lt;/code&amp;gt; || Weapon supercharge&lt;br /&gt;
|-&lt;br /&gt;
| 41 || &amp;lt;code&amp;gt;REVIVE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 42 || &amp;lt;code&amp;gt;LIFE&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 43 || &amp;lt;code&amp;gt;MEDKIT&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 44 || &amp;lt;code&amp;gt;PILE&amp;lt;/code&amp;gt; || Kyle&#039;s pile of weapons&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Death effect list ====&lt;br /&gt;
You can assign death effects with either their number or their string. Make sure strings are spelled correctly, exactly as shown in this table (either lowercase or uppercase may be used).&lt;br /&gt;
&lt;br /&gt;
Note that some effects inflict damage.&lt;br /&gt;
&lt;br /&gt;
{| border=1 cellpadding=6px&lt;br /&gt;
|-&lt;br /&gt;
! Number !! String&lt;br /&gt;
|-&lt;br /&gt;
| -1 || || Enemy will not have a death effect&lt;br /&gt;
|-&lt;br /&gt;
| 0 || &amp;lt;code&amp;gt;SMALL_EXP&amp;lt;/code&amp;gt; || small &amp;quot;puff&amp;quot; - blaster weapons&lt;br /&gt;
|-&lt;br /&gt;
| 1 || &amp;lt;code&amp;gt;THERMDET_EXP&amp;lt;/code&amp;gt; || thermal detonator explosion&lt;br /&gt;
|-&lt;br /&gt;
| 2 || &amp;lt;code&amp;gt;PLASMA_EXP&amp;lt;/code&amp;gt; || Green plasma &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || &amp;lt;code&amp;gt;MORTAR_EXP&amp;lt;/code&amp;gt; || mortar explosion&lt;br /&gt;
|-&lt;br /&gt;
| 4 || &amp;lt;code&amp;gt;CONCUSSION&amp;lt;/code&amp;gt; || concussion - first stage&lt;br /&gt;
|-&lt;br /&gt;
| 5 || &amp;lt;code&amp;gt;CONCUSSION2&amp;lt;/code&amp;gt; || concussion - second stage&lt;br /&gt;
|-&lt;br /&gt;
| 6 || &amp;lt;code&amp;gt;MISSILE_EXP&amp;lt;/code&amp;gt; || missile explosion&lt;br /&gt;
|-&lt;br /&gt;
| 7 || &amp;lt;code&amp;gt;MISSILE_WEAK&amp;lt;/code&amp;gt; || weaker version of the missle explosion&lt;br /&gt;
|-&lt;br /&gt;
| 8 || &amp;lt;code&amp;gt;PUNCH&amp;lt;/code&amp;gt; || punch&lt;br /&gt;
|-&lt;br /&gt;
| 9 || &amp;lt;code&amp;gt;CANNON_EXP&amp;lt;/code&amp;gt; || Blue cannon &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 10 || &amp;lt;code&amp;gt;REPEATER_EXP&amp;lt;/code&amp;gt; || repeater &amp;quot;puff&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| 11 || &amp;lt;code&amp;gt;LARGE_EXP&amp;lt;/code&amp;gt; || Land mine explosion&lt;br /&gt;
|-&lt;br /&gt;
| 12 || &amp;lt;code&amp;gt;EXP_BARREL&amp;lt;/code&amp;gt; || exploding barrel&lt;br /&gt;
|-&lt;br /&gt;
| 13 || &amp;lt;code&amp;gt;EXP_INVIS&amp;lt;/code&amp;gt; || an explosion that makes no sound and has no visual effect&lt;br /&gt;
|-&lt;br /&gt;
| 14 || &amp;lt;code&amp;gt;SPLASH&amp;lt;/code&amp;gt; || water splash&lt;br /&gt;
|-&lt;br /&gt;
| 15 || &amp;lt;code&amp;gt;EXP_35&amp;lt;/code&amp;gt; || medium explosion, 35 damage (used for probe droid death)&lt;br /&gt;
|-&lt;br /&gt;
| 16 || &amp;lt;code&amp;gt;EXP_NO_DMG&amp;lt;/code&amp;gt; || medium explosion, no damage (used for turret and welder deaths)&lt;br /&gt;
|-&lt;br /&gt;
| 17 || &amp;lt;code&amp;gt;EXP_25&amp;lt;/code&amp;gt; || medium explosion, 25 damage (used for Boba Fett missile explosions)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1553</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1553"/>
		<updated>2025-08-30T12:14:00Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Object Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Scripting functions will internally do an &#039;&#039;exists&#039;&#039; check before being executed. Therefore it is not necessary for you to check that an object exists in ForceScript before calling methods on it. If you try to manipulate an object (eg. set its position) that doesn&#039;t exist, nothing will happen. If you &#039;&#039;get&#039;&#039; a property from a non-existent object, a default value will be returned (usually zero).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;exists()&amp;lt;/code&amp;gt; function in ForceScript enables you to check for an object&#039;s existence so that you can make your script logic conditional on an object&#039;s existence. For example, you may want your script to do something only if a certain enemy has been killed, or a certain item has been collected.&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
ds.matchPosition(target);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== delete() ===&lt;br /&gt;
* Removes the object from the level&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;ewok2.delete();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addLogic(string) ===&lt;br /&gt;
* Adds a logic to the object. Works with scenery, enemy logics, and pickup items. (Still to do: enable adding a custom logic.)&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// turn the table into scenery so it becomes breakable&lt;br /&gt;
table.addLogic(&amp;quot;scenery&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add Nava card logic to the object so it can now be picked up&lt;br /&gt;
navcard.addLogic(&amp;quot;nava&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// add commando logic&lt;br /&gt;
com5.addLogic(&amp;quot;commando&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1552</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1552"/>
		<updated>2025-08-30T11:51:48Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Getting objects by name */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float3 pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is always wise to check if an object exists before doing something with it. Objects will often stop existing in Dark Forces (eg. killed enemies, destroyed scenery, ammo items that have been picked up)&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
if (ds.exists())&lt;br /&gt;
{&lt;br /&gt;
    ds.matchPosition(target);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1551</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1551"/>
		<updated>2025-08-30T11:50:48Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Methods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;Script Object&#039;&#039;&#039; API enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once an object has been gotten by name, the script can do things with it.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object mb1 = level.getObject(&amp;quot;mousebot1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (mb1.exists())&lt;br /&gt;
{&lt;br /&gt;
    // Get the mousebot&#039;s position and move it eastwards by 20 units&lt;br /&gt;
    float pos = mb1.position;&lt;br /&gt;
    mb1.position = { pos.x + 20, pos.y, pos.z };&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Methods ==&lt;br /&gt;
&lt;br /&gt;
=== exists() ===&lt;br /&gt;
* Returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object exists, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object trooper = level.getObject(&amp;quot;stormtrooper3&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
if (trooper.exists())&lt;br /&gt;
{&lt;br /&gt;
   ...&lt;br /&gt;
   ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is always wise to check if an object exists before doing something with it. Objects will often stop existing in Dark Forces (eg. killed enemies, destroyed scenery, ammo items that have been picked up)&lt;br /&gt;
&lt;br /&gt;
=== isPlayer() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the object is the player, otherwise returns &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(Object) ===&lt;br /&gt;
* moves the object to the same position as another object&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Object target = level.getObject(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
Object ds = level.getObject(&amp;quot;deathstar_plans&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// move the death star plans to the same position as the spirit marker&lt;br /&gt;
if (ds.exists())&lt;br /&gt;
{&lt;br /&gt;
    ds.matchPosition(target);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== matchPosition(string) ===&lt;br /&gt;
* moves the object to the same position as another object by name&lt;br /&gt;
* usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// does the same as the above example, but uses the object&#039;s name&lt;br /&gt;
ds.matchPosition(&amp;quot;spirit7&amp;quot;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1550</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1550"/>
		<updated>2025-08-30T11:23:35Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Object Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Object Script&#039;&#039;&#039; enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s yaw (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.yaw = 120.0;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== radius ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.radius = 1.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldWidth ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s radius / world width (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldWidth = 1.5;    // this is the same as radius&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== height ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.height = 9.5;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== worldHeight ===&lt;br /&gt;
* Get or set &lt;br /&gt;
* Gets or sets the object&#039;s height / world height (float)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;myObj.worldHeight = 9.5;  // this is the same as height&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1549</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1549"/>
		<updated>2025-08-30T09:04:59Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Object Script&#039;&#039;&#039; enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Properties ==&lt;br /&gt;
&lt;br /&gt;
=== sector ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the object&#039;s current sector (&amp;lt;code&amp;gt;Sector&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector troopSector = my_trooper.sector&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the object&#039;s position (float3)&lt;br /&gt;
* Usage example: move the object to coordinates x20, y80, z-350&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
myObj.position = {20, 80, -350};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1548</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1548"/>
		<updated>2025-08-30T08:52:37Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Getting objects&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Object Script&#039;&#039;&#039; enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Getting objects by name ==&lt;br /&gt;
To get objects by their name, use the methods in the [[Level_Script_API#Methods|Level Script]] API.&lt;br /&gt;
* &amp;lt;code&amp;gt;getObject&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;getObjectsByName&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Level_Script_API&amp;diff=1547</id>
		<title>Level Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Level_Script_API&amp;diff=1547"/>
		<updated>2025-08-30T08:49:39Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */  object getters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Level Script API.&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== minLayer ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the minimum map layer (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.minLayer;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== maxLayer ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the maximum map layer (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.maxLayer;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sectorCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the total count of sectors (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.sectorCount&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== secretCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the total count of secrets (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.secretCount&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== textureCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the total count of textures (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.textureCount&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== elevatorCount ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the total count of elevators (signed integer)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int i = level.elevatorCount&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== parallax ===&lt;br /&gt;
* Get only&lt;br /&gt;
* Gets the parallax (float2)&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float2 pa = level.parallax;&lt;br /&gt;
float horzParallax = pa.x;&lt;br /&gt;
float vertParallax = pa.y;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== gravity ===&lt;br /&gt;
* Set only&lt;br /&gt;
* Sets the level&#039;s gravity (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;level.gravity = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== projectileGravity ===&lt;br /&gt;
* Set only&lt;br /&gt;
* Sets the projectile gravity (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;level.projectileGravity = 60;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Special sector getters ==&lt;br /&gt;
=== bossSector ===&lt;br /&gt;
* Gets the boss sector (Sector)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector bossSect = level.bossSector;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== mohcSector ===&lt;br /&gt;
* Gets the mohc sector (Sector)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector mohcSect = level.mohcSector;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== completeSector ===&lt;br /&gt;
* Gets the complete sector (Sector)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector completeSect = level.completeSector;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== getSector(int) ===&lt;br /&gt;
* Return value: Sector&lt;br /&gt;
* Parameters: sector Id (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector mySector = level.getSector(14);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getSector(string) ===&lt;br /&gt;
* Return value: Sector&lt;br /&gt;
* Parameters: sector name (string)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Sector mySector = level.getSector(&amp;quot;door6&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getElevator(int) ===&lt;br /&gt;
* Return value: Elevator&lt;br /&gt;
* Parameters: elevator Id (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Elevator myElev = level.getElevator(9);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== findConnectedSectors(Sector, uint, array&amp;lt;Sector&amp;gt;) ===&lt;br /&gt;
* Return value: void&lt;br /&gt;
* Parameters: &lt;br /&gt;
** the starting sector (Sector)&lt;br /&gt;
** properties to match on (uint); see sector properties enum&lt;br /&gt;
** an array of sectors that will be populated with sectors which are connected (adjoined) to the starting sector&lt;br /&gt;
* Usage example: get sector 5, then get all the sectors adjoined to it&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Sector mySector = level.getSector(5);&lt;br /&gt;
array&amp;lt;Sector&amp;gt; sectorList;&lt;br /&gt;
level.findConnectedSectors(mySector, 0, sectorList);&lt;br /&gt;
system.print(&amp;quot;My sector has {} adjoining sectors&amp;quot;, sectorList.length);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getObject(int) ===&lt;br /&gt;
* Return value: Object&lt;br /&gt;
* Parameter: object Id (int)&lt;br /&gt;
&lt;br /&gt;
=== getObject(string) ===&lt;br /&gt;
* Gets an object by its name. If there are multiple objects with the same name, the first one found will be returned.&lt;br /&gt;
* Return value: Object&lt;br /&gt;
* Parameter: object name (string)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;Object myobj = level.getObject(&amp;quot;commando_13&amp;quot;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getObjectsByName(string, array&amp;lt;Object&amp;gt;) ===&lt;br /&gt;
* Gets all objects with a given name into an array.&lt;br /&gt;
* Return value: void&lt;br /&gt;
* Parameters:&lt;br /&gt;
** name of objects to get (string)&lt;br /&gt;
** an array of objects that will be populated by the function&lt;br /&gt;
&lt;br /&gt;
* Usage example: get all objects that have the name &amp;quot;squad&amp;quot;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
array&amp;lt;Object&amp;gt; mySquad;&lt;br /&gt;
level.getObjectsByName(&amp;quot;squad&amp;quot;, mySquad);&lt;br /&gt;
system.print(&amp;quot;There are {} objects in the list&amp;quot;, mySquad.length);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1546</id>
		<title>Script Object</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Script_Object&amp;diff=1546"/>
		<updated>2025-08-30T08:38:50Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Object Script&amp;#039;&amp;#039;&amp;#039; enables manipulation of objects via ForceScript.  == Naming of objects == TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &amp;#039;&amp;#039;case insensitive&amp;#039;&amp;#039; like sector names.  Objects are named in the .O file as shown here:  &amp;lt;pre&amp;gt; /* 006 SEWERBUG.WAX  */ CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1  SEQ   LOGIC:     SEWER1...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Object Script&#039;&#039;&#039; enables manipulation of objects via ForceScript.&lt;br /&gt;
&lt;br /&gt;
== Naming of objects ==&lt;br /&gt;
TFE introduces the ability to name objects, so that they can be referenced by the scripting system. Names may be up to 32 characters and are &#039;&#039;case insensitive&#039;&#039; like sector names.&lt;br /&gt;
&lt;br /&gt;
Objects are named in the .O file as shown here:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/* 006 SEWERBUG.WAX  */&lt;br /&gt;
CLASS: SPRITE  DATA:  3 X: 232.00 Y: 0.00  Z: 264.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     SEWER1&lt;br /&gt;
  NAME: sewer-creature2&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 007 REMOTE.WAX    */&lt;br /&gt;
CLASS: SPRITE  DATA:  2 X: 280.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     REMOTE&lt;br /&gt;
  NAME: cool-remote&lt;br /&gt;
 SEQEND&lt;br /&gt;
&lt;br /&gt;
/* 008 MOUSEBOT.3DO  */&lt;br /&gt;
CLASS: 3D      DATA:  2 X: 256.00 Y: 0.00  Z: 232.00 PCH: 0.00  YAW: 0.00  ROL: 0.00  DIFF: 1&lt;br /&gt;
 SEQ&lt;br /&gt;
  LOGIC:     MOUSEBOT&lt;br /&gt;
  NAME: mouse4&lt;br /&gt;
 SEQEND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1542</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1542"/>
		<updated>2025-04-18T03:04:05Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Properties */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disabledActions ===&lt;br /&gt;
* Get the player actions that have currently been disabled&lt;br /&gt;
* Usage example: check if firing has been disabled&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.disabledActions &amp;amp; ACTION_FIRE)&lt;br /&gt;
{&lt;br /&gt;
   // firing has been disabled&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disableActions(PlayerActions) ===&lt;br /&gt;
* Disable the player&#039;s actions&lt;br /&gt;
* Parameter: actions to disable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: disable player&#039;s movement and weapon firing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_MOVE | ACTION_FIRE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable all actions (movement, rotation and firing)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_ALL);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== enableActions(PlayerActions) ===&lt;br /&gt;
* Enable the player&#039;s actions if they have been disabled&lt;br /&gt;
* Parameter: actions to enable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: enable player&#039;s movement and rotation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.enableActions(ACTION_MOVE | ACTION_ROTATE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1541</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1541"/>
		<updated>2025-04-18T02:59:24Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disableActions(PlayerActions) ===&lt;br /&gt;
* Disable the player&#039;s actions&lt;br /&gt;
* Parameter: actions to disable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: disable player&#039;s movement and weapon firing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_MOVE | ACTION_FIRE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Disable all actions (movement, rotation and firing)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_ALL);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== enableActions(PlayerActions) ===&lt;br /&gt;
* Enable the player&#039;s actions if they have been disabled&lt;br /&gt;
* Parameter: actions to enable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: enable player&#039;s movement and rotation&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.enableActions(ACTION_MOVE | ACTION_ROTATE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1540</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1540"/>
		<updated>2025-04-18T02:53:13Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== disableActions(PlayerAction) ===&lt;br /&gt;
* Disable the player&#039;s actions&lt;br /&gt;
* Parameter: actions to disable (&amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum) - note these can be added together&lt;br /&gt;
* Usage example: disable player&#039;s movement and weapon firing&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
player.disableActions(ACTION_MOVE | ACTION_FIRE);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1539</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1539"/>
		<updated>2025-04-18T02:47:01Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* PlayerActions enum */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerAction&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1538</id>
		<title>Player Script API</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1538"/>
		<updated>2025-04-18T02:46:35Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Enums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;br /&gt;
&lt;br /&gt;
== Enums ==&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PLANS&lt;br /&gt;
|-&lt;br /&gt;
| PHRIK&lt;br /&gt;
|-&lt;br /&gt;
| NAVA&lt;br /&gt;
|-&lt;br /&gt;
| DT_WEAPON&lt;br /&gt;
|-&lt;br /&gt;
| DATATAPE&lt;br /&gt;
|-&lt;br /&gt;
| ITEM10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| PISTOL&lt;br /&gt;
|-&lt;br /&gt;
| RIFLE&lt;br /&gt;
|-&lt;br /&gt;
| REPEATER&lt;br /&gt;
|-&lt;br /&gt;
| FUSION&lt;br /&gt;
|-&lt;br /&gt;
| MORTAR&lt;br /&gt;
|-&lt;br /&gt;
| CONCUSSION&lt;br /&gt;
|-&lt;br /&gt;
| CANNON&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;AMMO&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_ENERGY&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_POWER&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_DETONATOR&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_SHELL&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_PLASMA&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MINE&lt;br /&gt;
|-&lt;br /&gt;
| AMMO_MISSILE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== &amp;lt;code&amp;gt;PlayerActions&amp;lt;/code&amp;gt; enum ====&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
| ACTION_MOVE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ROTATE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_FIRE&lt;br /&gt;
|-&lt;br /&gt;
| ACTION_ALL&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
&lt;br /&gt;
=== position ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s current position (float3)&lt;br /&gt;
* You will not be allowed to move the player outside of a sector&lt;br /&gt;
* Usage example: get the current player position and change it to 10 units higher altitude&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
float3 currentPos = player.position;&lt;br /&gt;
player.position = {currentPos.x, currentPos.y + 10, currentPos.z};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== yaw ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s yaw, in degrees (float)&lt;br /&gt;
* Usage example: make the player face south&lt;br /&gt;
* &amp;lt;code&amp;gt;player.yaw = 180;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== velocity ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s velocity (float3)&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 100 north + 100 west&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {-100.0, 0, 100.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Usage example: set the player&#039;s velocity to 50 upwards and 30 south&lt;br /&gt;
&amp;lt;pre&amp;gt;player.velocity = {0, 50.0, -30.0};&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== health ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s health (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.health = 80;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== shields ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s shields (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.shields = 200;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== battery ===&lt;br /&gt;
* Get or set&lt;br /&gt;
* Gets or sets the player&#039;s battery, as a percentage (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.battery = 60;     // 60 percent battery will be 3 lights on the HUD&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
&lt;br /&gt;
=== kill() ===&lt;br /&gt;
* Instantly kill the player&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.kill();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToHealth(int) === &lt;br /&gt;
* Add an amount to the player&#039;s health&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToHealth(-30); // subtract 30 from the player&#039;s health&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addToShields(int) ===&lt;br /&gt;
* Add an amount to the player&#039;s shields&lt;br /&gt;
* Parameter: amount (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.addToShields(10);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== getAmmo(AMMO) ===&lt;br /&gt;
* returns the current amount of ammo (int)&lt;br /&gt;
* Parameter: ammo type (AMMO enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;int shells = player.getAmmo(AMMO_SHELL);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== setAmmo(AMMO, int) ===&lt;br /&gt;
* sets the ammo to a value&lt;br /&gt;
* Parameters: ammo type (AMMO enum), value (int)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.setAmmo(AMMO_PLASMA, 200);  // set plasma ammo to 200&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasRedKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the red key&lt;br /&gt;
* Usage example: &lt;br /&gt;
&amp;lt;pre&amp;gt;if (player.hasRedKey())&lt;br /&gt;
{ &lt;br /&gt;
 .... &lt;br /&gt;
} &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasBlueKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the blue key&lt;br /&gt;
&lt;br /&gt;
=== hasYellowKey() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the yellow key&lt;br /&gt;
&lt;br /&gt;
=== hasGoggles() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the IR Goggles&lt;br /&gt;
&lt;br /&gt;
=== hasCleats() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the ice cleats&lt;br /&gt;
&lt;br /&gt;
=== hasMask() ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the gasmask&lt;br /&gt;
&lt;br /&gt;
=== giveRedKey() ===&lt;br /&gt;
* adds the red key to the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.giveRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveBlueKey() ===&lt;br /&gt;
* adds the blue key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveYellowKey() ===&lt;br /&gt;
* adds the yellow key to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveGoggles() ===&lt;br /&gt;
* adds the IR Goggles to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCleats() ===&lt;br /&gt;
* adds the ice cleats to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveMask() ===&lt;br /&gt;
* adds the gas mask to the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeRedKey() ===&lt;br /&gt;
* removes the red key from the player&#039;s inventory&lt;br /&gt;
* usage example: &amp;lt;code&amp;gt;player.removeRedKey();&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeBlueKey() ===&lt;br /&gt;
* removes the blue key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeYellowKey() ===&lt;br /&gt;
* removes the yellow key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeGoggles() ===&lt;br /&gt;
* removes the IR Goggles key from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeCleats() ===&lt;br /&gt;
* removes the ice cleats from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== removeMask() ===&lt;br /&gt;
* removes the gas mask from the player&#039;s inventory&lt;br /&gt;
&lt;br /&gt;
=== giveCodeKey(int) ===&lt;br /&gt;
* adds a code key to the inventory&lt;br /&gt;
* Parameter: number of code key (1 to 9)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveCodeKey(4);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveItem(ITEM) ===&lt;br /&gt;
* adds an item to the player&#039;s inventory&lt;br /&gt;
* Parameter: item type (see &amp;lt;code&amp;gt;ITEM&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveItem(PHRIK)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== hasWeapon(WEAPON) ===&lt;br /&gt;
* returns &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; if the player has the weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (player.hasWeapon(FUSION))&lt;br /&gt;
{&lt;br /&gt;
 ....&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== giveWeapon(WEAPON) ===&lt;br /&gt;
* gives the player a weapon&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.giveWeapon(CONCUSSION);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== removeWeapon(WEAPON) ===&lt;br /&gt;
* removes a weapon from the player&#039;s inventory&lt;br /&gt;
* Parameter: weapon type (see &amp;lt;code&amp;gt;WEAPON&amp;lt;/code&amp;gt; enum)&lt;br /&gt;
* Usage example: &amp;lt;code&amp;gt;player.removeWeapon(RIFLE);&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
</feed>