TFE Custom Logics: Difference between revisions

From DF21 Wiki
(Created page with "=== JSON locations === Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations * DARK\Logics * TheForceEngine\Mods\Logics where DARK is your Dark Forces game directory which TFE is pointing to. In addition, if you are running a Mod from a ZIP, TFE will look for a <code>\Logics</code> subfolder inside the ZIP and load logics from any .JSON files found there. Logics loaded from a Mod will take pre...")
 
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article explains how to use custom (user-defined) AI logics in TFE. (The feature is not yet available but will be coming in a future official release.)
This feature allows modders to create new enemy logics that behave similarly to the "standard" (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids.
To use the feature, check that the '''Enable custom AI logics from JSON files''' setting has been enabled, in Settings → Game Settings → Dark Forces Settings.
=== JSON locations ===
=== JSON locations ===
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations
Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations
Line 4: Line 10:
* DARK\Logics
* DARK\Logics
* TheForceEngine\Mods\Logics
* TheForceEngine\Mods\Logics
* TheForceEngine\Mods\<code>[CURRENTLY LOADED MOD]</code>\Logics


where DARK is your Dark Forces game directory which TFE is pointing to.
where DARK is your Dark Forces game directory which TFE is pointing to.
Line 10: Line 17:


Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.
Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.
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.
'''Note''': 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.
=== Logic JSON structure ===
A logic JSON should consist of a single array called "logics".
Each element of the "logics" array must consist of two items, in this order
* "logicName" - a string which is the name of the logic
* "data" - an object containing properties that are set for the logic
Example:
<pre>
{
  "logics": [
      {
        "logicName": "LogicA",
        "data": {
            "alertSound": "alert1.voc",
            "painSound": "pain1.voc",
            "hitpoints": 25,
            "projectile": "rifle_bolt"
        }
      },
      {
        "logicName": "LogicB",
        "data": {
            "alertSound": "alert2.voc",
            "painSound": "pain2.voc",
            "hitpoints": 39,
            "speed": 20,
            "projectile": "thermal_det",
            "dropItem": "red_key"
        }
      }
  ]
}
</pre>
Logic JSONs are ''not'' 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.
For example, "alertsound", "ALERTSOUND", "AlertSound", "alertSound" will all be accepted.
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.
=== Data properties ===
Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.
You do not need to set every property. Unset properties will default to the values shown.
Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.
{| border=1 cellpadding=6px
|-
! Property !! Type !! Default value !! Description
|-
| hasGravity || boolean || <code>true</code> || If true, will be affected by gravity
|-
| isFlying || boolean || <code>false</code> || If true, will be a flying enemy (like probe droid)
|-
| 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.
|-
| 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.)
|-
| alertSound || string || ''no sound'' || VOC file to play when enemy is alerted
|-
| painSound || string || ''no sound'' || VOC file to play when enemy takes pain
|-
| dieSound || string || ''no sound'' || VOC file to play when enemy dies
|-
| attack1Sound || string || ''no sound'' || VOC file to play for primary attack
|-
| attack2Sound || string || ''no sound'' || VOC file to play for secondary attack
|-
| hitPoints || number (integer) || 4 || Hitpoints. The enemy will die when it reaches 0.
|-
| dropItem || string or number || -1 (nothing) || What item is dropped when the enemy dies. See reference table below for options.
|-
| dieEffect || string or number || -1 (nothing) || An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.
|-
| hasMeleeAttack || boolean || <code>false</code> || If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.
|-
| hasRangedAttack || boolean || <code>true</code> || 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.
|-
| litWithMeleeAttack || boolean || <code>false</code> || If true, the sprite will light up when it attacks with melee.
|-
| litWithRangedAttack || boolean || <code>true</code> || If true, the sprite will light up when it does its ranged attack.
|-
| projectile || string or number || <code>"rifle_bolt"</code> || What projectile the enemy will fire for its ranged attack. See reference table below for options.
|-
| wanderTime || number (integer) || 300 || How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or "asleep" state. This time is reset when the enemy is re-alerted by the player.
|-
| rangedAttackDelay || number (decimal) || 2 || Time delay in seconds between range attacks (the game engine adds some variability to this)
|-
| meleeAttackDelay || number (decimal) || 0 || Time delay in seconds between melee attacks
|-
| meleeRange || number (integer) || 0 || Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.
|-
| meleeDamage || number (integer) || 0 || Damage that each melee attack will inflict.
|-
| minAttackDist || number (integer) || 0 || Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.
|-
| maxAttackDist || number (integer) || 160 || Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.
|-
| fireSpread || number (integer) || 30 || Accuracy of fire. Lower numbers are more accurate.
|-
| speed || number (integer) || 4 || Speed of enemy's movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.
|-
| verticalSpeed || number (integer) || 10 || For flying enemies only, this is their vertical speed.
|-
| rotationSpeed || number (integer) || 720 || Speed at which the enemy can rotate. Degrees per second.
|}
=== Using custom logics ===
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
<pre>
      "logicName": "Rodian",
      "data": {
        "alertSound": "rodian1.voc",
        ....
      }
