<?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-05-16T12:09:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<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>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Level_Script_API&amp;diff=1537</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=1537"/>
		<updated>2025-04-18T02:40:42Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */&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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1536</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=1536"/>
		<updated>2025-04-01T11:03:25Z</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;
== 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=1535</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=1535"/>
		<updated>2025-04-01T10:54:31Z</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;
== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1534</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=1534"/>
		<updated>2025-04-01T10:42:58Z</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;
== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Level_Script_API&amp;diff=1533</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=1533"/>
		<updated>2025-03-28T17:58:26Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &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;
=== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1532</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=1532"/>
		<updated>2025-03-28T16:27:53Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &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;
== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1531</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=1531"/>
		<updated>2025-03-28T16:18:39Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &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;
== 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 (float in degrees)&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;
== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Player_Script_API&amp;diff=1530</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=1530"/>
		<updated>2025-03-28T15:56:39Z</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;
== Properties ==&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=1529</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=1529"/>
		<updated>2025-03-28T15:49:23Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;Documentation for TFE Player Script API.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Documentation for TFE Player Script API.&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Mod_Overrides&amp;diff=1528</id>
		<title>TFE Mod Overrides</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Mod_Overrides&amp;diff=1528"/>
		<updated>2025-03-23T08:26:20Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* THE Override Configuration Details */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page we will discuss how to override The Force Engine (TFE) mod configurations. We will discuss using a custom mod configuration file that looks like this. At the moment, there are two types of overrides. One type is processed only by TFE and another is processed by both Dark Forces Remaster and TFE. We will first talk about the TFE-only overrides. &lt;br /&gt;
