Difference between revisions of "Modding:Missile"

From DoomRL Wiki

Jump to: navigation, search
(moved missile flags)
m (revised with templates)
 
Line 4: Line 4:
 
Missile prototypes are declared using the global Missile function. They are stored in a global table called missiles which can be indexed by string or numeric id. Required properties are underlined.
 
Missile prototypes are declared using the global Missile function. They are stored in a global table called missiles which can be indexed by string or numeric id. Required properties are underlined.
  
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{drltable|Missile Prototype|3|{{Table3Col
! colspan="3" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|(Projectile) Missile Prototype
+
{{Table3Col
+
 
   |es=background: #333;
 
   |es=background: #333;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c3=padding:0px 2px;
 
   |c3=padding:0px 2px;
   |'''string'''|<u>id</u>|This is the missile's string id. By convention, it should be all lowercase and shouldn't have any whitespace. (A numeric id called nid is assigned automatically.) For [[Modding:Item#Ranged Weapon|inline missile definitions]], this field is created automatically.
+
   |{{modarg|string}}|<u>id</u>|This is the missile's string id. By convention, it should be all lowercase and shouldn't have any whitespace. (A numeric id called nid is assigned automatically.) For [[Modding:Item#Ranged Weapon|inline missile definitions]], this field is created automatically.
   |'''string'''|soundID|If the missile doesn't have a sound bindings and this field exists, it will be used to look for sound bindings in a different place. Missiles are responsible for the .explode sound binding. By convention, this is the same as the ID of the weapon that fires the missile (if the weapon has a different id to begin with which isn't the case for inline definitions).
+
   |{{modarg|string}}|soundID|If the missile doesn't have a sound bindings and this field exists, it will be used to look for sound bindings in a different place. Missiles are responsible for the .explode sound binding. By convention, this is the same as the ID of the weapon that fires the missile (if the weapon has a different id to begin with which isn't the case for inline definitions).
   |'''string'''|ascii|This is the single character used to represent the missile animation. "-", the default, is automatically rotated as is commonly seen in DoomRL.
+
   |{{modarg|string}}|ascii|This is the single character used to represent the missile animation. "-", the default, is automatically rotated as is commonly seen in DoomRL.
   |[[Modding:Constants#Colors|Color]]|<u>color</u>|This is the color used to draw the missile animation.
+
   |{{modarg|Color}}|<u>color</u>|This is the color used to draw the missile animation.
   |'''integer'''|<u>delay</u>|This is the number of milliseconds to pause after each stage of the missile animation. Typical values used by DoomRL are in the range of 10 to 50.
+
   |{{modarg|integer}}|<u>delay</u>|This is the number of milliseconds to pause after each stage of the missile animation. Typical values used by DoomRL are in the range of 10 to 50.
   |'''integer'''|<u>miss_base</u>|When this missile is fired at the player, this is the base [[Dodging|dodge chance]].
+
   |{{modarg|integer}}|<u>miss_base</u>|When this missile is fired at the player, this is the base [[Dodging|dodge chance]].
   |'''integer'''|<u>miss_dist</u>|When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance.
+
   |{{modarg|integer}}|<u>miss_dist</u>|When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance.
   |'''string'''|firedesc|If this field is a non-empty string, this message will be used instead of the usual one when an enemy fires this weapon. The @1 escape will be replaced with the enemy's name (with appropriate article and capitalization).   
+
   |{{modarg|string}}|firedesc|If this field is a non-empty string, this message will be used instead of the usual one when an enemy fires this weapon. The @1 escape will be replaced with the enemy's name (with appropriate article and capitalization).   
   |'''string'''|hitdesc|If this field is a non-empty string, this message will be used instead of the usual one when an enemy hits with this weapon.
+
   |{{modarg|string}}|hitdesc|If this field is a non-empty string, this message will be used instead of the usual one when an enemy hits with this weapon.
   |'''integer'''|maxrange|This field is currently unused. The default is 10.
+
   |{{modarg|integer}}|maxrange|This field is currently unused. The default is 10.
   |'''integer'''|range|If this field is non-zero, the player's targeting is restricted by this range when firing a weapon with this missile. Even if this value is large, targeting is still restricted by the player's vision. The default is 0.
+
   |{{modarg|integer}}|range|If this field is non-zero, the player's targeting is restricted by this range when firing a weapon with this missile. Even if this value is large, targeting is still restricted by the player's vision. The default is 0.
   |[[Modding:Constants#Missile Flags|Missile Flag]] '''list'''|flags|This flags in this list are included in the missile's flag set. This is automatically translated into set format in a property called flagSet. The default is the empty list.
+
   |{{modarg|Missile Flag list}}|flags|This flags in this list are included in the missile's flag set. This is automatically translated into set format in a property called flagSet. The default is the empty list.
   |'''integer'''|expl_delay|If this missile causes an explosion (determined by the weapon that fired it), this is the pause in milliseconds after each stage of the explosion animation. The default is 40.
+
   |{{modarg|integer}}|expl_delay|If this missile causes an explosion (determined by the weapon that fired it), this is the pause in milliseconds after each stage of the explosion animation. The default is 40.
   |[[Modding:Constants#Colors|Color]]|expl_color|This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See [[Modding:Level#level_explosion|Level.explosion]] for details. The default is RED.
+
   |{{modarg|Color}}|expl_color|This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See [[Modding:Level#level_explosion|Level.explosion]] for details. The default is RED.
   |[[Modding:Constants#ExplosionFlag|ExplosionFlag]] '''list'''|expl_flags|This is a list of explosion flags that are applied to explosions created by this missile. This is automatically translated into set format in a property called expl_flagSet. The default is the empty list.
+
   |{{modarg|ExplosionFlag list}}|expl_flags|This is a list of explosion flags that are applied to explosions created by this missile. This is automatically translated into set format in a property called expl_flagSet. The default is the empty list.
   |[[Modding:Cell|Cell ID]]|content|If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described [[Explosions|here]]). This is automatically translated into a numeric id.
+
   |{{modarg|Cell ID}}|content|If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described [[Explosions|here]]). This is automatically translated into a numeric id.
 
   |}}
 
   |}}
|}
+
}}
  
 
=== Flags ===
 
=== Flags ===
Line 45: Line 43:
 
Shotgun prototypes are declared using the global Shotgun function. They are stored in a global table called shotguns which can be indexed by string or numeric ID. Required properties are underlined.
 
Shotgun prototypes are declared using the global Shotgun function. They are stored in a global table called shotguns which can be indexed by string or numeric ID. Required properties are underlined.
  
{|class="wikitable" style="border: 2px solid darkred; border-spacing: 0; font-size: 90%; margin: 0.25em 0.5em;"
+
{{drltable|(Missile) Prototype|3|{{Table3Col
! colspan="3" style="background: darkred; color: yellow; font-size: 120%; text-align: center"|Shotgun (Missile) Prototype
+
{{Table3Col
+
 
   |es=background: #333;
 
   |es=background: #333;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c1=font-weight:bold; text-align:right; vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c2=vertical-align:top; padding:0px 2px;
 
   |c3=padding:0px 2px;
 
   |c3=padding:0px 2px;
   |'''string'''|<u>id</u>|This is the shotgun's string id. By convention, it should be all lowercase with no spaces. (A numeric id called nid is automatically created.)
+
   |{{modarg|integer}}|<u>id</u>|This is the shotgun's string id. By convention, it should be all lowercase with no spaces. (A numeric id called nid is automatically created.)
   |'''integer'''|<u>range</u>|This is the shotgun's [[Shotguns|range]].
+
   |{{modarg|integer}}|<u>range</u>|This is the shotgun's [[Shotguns|range]].
   |'''integer'''|<u>spread</u>|This is the shotgun's [[Shotguns|spread]].
+
   |{{modarg|integer}}|<u>spread</u>|This is the shotgun's [[Shotguns|spread]].
   |'''integer'''|<u>reduce</u>|This is the percentage of the shotgun's damage that decays per unit of distance.
+
   |{{modarg|integer}}|<u>reduce</u>|This is the percentage of the shotgun's damage that decays per unit of distance.
 
   |}}
 
   |}}
|}
+
}}

Latest revision as of 17:44, 27 March 2012

Missiles are created whenever a ranged weapon fires a shot. Some of the effects of the missile (like damage) depend on the weapon that fired it. Most of the missile properties are related to animation, although some have a game effect. Some weapons fire shotgun blasts instead of missiles. Shotgun blasts (called shotguns) are separate objects with their own IDs. A weapon will interpret its missile as a shotgun if it has the IF_SHOTGUN flag.

Missile Prototype

Missile prototypes are declared using the global Missile function. They are stored in a global table called missiles which can be indexed by string or numeric id. Required properties are underlined.

Missile Prototype
string id This is the missile's string id. By convention, it should be all lowercase and shouldn't have any whitespace. (A numeric id called nid is assigned automatically.) For inline missile definitions, this field is created automatically.
string soundID If the missile doesn't have a sound bindings and this field exists, it will be used to look for sound bindings in a different place. Missiles are responsible for the .explode sound binding. By convention, this is the same as the ID of the weapon that fires the missile (if the weapon has a different id to begin with which isn't the case for inline definitions).
string ascii This is the single character used to represent the missile animation. "-", the default, is automatically rotated as is commonly seen in DoomRL.
Color color This is the color used to draw the missile animation.
integer delay This is the number of milliseconds to pause after each stage of the missile animation. Typical values used by DoomRL are in the range of 10 to 50.
integer miss_base When this missile is fired at the player, this is the base dodge chance.
integer miss_dist When this missile is fired at the player, this is the amount that the dodge chance increases per unit of distance.
string firedesc If this field is a non-empty string, this message will be used instead of the usual one when an enemy fires this weapon. The @1 escape will be replaced with the enemy's name (with appropriate article and capitalization).
string hitdesc If this field is a non-empty string, this message will be used instead of the usual one when an enemy hits with this weapon.
integer maxrange This field is currently unused. The default is 10.
integer range If this field is non-zero, the player's targeting is restricted by this range when firing a weapon with this missile. Even if this value is large, targeting is still restricted by the player's vision. The default is 0.
Missile Flag list flags This flags in this list are included in the missile's flag set. This is automatically translated into set format in a property called flagSet. The default is the empty list.
integer expl_delay If this missile causes an explosion (determined by the weapon that fired it), this is the pause in milliseconds after each stage of the explosion animation. The default is 40.
Color expl_color This is the color of the explosion animation. Since explosions are mulicolored, not all colors are allowed here. See Level.explosion for details. The default is RED.
ExplosionFlag list expl_flags This is a list of explosion flags that are applied to explosions created by this missile. This is automatically translated into set format in a property called expl_flagSet. The default is the empty list.
Cell ID content If this field is declared, then an explosion will have a chance of transmuting cells into this cell (as described here). This is automatically translated into a numeric id.

Flags

Projectile Missile Flags
MF_RAY This flag changes the missile's animation. The delay is ignored and all cells in the path are drawn with the projectile (as with the Shambler's ranged attack).
MF_HARD This flag causes the missile to continue after hitting a being (as with the Railgun).
MF_EXACT This flag causes the missile to stop at the targeted square (as with the Revenant's Launcher).
MF_IMMIDATE This flag causes the missile to always hit the targetted square (although it may still miss a being standing on that square). The missile does not respect line of fire -- it will go through walls (although AI controlled beings using such a missile will still respect line-of-sight). The animation for the missile will only display over the targeted cell. (Arch-viles' natural weapon uses this flag.)

Shotgun Prototype

Shotgun prototypes are declared using the global Shotgun function. They are stored in a global table called shotguns which can be indexed by string or numeric ID. Required properties are underlined.

(Missile) Prototype
integer id This is the shotgun's string id. By convention, it should be all lowercase with no spaces. (A numeric id called nid is automatically created.)
integer range This is the shotgun's range.
integer spread This is the shotgun's spread.
integer reduce This is the percentage of the shotgun's damage that decays per unit of distance.
Personal tools