Difference between revisions of "Modding:being blueprint (0.9.9.7)"
From DoomRL Wiki
Yaflhdztioxo (Talk | contribs) (Created page with "WIP from old pages, must refine and re-investigate ------ If it bleeds, it leads. Beings inherit from the Thing base class which handles some basic pro...") |
Yaflhdztioxo (Talk | contribs) (→Being Flags) |
||
Line 61: | Line 61: | ||
|} | |} | ||
=== Flags === | === Flags === | ||
− | + | {{Template:Being_Flags}} | |
− | {{ | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
== Engine Hooks == | == Engine Hooks == | ||
Specifying one or more of these hooks in the prototype will allow for greater customization. | Specifying one or more of these hooks in the prototype will allow for greater customization. |
Revision as of 18:54, 21 April 2013
WIP from old pages, must refine and re-investigate
If it bleeds, it leads. Beings inherit from the Thing base class which handles some basic properties in common with items. In addition the Player inherits this class, so anything you can do to creatures can be done to the player as well.
Prototype
New beings are created from being prototypes. Think of a being prototype as a recipe for creating new beings. There can be multiple former humans, but they all came from the same prototype. Prototypes are declared by passing a table with the desired properties to the Beings function. Engine hooks may also be included in the prototype. Mostly, the prototype's properties just describe beings' initial properties (occasionally with different names). Beings' properties can also mostly be changed after they are instantiated. Required fields are underlined. Sometimes required fields can safely be omitted, but this will generate a message in the log file. All being prototypes are stored in a global table called beings. This table can be indexed by id or nid.
Being Prototype | ||
---|---|---|
string | name | This is the being's name. |
string | name_plural | This is the being's name_plural. By default, this is the name with an "s" appended. |
string | ascii | This is the being's picture. It should be a single character string. |
string | id | This is the being's sid. It must be distinct from other string ids. (The numeric id is automatically assigned to a field called nid.) Only the first 20 characters will be used. The default is the first word of the name in all lowercase. |
integer list | overlay | This field is only used in the graphical version. It describes a color transformation to be applied to the being's sprite. This will create overlay_red, overlay_green, overlay_blue, and overlay_alpha fields in the being prototype. |
integer | XP | This is the being's expvalue. By default, it is 3xD2+20, where D is the being's danger (see below). |
Cell ID | corpse | The determines the corpse left by the being. If the value is true, a new corpse cell will automatically be created. Otherwise this field is interpretted as a cell id. After a being is declared, this field will have been translated to a number. The default is true. |
Item Prototype | weapon | If this field is included, a new item will be declared and automatically equipped for beings generated from this prototype. The item prototype will automatically be a natural ranged weapon, have an id assigned, have zero weight, have no sprite, and have the IF_NODROP and IF_NOAMMO flags. |
integer | sprite | This is the being's sprite. (Use 0 for no sprite.) |
Color | color | This is the being's color. |
integer | toDam | This is the being's toDam. (This bonus only applies to melee attacks.) The default is 0. |
integer | toHit | This is the being's toHit. The default is 0. |
integer | speed | This is the being's speed. (Remember, the maximum allowed speed is 255.) The default is 100. |
integer | armor | This is the being's armor. The default is 0. |
integer | danger | This is a monster generation parameter. |
integer | weight | This is a monster generation parameter. |
integer | minLev | This is a monster generation parameter. |
integer | maxLev | This is a monster generation parameter. The default is 200. |
integer | HP | This is the being's hpmax and starting hp. The default is 10. |
integer | bulk | This parameter is unused. The default is 100. |
integer | group | Monsters from different groups will fight each other if they use the default AI. Oddly, the default is "weapon-other" which, as a string, translates to 0. The player is in group 1. |
integer | attackchance | This is the being's attackchance The default is 75. |
integer | toHitMelee | This is the being's toHitMelee. The default is 0. |
Being Flag list | flags | The flags in this list will be included in the being's flag set. Upon instantiation, a flagSet property is added to the prototype will include these flags (and possibly some automatic flags) in set format. The default is an empty list. |
string | sound_id | If included and the being doesn't have sound bindings configured, then it will look for sound bindings under its sound_id. |
AI ID | ai_type | This determines the being's AI. By default, the old pascal AI is used. (The pascal AI doesn't have an id.) |
integer | vision | This is the being's vision. The default is 9. (The player also has vision 9 by default.) |
integer | res_bullet | This is the being's res_bullet. The default is 0. |
integer | res_melee | This is the being's res_melee. The default is 0. |
integer | res_shrapnel | This is the being's res_shrapnel. The default is 0. |
integer | res_acid | This is the being's res_acid. The default is 0. |
integer | res_fire | This is the being's res_fire. The default is 0. |
integer | res_plasma | This is the being's res_plasma. The default is 0. |
string | desc | This is the description of the being displayed in the more information view. |
string | kill_desc | If included, this being will have a special kill description in the mortem. |
string | kill_desc_melee | As kill_desc, but for melee kills. |
Flags
Being Flags | |
BF_BOSS | Killing this being will end the game. Other boss-only actions are usually scripted in Lua based on this flag. |
BF_ENVIROSAFE | Hazard tiles should not affect this being. Engine pathfinding algorithms are affected. Protection is not engine based; modders must make custom hazard cells check for this flag to prevent damage. |
BF_CHARGE | Hazard tiles do not concern this being. Engine pathfinding algorithms are affected. |
BF_OPENDOORS | This being can open doors. Engine pathfinding algorithms are affected. |
BF_NODROP | This being will not drop their inventory or equipment when they die. |
BF_NOEXP | This being will not award experience to the player. Often used to prevent exp farming. |
BF_QUICKSWAP | This being has the benefits of the Juggler trait. |
BF_HUNTING | This being always knows where the player is and will hunt them down. This flag is not engine based; modders must make custom AIs respect this flag before it will have any effect. |
BF_BACKPACK | This being has the ammo stacking benefits of the Backpack powerup. |
BF_UNIQUENAME | This being's name is a proper noun and UI messages will treat it as such. |
BF_IMPATIENT | This being will consume packs automatically. This flag is the main component of the Angel of Impatience challenge. |
BF_SHOTTYMAN | This being will reload shotguns on the move as part of the Shottyman trait. A shotgun is defined as any weapon with the IF_SHOTGUN flag. |
BF_ROCKETMAN | This being will reload rocket launchers on the move as part of the Shottyman trait. A rocket launcher is defined as any weapon with the IF_ROCKET flag. |
BF_BERSERKER | This being has the benefits of the Berserker trait. |
BF_DARKNESS | This being does not record exploration. This is one component of the Angel of Darkness challenge. |
BF_DUALGUN | This being has the benefits of the Dualgunner trait. |
BF_POWERSENSE | This being can sense powerups, one of the benefits of the first level Intuition trait. |
BF_BEINGSENSE | This being can sense enemies, one of the benefits of the second level Intuition trait. |
BF_LEVERSENSE1 | This being can sense if a lever is harmful, beneficial, or neutral, one of the benefits of the first level Intuition trait. |
BF_LEVERSENSE2 | This being can sense the exact effect of a lever, one of the benefits of the second level Intuition trait. |
BF_NOMELEE | This being cannot perform a melee attack. This is only seen on the Angel of Pacifism challenge and is probably not safe to use on an enemy. A custom AI can achieve a better effect. |
BF_CLEAVE | This being has the benefits of the Blademaster trait. |
BF_MAXDAMAGE | This being always rolls maximum damage. Every being gets this flag in the Angel of Max Carnage challenge. |
BF_SESSILE | This being cannot move. Only seen with the Gothic Arms set. This flags is not correctly implemented for non-player creatures; if you want an immobile enemy use a custom AI instead. |
BF_VAMPYRE | This being has the benefits of the Vampyre trait. |
BF_REGENERATE | This being regenerates one health per second if they have less than 20 health remaining. This used to be the benefit of a trait called Regenerator but it is no longer used anywhere in DoomRL. |
BF_ARMYDEAD | This being has the benefits of the Army of the Dead trait. |
BF_FIREANGEL | This being has the benefits of the Fireangel trait. |
BF_GUNKATA | This being has the benefits of the Gun Kata trait. |
BF_AMMOCHAIN | This being has the benefits of the Ammochain trait. |
BF_MASTERDODGE | This being has the benefits of the Dodgemaster trait. |
BF_INV | This being will not take any damage. This is the main component of the Invulnerable status effect. Be careful not to directly set an invincible being's HP to zero. |
BF_BERSERK | This being has the face pounding benefits of the Berserk status effect. The speed and resistance bonuses are not included. |
BF_NORUNPENALTY | This being has the benefits of the Running Man trait. |
BF_PISTOLMAX | This being has the benefits of the Sharpshooter trait. |
BF_MEDPLUS | This being can heal beyond 100% with med-packs alone as part of the Survivalist trait. This flag is not engine based; modders must make custom sources of healing respect this flag. |
BF_HARDY | This being can reduce damage all the way down to zero as part of the Survivalist trait. Normally all attacks do a minimum of one damage regardless of how much armor you have. |
BF_SCAVENGER | This being has the benefits of the Scavenger trait. |
BF_INSTAUSE | This being uses consumable items in 0.1s instead of the usual 1.0s. Part of the Technician class bonus. |
BF_STAIRSENSE | This being always knows the location of stair tiles. Part of the Scout class bonus. |
BF_POWERBONUS | Powerup effects last longer for this being. The exact bonus depends on difficulty. Part of the Marine class bonus. |
BF_MAPEXPERT | Computer maps will work like tracking maps for this being. Part of the Technician class bonus. This flag is not engine based obviously. |
BF_DUALBLADE | This being can attack with two melee weapons at once with each weapon attacking in half the time. Part of the Malicious Blades trait. A bladed weapon is defined as any weapon with the IF_BLADE flag. |
BF_BLADEDEFEND | This being gains extra resistances by having a bladed weapon in the prepared. Part of the Malicious Blades trait. A bladed weapon is defined as any weapon with the IF_BLADE flag. |
BF_BULLETDANCE | This being has the benefits of the Bullet Dance trait. |
BF_SHOTTYHEAD | This being has the benefits of the Shottyhead trait. |
BF_ENTRENCHMENT | This being has the benefits of the Entrenchment trait. |
BF_MODEXPERT | This being can mod unique items. Part of the Technician class bonus. |
BF_SELFIMMUNE | This being cannot be hurt by its own attack. Arch-Viles and Cyberdemons are two such beings. |
BF_KNOCKIMMUNE | This being is immune to knockback. Largely a characteristic of boss level enemies. |
BF_NOHEAL | This being cannot be healed. This is only seen on the Angel of Masochism challenge. This flag is not engine based; modders must make custom sources of healing respect this flag. |
BF_GUNRUNNER | This being has the benefits of the Gunrunner trait. |
Engine Hooks
Specifying one or more of these hooks in the prototype will allow for greater customization.
Being Hooks | |
---|---|
void | OnCreate(Being self) |
void | OnAction(Being self) |
void | OnDie(Being self, boolean overkill) |
- OnCreate(Being self)
- This is called when the being is created.
- OnAction(Being self)
- This is called at the beginning of each of the being's turns. (Note that turns are only differentiated if time elapses in between.)
- OnDie(Being self, boolean overkill)
- This is called when the being dies. overkill is true if the being was gibbed.