</pre>
Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.
<pre>
SEQ
  LOGIC: Rodian
SEQEND
</pre>
You can also use JSON-defined logics with generators, for example
<pre>
SEQ
  LOGIC:        GENERATOR Rodian
  DELAY:        10
  INTERVAL:      5
  NUM_TERMINATE: 6
  MAX_ALIVE:    1
  MAX_DIST:      800
  MIN_DIST:      50
SEQEND
</pre>
'''Important''': If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be "lifeless". However, if the level has generators with a custom logic, this causes the original game to crash.
=== Overriding hardcoded logics ===
You ''can'' override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, <code>storm1</code> and <code>commando</code>.
If you override a boss logic, like <code>kell</code> 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.
=== Custom logics and WAX files ===
A custom logic's behaviours/actions will correspond to WAX animations as follows
{| border=1 cellpadding=6px
|-
| 0 || Walking / moving
|-
| 1 || Primary attack
|-
| 2 || Melee death
|-
| 3 || Shooting / explosion death
|-
| 4 || Dead
|-
| 5 || Idle / stationary
|-
| 6 || Primary attack conclusion (eg. recoil)
|-
| 7 || Secondary attack
|-
| 8 || Secondary attack conclusion
|-
| 9 || ''unused''
|-
| 10 || ''unused''
|-
| 11 || ''unused''
|-
| 12 || Pain
|}
This follows the same pattern as all the standard Dark Forces enemies.
Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has ''only'' 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).
=== Reference ===
==== Projectile list ====
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).
{| border=1 cellpadding=6px
|-
! Number !! String
|-
| -1 || || Enemy will not have a projectile
|-
| 0 || <code>punch</code> || This is a special projectile used for the player's fists, and may not work with logics
|-
| 1 || <code>pistol_bolt</code>
|-
| 2 || <code>rifle_bolt</code>
|-
| 3 || <code>thermal_det</code>
|-
| 4 || <code>repeater</code>
|-
| 5 || <code>plasma</code> || Fusion cutter projectile
|-
| 6 || <code>mortar</code>
|-
| 7 || <code>land_mine</code>
|-
| 8 || <code>land_mine_prox</code> || Proximity land mine
|-
| 9 || <code>land_mine_placed</code>
|-
| 10 || <code>concussion</code>
|-
| 11 || <code>cannon</code>
|-
| 12 || <code>missile</code>
|-
| 13 || <code>turret_bolt</code>
|-
| 14 || <code>remote_bolt</code>
|-
| 15 || <code>exp_barrel</code> || An invisible projectile that is normally spawned when a barrel explodes
|-
| 16 || <code>homing_missile</code> || Mohc's homing missiles
|-
| 17 || <code>probe_proj</code> || Green interrogator droid projectile
|-
| 18 || <code>bobafett_ball</code> || Boba Fett's missiles
|}
==== Drop item list ====
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).
{| border=1 cellpadding=6px
|-
! Number !! String
|-
| -1 || || Enemy will not drop anything when they die
|-
| 0 || <code>PLANS</code> || Death Star plans
|-
| 1 || <code>PHRIK</code>
|-
| 2 || <code>NAVA</code>
|-
| 3 || <code>DT_WEAPON</code>
|-
| 4 || <code>DATATAPE</code>
|-
| 5 || <code>RIFLE</code>
|-
| 6 || <code>AUTOGUN</code>
|-
| 7 || <code>MORTAR</code>
|-
| 8 || <code>FUSION</code>
|-
| 9 || <code>CONCUSSION</code>
|-
| 10 || <code>CANNON</code>
|-
| 11 || <code>ENERGY</code>
|-
| 12 || <code>POWER</code>
|-
| 13 || <code>PLASMA</code>
|-
| 14 || <code>DETONATOR</code>
|-
| 15 || <code>DETONATORS</code>
|-
| 16 || <code>SHELL</code> || Mortar shell
|-
| 17 || <code>SHELLS</code>
|-
| 18 || <code>MINE</code>
|-
| 19 || <code>MINES</code>
|-
| 20 || <code>MISSILE</code>
|-
| 21 || <code>MISSILES</code>
|-
| 22 || <code>SHIELD</code>
|-
| 23 || <code>RED_KEY</code>
|-
| 24 || <code>YELLOW_KEY</code>
|-
| 25 || <code>BLUE_KEY</code>
|-
| 26 || <code>GOGGLES</code>
|-
| 27 || <code>CLEATS</code>
|-
| 28 || <code>MASK</code> || Gas mask
|-
| 29 || <code>BATTERY</code>
|-
| 30 || <code>CODE1</code>
|-
| 31 || <code>CODE2</code>
|-
| 32 || <code>CODE3</code>
|-
| 33 || <code>CODE4</code>
|-
| 34 || <code>CODE5</code>
|-
| 35 || <code>CODE6</code>
|-
| 36 || <code>CODE7</code>
|-
| 37 || <code>CODE8</code>
|-
| 38 || <code>CODE9</code>
|-
| 39 || <code>INVINCIBLE</code> || Shield supercharge
|-
| 40 || <code>SUPERCHARGE</code> || Weapon supercharge
|-
| 41 || <code>REVIVE</code>
|-
| 42 || <code>LIFE</code>
|-
| 43 || <code>MEDKIT</code>
|-
| 44 || <code>PILE</code> || Kyle's pile of weapons
|}
==== Death effect list ====
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).
Note that some effects inflict damage.
{| border=1 cellpadding=6px
|-
! Number !! String
|-
| -1 || || Enemy will not have a death effect
|-
| 0 || <code>SMALL_EXP</code> || small "puff" - blaster weapons
|-
| 1 || <code>THERMDET_EXP</code> || thermal detonator explosion
|-
| 2 || <code>PLASMA_EXP</code> || Green plasma "puff"
|-
| 3 || <code>MORTAR_EXP</code> || mortar explosion
|-
| 4 || <code>CONCUSSION</code> || concussion - first stage
|-
| 5 || <code>CONCUSSION2</code> || concussion - second stage
|-
| 6 || <code>MISSILE_EXP</code> || missile explosion
|-
| 7 || <code>MISSILE_WEAK</code> || weaker version of the missle explosion
|-
| 8 || <code>PUNCH</code> || punch
|-
| 9 || <code>CANNON_EXP</code> || Blue cannon "puff"
|-
| 10 || <code>REPEATER_EXP</code> || repeater "puff"
|-
| 11 || <code>LARGE_EXP</code> || Land mine explosion
|-
| 12 || <code>EXP_BARREL</code> || exploding barrel
|-
| 13 || <code>EXP_INVIS</code> || an explosion that makes no sound and has no visual effect
|-
| 14 || <code>SPLASH</code> || water splash
|-
| 15 || <code>EXP_35</code> || medium explosion, 35 damage (used for probe droid death)
|-
| 16 || <code>EXP_NO_DMG</code> || medium explosion, no damage (used for turret and welder deaths)
|-
| 17 || <code>EXP_25</code> || medium explosion, 25 damage (used for Boba Fett missile explosions)
|}