[[File:ModConfImageTrue.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
== What is a Mod Configuration File? ==&lt;br /&gt;
You can change many different aspects of your mod by placing a configuration file called &#039;&#039;&#039;MOD_CONF.txt&#039;&#039;&#039; inside your mod&#039;s GOB archive (using a tool like [https://df-21.net/downloads/utilities.php Conman] ). When present, this file will make TFE act differently than it would in a regular game. You could change the amount of lives you have on start, and what weapons are available. You can even start the mission wearing a Gas Mask!  &#039;&#039;&#039;&#039;&#039;Note:&#039;&#039;&#039; The Dark Forces Remaster only loads MOD_CONF from the GOB!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MOD CONF Gob.png|thumb|541x541px|The MOD_CONF.txt should look like this in your GOB...|center]]Now that you know where to place the configuration file, lets look inside it!&lt;br /&gt;
=== How do I create or edit a MOD_CONF.txt file and what is JSON? ===&lt;br /&gt;
Simply open your favorite text editor (like Notepad) and create a new file. Then you will be able to edit the text as necessary. The file itself is in the format of a JSON  like the level metadata.txt. You can read about the format here --&amp;gt; [https://www.w3schools.com/js/js_json_intro.asp JSON Tutorial]  . Basically, you surround each section with brackets { and } putting configuration data inside each section. Any word &#039;&#039;&#039;must&#039;&#039;&#039; to be surrounded with &#039;&#039;&#039;quotation&#039;&#039;&#039; &#039;&#039;&#039;marks&#039;&#039;&#039;. Each configuration is in the format of &#039;&#039;&#039;KEY :&#039;&#039;&#039; VALUE&lt;br /&gt;
&lt;br /&gt;
And example could be &amp;quot;hello&amp;quot; : &amp;quot;world&amp;quot; or &amp;quot;dark&amp;quot; : &amp;quot;forces&amp;quot;. In this case, the name of the key is &#039;&#039;&#039;hello&#039;&#039;&#039; or &#039;&#039;&#039;dark&#039;&#039;&#039; and the value is &#039;&#039;&#039;world&#039;&#039;&#039; or &#039;&#039;&#039;forces.&#039;&#039;&#039; Then you surround everything with brackets.&lt;br /&gt;
 &#039;&#039;&#039;{&amp;quot;hello&amp;quot; : &amp;quot;world&amp;quot;}&#039;&#039;&#039;&lt;br /&gt;
That&#039;s what a valid configuration looks like above. You can also place one configuration inside another.&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;{&amp;quot;hello&amp;quot; : {&amp;quot;dark&amp;quot;: &amp;quot;forces&amp;quot;}}&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
So in the case above the key &#039;&#039;&#039;hello&#039;&#039;&#039; is equal to another key-value pair called {&amp;quot;dark&amp;quot; :&amp;quot;forces&amp;quot;}.  You can put as many as you want inside each other. &lt;br /&gt;
&lt;br /&gt;
If you have multiple values just add commas between them.&lt;br /&gt;
 {&amp;quot;name&amp;quot; : &amp;quot;Kyle&amp;quot;, &amp;quot;lastname&amp;quot; : &amp;quot;Katarn&amp;quot;, &amp;quot;Age&amp;quot; : 25, ...... etc... }&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT!!! It is very easy to make a typo in your JSON file. Go to this website, paste your MOD_CONF.txt&#039;&#039;&#039; contents and verify that there are no errors --&amp;gt; https://jsonlint.com/&lt;br /&gt;
&lt;br /&gt;
Remember after you create your MOD_CONF.txt to add it your GOB archive.  &lt;br /&gt;
&lt;br /&gt;
==== What is the structure of a MOD_CONF.txt file? ====&lt;br /&gt;
Below is a an example of a level configuration. &lt;br /&gt;
&lt;br /&gt;
At the top the first key is &#039;&#039;&#039;TFE_VERSION&#039;&#039;&#039; . This is a validation checks that tells the The Force Engine two things. The first is what format the MOD_CONF file is in. We may add new categories and structures to the JSON as times goes along. Additionally, the version may tell TFE what features MOD_CONF expects to be supported.  As we add more features the MOD_CONF the version will increase. At the moment, the version is &#039;&#039;&#039;1&#039;&#039;&#039; and supports all features. If this value is missing the validation is skipped and, if there are any issues, the loading of the override is skipped.  &lt;br /&gt;
&lt;br /&gt;
The second key is &#039;&#039;&#039;TFE_OVERRIDES&#039;&#039;&#039;. This tells the game that everything inside is used as configuration for TFE.&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
         &amp;quot;levelOverrides&amp;quot;: {&lt;br /&gt;
             &amp;quot;SECBASE.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
                 &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
                 &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
                 &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
                 &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
                 &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== TFE Setting Overrides ====&lt;br /&gt;
Inside the TFE overrides section you can add your own custom setting overrides. For example, if you want to disable fight music  you can do so by either going into the Game Settings and check the values you want enabled  or disabled. Or you can do it by updating the MOD_CONF.txt file by adding your own overrides. For example, if you want to disable fight music in your mod with overrides, add the key &#039;&#039;&#039;&amp;quot;disableFightMusic&amp;quot;&#039;&#039;&#039; and set the value to &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;. &lt;br /&gt;
 &amp;quot;disableFightMusic&amp;quot; : true &lt;br /&gt;
And if you want to always run you can add a new TFE Override &#039;&#039;&#039;autorun&#039;&#039;&#039; and set it to true.&lt;br /&gt;
 &amp;quot;autorun&amp;quot; : true&lt;br /&gt;
Below is an example of how the setting options look like in the user interface. You can get to these by going into the Settings section of The Force Engine and clicking on &amp;quot;Game Settings&amp;quot;. &lt;br /&gt;
[[File:Override Settings.png|center|thumb|677x677px]]&lt;br /&gt;
You can replicate the above using the mod_conf TFE overrides. A full example of the above picture is shown below. &lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
        &amp;quot;disableFightMusic&amp;quot; : true,&lt;br /&gt;
        &amp;quot;enableAutoaim&amp;quot; : true,&lt;br /&gt;
        &amp;quot;showSecretFoundMsg&amp;quot; : true,&lt;br /&gt;
        &amp;quot;bobaFettFacePlayer&amp;quot; :  true,&lt;br /&gt;
        &amp;quot;ignoreInfLimit&amp;quot; : true,&lt;br /&gt;
        &amp;quot;solidWallFlagFix&amp;quot; : true,&lt;br /&gt;
        &amp;quot;enableUnusedItem&amp;quot; :  true,&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
Here is the full description of the override settings.&lt;br /&gt;
 disableFightMusic  - Turns off the fight music in your mod&lt;br /&gt;
 enableAutoaim      - Turns the autoaiming on or off. &lt;br /&gt;
 showSecretFoundMsg - Allows you to toggle the secret found message added to TFE. &lt;br /&gt;
 autorun            - Toggles the autorun option. &lt;br /&gt;
 crouchToggle       - Changes how crouch behaves. You can press it once to toggle crouching instead of holding a button.&lt;br /&gt;
 bobaFettFacePlayer - A fix to make Boba Fett face the player. &lt;br /&gt;
 smoothVUEs         - Makes VUE transitions smoother by normalizing the fractional frame indexes. &lt;br /&gt;
 ignoreInfLimit     - Removes the limit of INF scripts. &lt;br /&gt;
 stepSecondAlt      - Allows you to automatically step on to Second Altitude sectors.&lt;br /&gt;
 solidWallFlagFix   - Solid wall flag is enforced for collision with moving walls&lt;br /&gt;
 enableUnusedItem   - Enables the unused item in the inventory (delt 10).&lt;br /&gt;
Simply apply them as you see fit for your mod. This section will expand as more overrides become available. &lt;br /&gt;
&lt;br /&gt;
And now we will talk about a special TFE override setting called &#039;&#039;&#039;levelOverrrides&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Level Overrides ====&lt;br /&gt;
Inside the TFE overrides section there is also an &#039;&#039;&#039;levelOverrides&#039;&#039;&#039; section. This tells the game that there will be a configuration for each level name that you define.&lt;br /&gt;
&lt;br /&gt;
Inside the &#039;&#039;&#039;levelOverrides&#039;&#039;&#039; section is a comma-separated listing of levels you want to override. For example if you want to change the behavior of SECBASE you would add SECBASE.LEV configuration and if you want to configure TALAY then you would write down TALAY.LEV. You can add as many as you want depending on how many maps you have in your GOB. &lt;br /&gt;
&lt;br /&gt;
===== Structure of a Level Override Section =====&lt;br /&gt;
Lets look at the detail of level override section. You will see that it is a listing of key-value pairs. Some of them are set to &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039; and some have numerical values. &lt;br /&gt;
&lt;br /&gt;
====== SECBASE.LEV ======&lt;br /&gt;
Lets look at the section for &#039;&#039;&#039;SECBASE.LEV&#039;&#039;&#039;&lt;br /&gt;
 &amp;quot;SECBASE.LEV&amp;quot;: &lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
    &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
    &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
    &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
    &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
 }&lt;br /&gt;
What each key does is change the behavior of the level in the game. Lets look at the part that says &lt;br /&gt;
    &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;pistol&#039;&#039;&#039; and the value is &#039;&#039;&#039;false.&#039;&#039;&#039; This means that it will &#039;&#039;&#039;remove&#039;&#039;&#039; the pistol from the mission&#039;s inventory. Lets continue...&lt;br /&gt;
    &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;rifle&#039;&#039;&#039; and the value is &#039;&#039;&#039;true.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;add&#039;&#039;&#039; the rifle to your inventory. &lt;br /&gt;
    &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;power&#039;&#039;&#039; and the value is &#039;&#039;&#039;300.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the repeater ammo power to 300 units.&#039;&#039;&#039; Notice that there are no quotes around 300 - that&#039;s because we don&#039;t need to do that when dealing with numbers. &lt;br /&gt;
    &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;detonator&#039;&#039;&#039; and the value is &#039;&#039;&#039;5.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the thermal detonator to 5.&#039;&#039;&#039; &lt;br /&gt;
    &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;shields&#039;&#039;&#039; and the value is &#039;&#039;&#039;150.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the shields to 150.&#039;&#039;&#039; Note that there is no comma after 150 . &lt;br /&gt;
&lt;br /&gt;
Remember, all of these changes only apply to the SECBASE.LEV mission! &lt;br /&gt;
&lt;br /&gt;
====== TALAY.LEV ======&lt;br /&gt;
Now lets look at the next section for TALAY.LEV.  &lt;br /&gt;
 &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
    &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
    &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
 }&lt;br /&gt;
Here, we have two key - value pairs. &lt;br /&gt;
    &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;bryarOnly&#039;&#039;&#039; and the value is &#039;&#039;&#039;true.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;remove&#039;&#039;&#039; your entire inventory and give you only a bryar pistol! &lt;br /&gt;
    &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;lives&#039;&#039;&#039;  and the value is &#039;&#039;&#039;1&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;give you only 1 life!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
=== THE Override Configuration Details ===&lt;br /&gt;
Now that you know how everything works lets go over each key and what it does! &lt;br /&gt;
&lt;br /&gt;
===== Weapons and Inventory =====&lt;br /&gt;
When you set the value to &#039;&#039;&#039;true&#039;&#039;&#039; item will be added. When set to &#039;&#039;&#039;false&#039;&#039;&#039; the item will be removed from the player&#039;s inventory. So if your key is &amp;quot;&#039;&#039;&#039;pistol&#039;&#039;&#039;&amp;quot; then the two values you can set are either &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;f&#039;&#039;&#039;alse. &lt;br /&gt;
 pistol -     Add or Remove the Bryar Pistol from the inventory&lt;br /&gt;
 rifle -      Add or Remove the E-11 Imperial Rifle from the inventory&lt;br /&gt;
 autogun -    Add or Remove the Repeater Gun from the inventory&lt;br /&gt;
 mortar -     Add or Remove the Packard Mortar from the inventory&lt;br /&gt;
 fusion -     Add or Remove the Fusion Cutter from the inventory&lt;br /&gt;
 concussion - Add or Remove the Concussion Rifle from the inventory&lt;br /&gt;
 cannon -     Add or Remove the Dark Trooper Cannon from the inventory&lt;br /&gt;
 mask -       Add or Remove the Gas Mask from the inventory&lt;br /&gt;
 goggles -    Add or Remove the Night Vision Goggles from the inventory&lt;br /&gt;
 cleats -     Add or Remove the Ice Cleats from the inventory&lt;br /&gt;
&lt;br /&gt;
===== Ammunition and Health =====&lt;br /&gt;
These  typically set your a numeric value for your ammunition and health. Just give the value nice whole numbers between 0 and the Max.&lt;br /&gt;
 energy -    Set the Energy (For E-11) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 power -     Set the Power (For the Repeater) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 plasma -    Set the Power (For the DT Cannon) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 detonator - Set the Thermal Detonator count. Max is &#039;&#039;&#039;999&#039;&#039;&#039;.&lt;br /&gt;
 shell  -    Set the Mortar Shells (for the Packard Mortar Cannon) to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;.&lt;br /&gt;
 mine -      Set the Imperial Mine count. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 missile -   Set the DT Weapon missiles to a specific value.  Max is &#039;&#039;&#039;99.&#039;&#039;&#039;&lt;br /&gt;
 shields -   Set your shields to a specific value. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 health -    Set your health to a specific value. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 lives -     Set your lives to a specific value. Max is &#039;&#039;&#039;9.&#039;&#039;&#039;&lt;br /&gt;
 battery -   Set your battery to a specific value. This is a percentage between &#039;&#039;&#039;0&#039;&#039;&#039; and &#039;&#039;&#039;100&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===== Custom Numerical Overrides =====&lt;br /&gt;
 defaultWeapon     - Set your starting equipped weapon. &#039;&#039;&#039;1&#039;&#039;&#039; is fists, &#039;&#039;&#039;2&#039;&#039;&#039; is Bryar ... &#039;&#039;&#039;0&#039;&#039;&#039; is the DT Cannon. Values between &#039;&#039;&#039;0&#039;&#039;&#039; and &#039;&#039;&#039;9&#039;&#039;&#039;. &lt;br /&gt;
 fogLevel          - Set the fog attenuation (Gromas Mines defaults to 30). Values between 0 and 100.&lt;br /&gt;
 floorDamageLow    - Set the low floor damage amount (player hitpoints per second, normal is 5)&lt;br /&gt;
 floorDamageHigh   - Set the high floor damage amount (player hitpoints per second, normal is 10)&lt;br /&gt;
 gasDamage         - Set the gas damage amount (player hitpoints per second, normal is 5)&lt;br /&gt;
 wallDamage        - Set the wall damage amount (player hitpoints per second, normal is 20)&lt;br /&gt;
 gravity           - Set the level&#039;s gravity for player and enemies (normal is 150)&lt;br /&gt;
 projectileGravity - Set the level&#039;s gravity for projectiles (normal is 120)&lt;br /&gt;
 shieldSuperchargeDuration  - Set the duration of the shield supercharge (seconds)&lt;br /&gt;
 weaponSuperchargeDuration  - Set the duration of the weapon supercharge (seconds)&lt;br /&gt;
 &lt;br /&gt;
 headlampBatteryConsumption - Set the headlamp battery consumption rate (float value, % per second, normal is 0.208)&lt;br /&gt;
 gogglesBatteryConsumption  - Set the IR goggles battery consumption rate (float value, % per second, normal is 0.833)&lt;br /&gt;
 maskBatteryConsumption     - Set the gasmask battery consumption rate (float value, % per second, normal is 0.833)&lt;br /&gt;
&lt;br /&gt;
===== Custom Overrides =====&lt;br /&gt;
We have some custom overrides for your mod.   &lt;br /&gt;
 enableMask -        Start the mission with your Gas Mask on &lt;br /&gt;
 enableCleats -      Start the mission with your Ice Cleats on.&lt;br /&gt;
 enableNightVision - Start the mission with your Night Vision enabled.&lt;br /&gt;
 enableHeadlamp -    Start the mission with your Head Lamp on. &lt;br /&gt;
 bryarOnly -         Start your mission with no inventory except a Bryar pistol and 100 ammo just like the first misison.&lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Remaster HD Overrides ===&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This is strictly optional and really should only be used to fix incorrect textures shown in the remaster!&lt;br /&gt;
&lt;br /&gt;
There is another optional type of override that can be added to MOD_CONF.txt file. These overrides change the quality of assets that are loaded into the game. The game will either load the High Definition (HD) or original low quality assets. This is required because, by default, the assets in the Dark Forces Remaster skip texture paletting and only show the HD version of the texture even if it doesn&#039;t fit the modded level. Most of the time you will never have to deal with this but some custom maps that use the GROMAS, JABSHIP, SEWERS or TALAY palettes will look strange in the remaster. &lt;br /&gt;
&lt;br /&gt;
[[File:MOD CONF HD.png|center|thumb]]&lt;br /&gt;
For now, lets go over the structure of the HD overrides. Just like before, you add the JSON overrides to MOD_CONF.txt like before. The idea is that you can specify whether to show HD or non HD versions of the PDA menu and the Mission Briefings. Additionally, you can specify per level, which textures you can override to show the non-HD versions instead of the HD versions. The asset types you can override are &#039;&#039;&#039;BMs&#039;&#039;&#039; (Textures), &#039;&#039;&#039;FMEs&#039;&#039;&#039; (Frames - Ex: Ammo Pick up) , WAX (Sprites like enemy stormtroopers) . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each asset type you would list the asset that should show the &#039;&#039;&#039;original&#039;&#039;&#039; version instead of the HD version. So if you want to show the original low-quality version of &#039;&#039;&#039;GPDIRTRD.BM&#039;&#039;&#039; you would add it to the list of BMs. &lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;HD_PDA&amp;quot;: false,&lt;br /&gt;
     &amp;quot;HD_BRIEF&amp;quot;: false,&lt;br /&gt;
     &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the low quality version of the &#039;&#039;&#039;GPDIRTRD.BM&#039;&#039;&#039;. If this override is added to MOD_CONF.txt then Dark Forces Remaster and TFE will show the original low quality version.&lt;br /&gt;
[[File:GPDIRTD LOW.png|center|thumb]]&lt;br /&gt;
If you remove the texture from the list it will show the default high-res version like the one below. &lt;br /&gt;
[[File:GPDIRTRD HIGH RES.png|center|thumb]]&lt;br /&gt;
The same concept works for FME and WAX assets. Just add them to the list of assets. &lt;br /&gt;
&lt;br /&gt;
==== HD override details ====&lt;br /&gt;
Here are the &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039; overrides for high resolution PDA or briefing. Both the Dark Forces Remaster and TFE will process these settings.&lt;br /&gt;
 HD_PDA -    Display the original or the high resolution version of the PDA. This is useful for custom imperial codes (&#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;)&lt;br /&gt;
 HD_BRIEF -  Display the original or the high resolution version of the Mission Briefing (&#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;). &lt;br /&gt;
Then we have a list of levels that should be overrides. Just like before you would write the name of the mission like SECBASE.LEV or TALAY.LEV and then list the types of assets that should show the low quality versions. The asset lists can be BMs FMEs or WAXs and are comma separated surrounded by brackets. &lt;br /&gt;
 &amp;lt;level_name&amp;gt;.LEV - Name of Level to override HD assets. Can be SECBASE.LEV, TALAY.LEV etc...&lt;br /&gt;
 &amp;lt;asset_type&amp;gt; - Must be either BM, WAX or FME. &lt;br /&gt;
An example is below for mission &#039;&#039;&#039;SECBASE.LEV&#039;&#039;&#039;&lt;br /&gt;
  &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you add this override, it will show the low-quality version of textures &#039;&#039;&#039;GPDIRTRD.BM,  SPSEWGE3.BM&#039;&#039;&#039; and &#039;&#039;&#039;GPMINE1X.BM&#039;&#039;&#039; from the BM list&#039;&#039;&#039;.&#039;&#039;&#039; It will also display the low-quality version of &#039;&#039;&#039;GFPIPEIS1.FME&#039;&#039;&#039; frame in the FME list. Finally, the Kell Dragon will be of low quality due to &#039;&#039;&#039;KELL.WAX&#039;&#039;&#039; being added to the WAX list. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Putting it altogether your MOD_CONF may look like this. Don&#039;t forget to ALWAYS check that you do not have any typos and validate with this website --&amp;gt;https://jsonlint.com/&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
         &amp;quot;levelOverrides&amp;quot;: {&lt;br /&gt;
             &amp;quot;SECBASE.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
                 &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
                 &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
                 &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
                 &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
                 &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     },&lt;br /&gt;
     &amp;quot;HD_PDA&amp;quot;: false,&lt;br /&gt;
     &amp;quot;HD_BRIEF&amp;quot;: false,&lt;br /&gt;
     &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
Remember, if you are stuck or confused somewhere ask in the DF-21 [https://discord.gg/6T9NvMh2MC Discord]  .&lt;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=TFE_Mod_Overrides&amp;diff=1527</id>
		<title>TFE Mod Overrides</title>
		<link rel="alternate" type="text/html" href="https://df-21.net/wiki/index.php?title=TFE_Mod_Overrides&amp;diff=1527"/>
		<updated>2025-03-23T07:27:21Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Custom Numerical Overrides */  add new ones&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page we will discuss how to override The Force Engine (TFE) mod configurations. We will discuss using a custom mod configuration file that looks like this. At the moment, there are two types of overrides. One type is processed only by TFE and another is processed by both Dark Forces Remaster and TFE. We will first talk about the TFE-only overrides. &lt;br /&gt;
[[File:ModConfImageTrue.png|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
== What is a Mod Configuration File? ==&lt;br /&gt;
You can change many different aspects of your mod by placing a configuration file called &#039;&#039;&#039;MOD_CONF.txt&#039;&#039;&#039; inside your mod&#039;s GOB archive (using a tool like [https://df-21.net/downloads/utilities.php Conman] ). When present, this file will make TFE act differently than it would in a regular game. You could change the amount of lives you have on start, and what weapons are available. You can even start the mission wearing a Gas Mask!  &#039;&#039;&#039;&#039;&#039;Note:&#039;&#039;&#039; The Dark Forces Remaster only loads MOD_CONF from the GOB!&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:MOD CONF Gob.png|thumb|541x541px|The MOD_CONF.txt should look like this in your GOB...|center]]Now that you know where to place the configuration file, lets look inside it!&lt;br /&gt;
=== How do I create or edit a MOD_CONF.txt file and what is JSON? ===&lt;br /&gt;
Simply open your favorite text editor (like Notepad) and create a new file. Then you will be able to edit the text as necessary. The file itself is in the format of a JSON  like the level metadata.txt. You can read about the format here --&amp;gt; [https://www.w3schools.com/js/js_json_intro.asp JSON Tutorial]  . Basically, you surround each section with brackets { and } putting configuration data inside each section. Any word &#039;&#039;&#039;must&#039;&#039;&#039; to be surrounded with &#039;&#039;&#039;quotation&#039;&#039;&#039; &#039;&#039;&#039;marks&#039;&#039;&#039;. Each configuration is in the format of &#039;&#039;&#039;KEY :&#039;&#039;&#039; VALUE&lt;br /&gt;
&lt;br /&gt;
And example could be &amp;quot;hello&amp;quot; : &amp;quot;world&amp;quot; or &amp;quot;dark&amp;quot; : &amp;quot;forces&amp;quot;. In this case, the name of the key is &#039;&#039;&#039;hello&#039;&#039;&#039; or &#039;&#039;&#039;dark&#039;&#039;&#039; and the value is &#039;&#039;&#039;world&#039;&#039;&#039; or &#039;&#039;&#039;forces.&#039;&#039;&#039; Then you surround everything with brackets.&lt;br /&gt;
 &#039;&#039;&#039;{&amp;quot;hello&amp;quot; : &amp;quot;world&amp;quot;}&#039;&#039;&#039;&lt;br /&gt;
That&#039;s what a valid configuration looks like above. You can also place one configuration inside another.&lt;br /&gt;
 &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;{&amp;quot;hello&amp;quot; : {&amp;quot;dark&amp;quot;: &amp;quot;forces&amp;quot;}}&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
So in the case above the key &#039;&#039;&#039;hello&#039;&#039;&#039; is equal to another key-value pair called {&amp;quot;dark&amp;quot; :&amp;quot;forces&amp;quot;}.  You can put as many as you want inside each other. &lt;br /&gt;
&lt;br /&gt;
If you have multiple values just add commas between them.&lt;br /&gt;
 {&amp;quot;name&amp;quot; : &amp;quot;Kyle&amp;quot;, &amp;quot;lastname&amp;quot; : &amp;quot;Katarn&amp;quot;, &amp;quot;Age&amp;quot; : 25, ...... etc... }&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT!!! It is very easy to make a typo in your JSON file. Go to this website, paste your MOD_CONF.txt&#039;&#039;&#039; contents and verify that there are no errors --&amp;gt; https://jsonlint.com/&lt;br /&gt;
&lt;br /&gt;
Remember after you create your MOD_CONF.txt to add it your GOB archive.  &lt;br /&gt;
&lt;br /&gt;
==== What is the structure of a MOD_CONF.txt file? ====&lt;br /&gt;
Below is a an example of a level configuration. &lt;br /&gt;
&lt;br /&gt;
At the top the first key is &#039;&#039;&#039;TFE_VERSION&#039;&#039;&#039; . This is a validation checks that tells the The Force Engine two things. The first is what format the MOD_CONF file is in. We may add new categories and structures to the JSON as times goes along. Additionally, the version may tell TFE what features MOD_CONF expects to be supported.  As we add more features the MOD_CONF the version will increase. At the moment, the version is &#039;&#039;&#039;1&#039;&#039;&#039; and supports all features. If this value is missing the validation is skipped and, if there are any issues, the loading of the override is skipped.  &lt;br /&gt;
&lt;br /&gt;
The second key is &#039;&#039;&#039;TFE_OVERRIDES&#039;&#039;&#039;. This tells the game that everything inside is used as configuration for TFE.&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
         &amp;quot;levelOverrides&amp;quot;: {&lt;br /&gt;
             &amp;quot;SECBASE.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
                 &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
                 &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
                 &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
                 &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
                 &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==== TFE Setting Overrides ====&lt;br /&gt;
Inside the TFE overrides section you can add your own custom setting overrides. For example, if you want to disable fight music  you can do so by either going into the Game Settings and check the values you want enabled  or disabled. Or you can do it by updating the MOD_CONF.txt file by adding your own overrides. For example, if you want to disable fight music in your mod with overrides, add the key &#039;&#039;&#039;&amp;quot;disableFightMusic&amp;quot;&#039;&#039;&#039; and set the value to &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;. &lt;br /&gt;
 &amp;quot;disableFightMusic&amp;quot; : true &lt;br /&gt;
And if you want to always run you can add a new TFE Override &#039;&#039;&#039;autorun&#039;&#039;&#039; and set it to true.&lt;br /&gt;
 &amp;quot;autorun&amp;quot; : true&lt;br /&gt;
Below is an example of how the setting options look like in the user interface. You can get to these by going into the Settings section of The Force Engine and clicking on &amp;quot;Game Settings&amp;quot;. &lt;br /&gt;
[[File:Override Settings.png|center|thumb|677x677px]]&lt;br /&gt;
You can replicate the above using the mod_conf TFE overrides. A full example of the above picture is shown below. &lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
        &amp;quot;disableFightMusic&amp;quot; : true,&lt;br /&gt;
        &amp;quot;enableAutoaim&amp;quot; : true,&lt;br /&gt;
        &amp;quot;showSecretFoundMsg&amp;quot; : true,&lt;br /&gt;
        &amp;quot;bobaFettFacePlayer&amp;quot; :  true,&lt;br /&gt;
        &amp;quot;ignoreInfLimit&amp;quot; : true,&lt;br /&gt;
        &amp;quot;solidWallFlagFix&amp;quot; : true,&lt;br /&gt;
        &amp;quot;enableUnusedItem&amp;quot; :  true,&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
Here is the full description of the override settings.&lt;br /&gt;
 disableFightMusic  - Turns off the fight music in your mod&lt;br /&gt;
 enableAutoaim      - Turns the autoaiming on or off. &lt;br /&gt;
 showSecretFoundMsg - Allows you to toggle the secret found message added to TFE. &lt;br /&gt;
 autorun            - Toggles the autorun option. &lt;br /&gt;
 crouchToggle       - Changes how crouch behaves. You can press it once to toggle crouching instead of holding a button.&lt;br /&gt;
 bobaFettFacePlayer - A fix to make Boba Fett face the player. &lt;br /&gt;
 smoothVUEs         - Makes VUE transitions smoother by normalizing the fractional frame indexes. &lt;br /&gt;
 ignoreInfLimit     - Removes the limit of INF scripts. &lt;br /&gt;
 stepSecondAlt      - Allows you to automatically step on to Second Altitude sectors.&lt;br /&gt;
 solidWallFlagFix   - Solid wall flag is enforced for collision with moving walls&lt;br /&gt;
 enableUnusedItem   - Enables the unused item in the inventory (delt 10).&lt;br /&gt;
Simply apply them as you see fit for your mod. This section will expand as more overrides become available. &lt;br /&gt;
&lt;br /&gt;
And now we will talk about a special TFE override setting called &#039;&#039;&#039;levelOverrrides&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==== Level Overrides ====&lt;br /&gt;
Inside the TFE overrides section there is also an &#039;&#039;&#039;levelOverrides&#039;&#039;&#039; section. This tells the game that there will be a configuration for each level name that you define.&lt;br /&gt;
&lt;br /&gt;
Inside the &#039;&#039;&#039;levelOverrides&#039;&#039;&#039; section is a comma-separated listing of levels you want to override. For example if you want to change the behavior of SECBASE you would add SECBASE.LEV configuration and if you want to configure TALAY then you would write down TALAY.LEV. You can add as many as you want depending on how many maps you have in your GOB. &lt;br /&gt;
&lt;br /&gt;
===== Structure of a Level Override Section =====&lt;br /&gt;
Lets look at the detail of level override section. You will see that it is a listing of key-value pairs. Some of them are set to &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039; and some have numerical values. &lt;br /&gt;
&lt;br /&gt;
====== SECBASE.LEV ======&lt;br /&gt;
Lets look at the section for &#039;&#039;&#039;SECBASE.LEV&#039;&#039;&#039;&lt;br /&gt;
 &amp;quot;SECBASE.LEV&amp;quot;: &lt;br /&gt;
 {&lt;br /&gt;
    &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
    &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
    &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
    &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
    &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
 }&lt;br /&gt;
What each key does is change the behavior of the level in the game. Lets look at the part that says &lt;br /&gt;
    &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;pistol&#039;&#039;&#039; and the value is &#039;&#039;&#039;false.&#039;&#039;&#039; This means that it will &#039;&#039;&#039;remove&#039;&#039;&#039; the pistol from the mission&#039;s inventory. Lets continue...&lt;br /&gt;
    &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;rifle&#039;&#039;&#039; and the value is &#039;&#039;&#039;true.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;add&#039;&#039;&#039; the rifle to your inventory. &lt;br /&gt;
    &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;power&#039;&#039;&#039; and the value is &#039;&#039;&#039;300.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the repeater ammo power to 300 units.&#039;&#039;&#039; Notice that there are no quotes around 300 - that&#039;s because we don&#039;t need to do that when dealing with numbers. &lt;br /&gt;
    &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;detonator&#039;&#039;&#039; and the value is &#039;&#039;&#039;5.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the thermal detonator to 5.&#039;&#039;&#039; &lt;br /&gt;
    &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;shields&#039;&#039;&#039; and the value is &#039;&#039;&#039;150.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;set the shields to 150.&#039;&#039;&#039; Note that there is no comma after 150 . &lt;br /&gt;
&lt;br /&gt;
Remember, all of these changes only apply to the SECBASE.LEV mission! &lt;br /&gt;
&lt;br /&gt;
====== TALAY.LEV ======&lt;br /&gt;
Now lets look at the next section for TALAY.LEV.  &lt;br /&gt;
 &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
    &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
    &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
 }&lt;br /&gt;
Here, we have two key - value pairs. &lt;br /&gt;
    &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;bryarOnly&#039;&#039;&#039; and the value is &#039;&#039;&#039;true.&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;remove&#039;&#039;&#039; your entire inventory and give you only a bryar pistol! &lt;br /&gt;
    &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
In this case, the key is &#039;&#039;&#039;lives&#039;&#039;&#039;  and the value is &#039;&#039;&#039;1&#039;&#039;&#039; This means that the game will &#039;&#039;&#039;give you only 1 life!&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
=== THE Override Configuration Details ===&lt;br /&gt;
Now that you know how everything works lets go over each key and what it does! &lt;br /&gt;
&lt;br /&gt;
===== Weapons and Inventory =====&lt;br /&gt;
When you set the value to &#039;&#039;&#039;true&#039;&#039;&#039; item will be added. When set to &#039;&#039;&#039;false&#039;&#039;&#039; the item will be removed from the player&#039;s inventory. So if your key is &amp;quot;&#039;&#039;&#039;pistol&#039;&#039;&#039;&amp;quot; then the two values you can set are either &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;f&#039;&#039;&#039;alse. &lt;br /&gt;
 pistol -     Add or Remove the Bryar Pistol from the inventory&lt;br /&gt;
 rifle -      Add or Remove the E-11 Imperial Rifle from the inventory&lt;br /&gt;
 autogun -    Add or Remove the Repeater Gun from the inventory&lt;br /&gt;
 mortar -     Add or Remove the Packard Mortar from the inventory&lt;br /&gt;
 fusion -     Add or Remove the Fusion Cutter from the inventory&lt;br /&gt;
 concussion - Add or Remove the Concussion Rifle from the inventory&lt;br /&gt;
 cannon -     Add or Remove the Dark Trooper Cannon from the inventory&lt;br /&gt;
 mask -       Add or Remove the Gas Mask from the inventory&lt;br /&gt;
 goggles -    Add or Remove the Night Vision Goggles from the inventory&lt;br /&gt;
 cleats -     Add or Remove the Ice Cleats from the inventory&lt;br /&gt;
&lt;br /&gt;
===== Ammunition and Health =====&lt;br /&gt;
These  typically set your a numeric value for your ammunition and health. Just give the value nice whole numbers between 0 and the Max.&lt;br /&gt;
 energy -    Set the Energy (For E-11) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 power -     Set the Power (For the Repeater) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 plasma -    Set the Power (For the DT Cannon) ammunition to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;&lt;br /&gt;
 detonator - Set the Thermal Detonator count. Max is &#039;&#039;&#039;999&#039;&#039;&#039;.&lt;br /&gt;
 shell  -    Set the Mortar Shells (for the Packard Mortar Cannon) to a specific value. Max is &#039;&#039;&#039;999&#039;&#039;&#039;.&lt;br /&gt;
 mine -      Set the Imperial Mine count. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 missile -   Set the DT Weapon missiles to a specific value.  Max is &#039;&#039;&#039;99.&#039;&#039;&#039;&lt;br /&gt;
 shields -   Set your shields to a specific value. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 health -    Set your health to a specific value. Max is &#039;&#039;&#039;999.&#039;&#039;&#039;&lt;br /&gt;
 lives -     Set your lives to a specific value. Max is &#039;&#039;&#039;9.&#039;&#039;&#039;&lt;br /&gt;
 battery -   Set your battery to a specific value. This is a percentage between &#039;&#039;&#039;0&#039;&#039;&#039; and &#039;&#039;&#039;100&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
===== Custom Numerical Overrides =====&lt;br /&gt;
 defaultWeapon     - Set your starting equipped weapon. &#039;&#039;&#039;1&#039;&#039;&#039; is fists, &#039;&#039;&#039;2&#039;&#039;&#039; is Bryar ... &#039;&#039;&#039;0&#039;&#039;&#039; is the DT Cannon. Values between &#039;&#039;&#039;0&#039;&#039;&#039; and &#039;&#039;&#039;9&#039;&#039;&#039;. &lt;br /&gt;
 fogLevel          - Set the fog attenuation (Gromas Mines defaults to 30). Values between 0 and 100.&lt;br /&gt;
 floorDamageLow    - Set the low floor damage amount (player hitpoints per second, normal is 5)&lt;br /&gt;
 floorDamageHigh   - Set the high floor damage amount (player hitpoints per second, normal is 10)&lt;br /&gt;
 gasDamage         - Set the gas damage amount (player hitpoints per second, normal is 5)&lt;br /&gt;
 wallDamage        - Set the wall damage amount (player hitpoints per second, normal is 20)&lt;br /&gt;
 gravity           - Set the level&#039;s gravity for player and enemies (normal is 150)&lt;br /&gt;
 projectileGravity - Set the level&#039;s gravity for projectiles (normal is 120)&lt;br /&gt;
&lt;br /&gt;
===== Custom Overrides =====&lt;br /&gt;
We have some custom overrides for your mod.   &lt;br /&gt;
 enableMask -        Start the mission with your Gas Mask on &lt;br /&gt;
 enableCleats -      Start the mission with your Ice Cleats on.&lt;br /&gt;
 enableNightVision - Start the mission with your Night Vision enabled.&lt;br /&gt;
 enableHeadlamp -    Start the mission with your Head Lamp on. &lt;br /&gt;
 bryarOnly -         Start your mission with no inventory except a Bryar pistol and 100 ammo just like the first misison.&lt;br /&gt;
&lt;br /&gt;
=== Dark Forces Remaster HD Overrides ===&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; This is strictly optional and really should only be used to fix incorrect textures shown in the remaster!&lt;br /&gt;
&lt;br /&gt;
There is another optional type of override that can be added to MOD_CONF.txt file. These overrides change the quality of assets that are loaded into the game. The game will either load the High Definition (HD) or original low quality assets. This is required because, by default, the assets in the Dark Forces Remaster skip texture paletting and only show the HD version of the texture even if it doesn&#039;t fit the modded level. Most of the time you will never have to deal with this but some custom maps that use the GROMAS, JABSHIP, SEWERS or TALAY palettes will look strange in the remaster. &lt;br /&gt;
&lt;br /&gt;
[[File:MOD CONF HD.png|center|thumb]]&lt;br /&gt;
For now, lets go over the structure of the HD overrides. Just like before, you add the JSON overrides to MOD_CONF.txt like before. The idea is that you can specify whether to show HD or non HD versions of the PDA menu and the Mission Briefings. Additionally, you can specify per level, which textures you can override to show the non-HD versions instead of the HD versions. The asset types you can override are &#039;&#039;&#039;BMs&#039;&#039;&#039; (Textures), &#039;&#039;&#039;FMEs&#039;&#039;&#039; (Frames - Ex: Ammo Pick up) , WAX (Sprites like enemy stormtroopers) . &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For each asset type you would list the asset that should show the &#039;&#039;&#039;original&#039;&#039;&#039; version instead of the HD version. So if you want to show the original low-quality version of &#039;&#039;&#039;GPDIRTRD.BM&#039;&#039;&#039; you would add it to the list of BMs. &lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;HD_PDA&amp;quot;: false,&lt;br /&gt;
     &amp;quot;HD_BRIEF&amp;quot;: false,&lt;br /&gt;
     &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is the low quality version of the &#039;&#039;&#039;GPDIRTRD.BM&#039;&#039;&#039;. If this override is added to MOD_CONF.txt then Dark Forces Remaster and TFE will show the original low quality version.&lt;br /&gt;
[[File:GPDIRTD LOW.png|center|thumb]]&lt;br /&gt;
If you remove the texture from the list it will show the default high-res version like the one below. &lt;br /&gt;
[[File:GPDIRTRD HIGH RES.png|center|thumb]]&lt;br /&gt;
The same concept works for FME and WAX assets. Just add them to the list of assets. &lt;br /&gt;
&lt;br /&gt;
==== HD override details ====&lt;br /&gt;
Here are the &#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039; overrides for high resolution PDA or briefing. Both the Dark Forces Remaster and TFE will process these settings.&lt;br /&gt;
 HD_PDA -    Display the original or the high resolution version of the PDA. This is useful for custom imperial codes (&#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;)&lt;br /&gt;
 HD_BRIEF -  Display the original or the high resolution version of the Mission Briefing (&#039;&#039;&#039;true&#039;&#039;&#039; or &#039;&#039;&#039;false&#039;&#039;&#039;). &lt;br /&gt;
Then we have a list of levels that should be overrides. Just like before you would write the name of the mission like SECBASE.LEV or TALAY.LEV and then list the types of assets that should show the low quality versions. The asset lists can be BMs FMEs or WAXs and are comma separated surrounded by brackets. &lt;br /&gt;
 &amp;lt;level_name&amp;gt;.LEV - Name of Level to override HD assets. Can be SECBASE.LEV, TALAY.LEV etc...&lt;br /&gt;
 &amp;lt;asset_type&amp;gt; - Must be either BM, WAX or FME. &lt;br /&gt;
An example is below for mission &#039;&#039;&#039;SECBASE.LEV&#039;&#039;&#039;&lt;br /&gt;
  &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you add this override, it will show the low-quality version of textures &#039;&#039;&#039;GPDIRTRD.BM,  SPSEWGE3.BM&#039;&#039;&#039; and &#039;&#039;&#039;GPMINE1X.BM&#039;&#039;&#039; from the BM list&#039;&#039;&#039;.&#039;&#039;&#039; It will also display the low-quality version of &#039;&#039;&#039;GFPIPEIS1.FME&#039;&#039;&#039; frame in the FME list. Finally, the Kell Dragon will be of low quality due to &#039;&#039;&#039;KELL.WAX&#039;&#039;&#039; being added to the WAX list. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Putting it altogether your MOD_CONF may look like this. Don&#039;t forget to ALWAYS check that you do not have any typos and validate with this website --&amp;gt;https://jsonlint.com/&lt;br /&gt;
 {&lt;br /&gt;
     &amp;quot;TFE_VERSION&amp;quot; : 1,&lt;br /&gt;
     &amp;quot;TFE_OVERRIDES&amp;quot;: {&lt;br /&gt;
         &amp;quot;levelOverrides&amp;quot;: {&lt;br /&gt;
             &amp;quot;SECBASE.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;pistol&amp;quot;: false,&lt;br /&gt;
                 &amp;quot;rifle&amp;quot;: true,&lt;br /&gt;
                 &amp;quot;power&amp;quot;: 300,&lt;br /&gt;
                 &amp;quot;detonator&amp;quot;: 5,&lt;br /&gt;
                 &amp;quot;shields&amp;quot;: 150&lt;br /&gt;
             },&lt;br /&gt;
             &amp;quot;TALAY.LEV&amp;quot;: {&lt;br /&gt;
                 &amp;quot;bryarOnly&amp;quot; : true,&lt;br /&gt;
                 &amp;quot;lives&amp;quot;: 1&lt;br /&gt;
             }&lt;br /&gt;
         }&lt;br /&gt;
     },&lt;br /&gt;
     &amp;quot;HD_PDA&amp;quot;: false,&lt;br /&gt;
     &amp;quot;HD_BRIEF&amp;quot;: false,&lt;br /&gt;
     &amp;quot;SECBASE.LEV&amp;quot; : {&lt;br /&gt;
         &amp;quot;BM&amp;quot;: [&lt;br /&gt;
             &amp;quot;GPDIRTRD.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;SPSEWGE3.BM&amp;quot;,&lt;br /&gt;
             &amp;quot;GPMINE1X.BM&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;FME&amp;quot;: [&lt;br /&gt;
             &amp;quot;GFPIPES1.FME&amp;quot;&lt;br /&gt;
         ],&lt;br /&gt;
         &amp;quot;WAX&amp;quot;: [&lt;br /&gt;
             &amp;quot;KELL.WAX&amp;quot;&lt;br /&gt;
         ]&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
Remember, if you are stuck or confused somewhere ask in the DF-21 [https://discord.gg/6T9NvMh2MC Discord]  .&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=1526</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=1526"/>
		<updated>2025-03-23T06:53:25Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* Methods */&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;
== 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;
=== 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Level_Script_API&amp;diff=1525</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=1525"/>
		<updated>2025-03-23T06:38:47Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: &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;
== 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;
* Returns a 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;
=== getElevator(int) ===&lt;br /&gt;
* Returns an 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;/div&gt;</summary>
		<author><name>Jerethk</name></author>
	</entry>
	<entry>
		<id>https://df-21.net/wiki/index.php?title=Dark_Forces_Wiki&amp;diff=1524</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=1524"/>
		<updated>2025-03-23T06:24:33Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* TFE Scripting */&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;
&lt;br /&gt;
* [[Teleporter Basic]]&lt;br /&gt;
* [[VUE Camera transforms]]&lt;br /&gt;
&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;
&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=Level_Script_API&amp;diff=1523</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=1523"/>
		<updated>2025-03-23T06:23:55Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: Created page with &amp;quot;== Properties == === minLayer === * Get only * Gets the minimum map layer (signed integer) * Usage example: &amp;lt;code&amp;gt;int i = level.minLayer;&amp;lt;/code&amp;gt;  === maxLayer === * Get only * Gets the maximum map layer (signed integer) * Usage example: &amp;lt;code&amp;gt;int i = level.maxLayer;&amp;lt;/code&amp;gt;  === sectorCount === * Get only * Gets the total count of sectors (signed integer) * Usage example: &amp;lt;code&amp;gt;int i = level.sectorCount&amp;lt;/code&amp;gt;  === secretCount === * Get only * Gets the total count of secr...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&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;
=== texturetCount ===&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;
&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
=== getSector ===&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=1522</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=1522"/>
		<updated>2025-03-23T06:13:37Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* TFE Scripting */&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;
&lt;br /&gt;
* [[Teleporter Basic]]&lt;br /&gt;
* [[VUE Camera transforms]]&lt;br /&gt;
&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;
&lt;br /&gt;
==== TFE Scripting ====&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
* [[Math 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=Dark_Forces_Wiki&amp;diff=1521</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=1521"/>
		<updated>2025-03-23T06:11:32Z</updated>

		<summary type="html">&lt;p&gt;Jerethk: /* The Force Engine Reference */  Add links to scripting articles. Most are still redlinks&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;
&lt;br /&gt;
* [[Teleporter Basic]]&lt;br /&gt;
* [[VUE Camera transforms]]&lt;br /&gt;
&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;
&lt;br /&gt;
==== TFE Scripting ====&lt;br /&gt;
* [[TFE Level Script]]&lt;br /&gt;
* [[Math 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>
</feed>