Difference between revisions of "Modding:Missile"
From DoomRL Wiki
(Created page) |
Revision as of 13:25, 16 August 2011
Notice | |
This article discusses modding for DoomRL version 0.9.9.4. This version is unreleased, so details are subject to change. For information about 0.9.9.3 modding, try looking here |
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.
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. |
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.
Shotgun Prototype | ||
string | 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. |