Latest revision as of 20:56, 29 October 2024

This article explains how to use custom (user-defined) AI logics in TFE. (The feature is not yet available but will be coming in a future official release.)

This feature allows modders to create new enemy logics that behave similarly to the "standard" (non-boss) enemies in Dark Forces, for example Officers, Stormtroopers, Bossk, Probe Droids.

To use the feature, check that the Enable custom AI logics from JSON files setting has been enabled, in Settings → Game Settings → Dark Forces Settings.

JSON locations

Custom logics are defined in JSON files. TFE will search for and load logics from all logic .JSON files found in these locations

  • DARK\Logics
  • TheForceEngine\Mods\Logics
  • TheForceEngine\Mods\[CURRENTLY LOADED MOD]\Logics

where DARK is your Dark Forces game directory which TFE is pointing to.

In addition, if you are running a Mod from a ZIP, TFE will look for a \Logics subfolder inside the ZIP and load logics from any .JSON files found there.

Logics loaded from a Mod will take preference over any logics found in other locations that have the same name.

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.

Note: 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.

Logic JSON structure

A logic JSON should consist of a single array called "logics".

Each element of the "logics" array must consist of two items, in this order

  • "logicName" - a string which is the name of the logic
  • "data" - an object containing properties that are set for the logic

Example:

{
   "logics": [
      {
         "logicName": "LogicA",
         "data": {
            "alertSound": "alert1.voc",
            "painSound": "pain1.voc",
            "hitpoints": 25,
            "projectile": "rifle_bolt"
         }
      },
      {
         "logicName": "LogicB",
         "data": {
            "alertSound": "alert2.voc",
            "painSound": "pain2.voc",
            "hitpoints": 39,
            "speed": 20,
            "projectile": "thermal_det",
            "dropItem": "red_key"
         }
      }
   ]
}

Logic JSONs are not 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.

For example, "alertsound", "ALERTSOUND", "AlertSound", "alertSound" will all be accepted.

Further tips about getting the JSON format right can be found on the TFE MOD Overrides article.


Data properties

Here is a list of the properties that you can set for each logic. They are all standard JSON key-value pairs.

You do not need to set every property. Unset properties will default to the values shown.

Properties can be listed in any order. Property names are not case sensitive, but need to be spelled correctly.

Property Type Default value Description
hasGravity boolean true If true, will be affected by gravity
isFlying boolean false If true, will be a flying enemy (like probe droid)
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.
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.)
alertSound string no sound VOC file to play when enemy is alerted
painSound string no sound VOC file to play when enemy takes pain
dieSound string no sound VOC file to play when enemy dies
attack1Sound string no sound VOC file to play for primary attack
attack2Sound string no sound VOC file to play for secondary attack
hitPoints number (integer) 4 Hitpoints. The enemy will die when it reaches 0.
dropItem string or number -1 (nothing) What item is dropped when the enemy dies. See reference table below for options.
dieEffect string or number -1 (nothing) An effect (eg. explosion) that will play when the enemy dies. See reference table below for options.
hasMeleeAttack boolean false If true, the enemy will have a melee attack. If the enemy has a melee attack, it will always be the primary attack.
hasRangedAttack boolean true 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.
litWithMeleeAttack boolean false If true, the sprite will light up when it attacks with melee.
litWithRangedAttack boolean true If true, the sprite will light up when it does its ranged attack.
projectile string or number "rifle_bolt" What projectile the enemy will fire for its ranged attack. See reference table below for options.
wanderTime number (integer) 300 How long (in seconds) the enemy will keep looking for the player, before it returns to its idle or "asleep" state. This time is reset when the enemy is re-alerted by the player.
rangedAttackDelay number (decimal) 2 Time delay in seconds between range attacks (the game engine adds some variability to this)
meleeAttackDelay number (decimal) 0 Time delay in seconds between melee attacks
meleeRange number (integer) 0 Range (in DFU) of melee attack - how far the player can be from the enemy to be hit by it.
meleeDamage number (integer) 0 Damage that each melee attack will inflict.
minAttackDist number (integer) 0 Minimum distance from the player (DFU) where the enemy will attack with its ranged weapon.
maxAttackDist number (integer) 160 Maximum distance from the player (DFU) where the enemy will attack with its ranged weapon.
fireSpread number (integer) 30 Accuracy of fire. Lower numbers are more accurate.
speed number (integer) 4 Speed of enemy's movement, appears to be in DFU per second. For flying enemies, this is their horizontal speed.
verticalSpeed number (integer) 10 For flying enemies only, this is their vertical speed.
rotationSpeed number (integer) 720 Speed at which the enemy can rotate. Degrees per second.

Using custom logics

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

      "logicName": "Rodian",
      "data": {
         "alertSound": "rodian1.voc",
         ....
      }

Apply it to a sprite (WAX) like this, and then the sprite should behave with the custom logic.

SEQ
   LOGIC: Rodian
SEQEND

You can also use JSON-defined logics with generators, for example

SEQ
   LOGIC:         GENERATOR Rodian
   DELAY:         10
   INTERVAL:      5
   NUM_TERMINATE: 6
   MAX_ALIVE:     1
   MAX_DIST:      800
   MIN_DIST:      50
SEQEND

Important: If a level with a custom logic is run with vanilla Dark Forces or the Dark Forces Remaster, the sprites will be "lifeless". However, if the level has generators with a custom logic, this causes the original game to crash.

Overriding hardcoded logics

You can override hardcoded logics by creating a JSON logic with the same name as one of the hardcoded logics. For example, storm1 and commando.

If you override a boss logic, like kell 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.

Custom logics and WAX files

A custom logic's behaviours/actions will correspond to WAX animations as follows

0 Walking / moving
1 Primary attack
2 Melee death
3 Shooting / explosion death
4 Dead
5 Idle / stationary
6 Primary attack conclusion (eg. recoil)
7 Secondary attack
8 Secondary attack conclusion
9 unused
10 unused
11 unused
12 Pain

This follows the same pattern as all the standard Dark Forces enemies.

Note that if a logic has a melee attack, this will always be the primary attack (animations 1 and 6). If a logic has only 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).

Reference

Projectile list

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).

Number String
-1 Enemy will not have a projectile
0 punch This is a special projectile used for the player's fists, and may not work with logics
1 pistol_bolt
2 rifle_bolt
3 thermal_det
4 repeater
5 plasma Fusion cutter projectile
6 mortar
7 land_mine
8 land_mine_prox Proximity land mine
9 land_mine_placed
10 concussion
11 cannon
12 missile
13 turret_bolt
14 remote_bolt
15 exp_barrel An invisible projectile that is normally spawned when a barrel explodes
16 homing_missile Mohc's homing missiles
17 probe_proj Green interrogator droid projectile
18 bobafett_ball Boba Fett's missiles

Drop item list

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).

Number String
-1 Enemy will not drop anything when they die
0 PLANS Death Star plans
1 PHRIK
2 NAVA
3 DT_WEAPON
4 DATATAPE
5 RIFLE
6 AUTOGUN
7 MORTAR
8 FUSION
9 CONCUSSION
10 CANNON
11 ENERGY
12 POWER
13 PLASMA
14 DETONATOR
15 DETONATORS
16 SHELL Mortar shell
17 SHELLS
18 MINE
19 MINES
20 MISSILE
21 MISSILES
22 SHIELD
23 RED_KEY
24 YELLOW_KEY
25 BLUE_KEY
26 GOGGLES
27 CLEATS
28 MASK Gas mask
29 BATTERY
30 CODE1
31 CODE2
32 CODE3
33 CODE4
34 CODE5
35 CODE6
36 CODE7
37 CODE8
38 CODE9
39 INVINCIBLE Shield supercharge
40 SUPERCHARGE Weapon supercharge
41 REVIVE
42 LIFE
43 MEDKIT
44 PILE Kyle's pile of weapons

Death effect list

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).

Note that some effects inflict damage.

Number String
-1 Enemy will not have a death effect
0 SMALL_EXP small "puff" - blaster weapons
1 THERMDET_EXP thermal detonator explosion
2 PLASMA_EXP Green plasma "puff"
3 MORTAR_EXP mortar explosion
4 CONCUSSION concussion - first stage
5 CONCUSSION2 concussion - second stage
6 MISSILE_EXP missile explosion
7 MISSILE_WEAK weaker version of the missle explosion
8 PUNCH punch
9 CANNON_EXP Blue cannon "puff"
10 REPEATER_EXP repeater "puff"
11 LARGE_EXP Land mine explosion
12 EXP_BARREL exploding barrel
13 EXP_INVIS an explosion that makes no sound and has no visual effect
14 SPLASH water splash
15 EXP_35 medium explosion, 35 damage (used for probe droid death)
16 EXP_NO_DMG medium explosion, no damage (used for turret and welder deaths)
17 EXP_25 medium explosion, 25 damage (used for Boba Fett missile explosions)