DSB/Archetypes

From DmWiki
Revision as of 00:45, 5 January 2013 by WikiSysop (talk | contribs) (styling css sample)
Jump to navigationJump to search

Overview

An Archetype is a general category of item, such as "Axe", "Iron Keyhole", "Screamer" or "Wooden Door".

Here's a very basic example of a simple archetype, an apple, as defined in DSBs base code:

obj.apple = {
	name="APPLE",
	type="THING",
	shortdesc="CONSUMABLE",
	class="FOOD",
	mass=4,
	icon=gfx.icons[168],
	dungeon=gfx.apple,
	foodval=500,
	fit_pouch = true,		
	on_consume=eatdrink
}

The base code defines hundreds of different archetypes that fall into broad categories. Every archetype has a number of properties that define its type, graphics, sounds and behaviour.

Properties

All archetypes share a few basic properties such as Type and Class, but there are a lot of properties only used by certain types of Archetype.

Customisations can be made to any existing dungeon object by altering or adding to the properties of its archetype. Completely new archetypes can also be created, either from scratch or by cloning an existing archetype and modifying or adding to its properties. Existing properties can be changed during gameplay and even new properties added.

Link: Full list of properties

Types

An archetype's TYPE defines its core behaviour. For example, type "DOOR" automatically sets the item to behave as a door, while type "THING" is anything that can be picked up by the party.

Here's the full list of types, and a brief explanation of how they are used. Each of these types [will] also links to an example that shows all the properties you can use with that type.

UNDEFINED
Special types used by core engine system functions
FLOORFLAT
A dungeon object that sits on a tile, such as a drain, pit, trigger, movable wall, etc. Floorflats include decorative items as well as dungeon mechanics. By default, foorflats occupy an entire tile and are placed in the centre of a tile when using the ESB editor. You can also move floorflats to the corners of a tile, but this may invoke odd behaviour.
FLOORUPRIGHT
Flooruprights are items that sit within the centre of a tile and may block or otherwise affect party progress. The default items of this type are stairs and doorframes, but you can create new types such as tables, pillars and statues.
DOOR
Doors are self-explanatory. These will block party progress when closed. Doors can be opened and closed using dungeon mechanics and can also be destroyed using weapons or magic handled by strong characters.
HAZE
Hazes are full-tile items that show some kind of magical effect, such as the animated teleporter and fluxcage. Hazes are rendered in such a way as to appear to completely fill one tile, even though the bitmaps used may simply be a very small pattern.
CLOUD
A cloud is normally created when a magic spell explodes on a tile, or a creature is killed. Some clouds expire very quickly (fireball) while others expire after a duration, getting smaller as they dissipate.
WALLITEM
Wallitems are used to decorate the walls of the dungeon and can be used simply as static eye-candy, or as triggers. Every wallitem can be made into a trigger using the editor. Typical triggers are keyholes and levers, but you can make anything respond to player input if you choose. Some wallitems already have default behaviours. For example, fountains will allow a champion to fill a flask or waterskin.
THING
Things are the items in the dungeon that the champions can pick up and manipulate. A key, a torch, a dagger or a pair of boots are classed as Things. Things can be very simple and have no special functions, or more complex such as a torch that affects the light level of the dungeon. Different properties allow Things to be worn, consumed or used as weapons. Flying magic spells are also classed as Things, but these generally can't be influenced by the player once launched.
MONSTER
The Monster archetype is used to define anything that you want to behave as a creature. Monsters have the largest group of properties and can be customised very heavily to change their behaviour.

Classes

Classes are used to arrange archetypes into sensible groups for easy identification in the editor, ESB. Classes do not define any behaviour, graphics or sounds and are simply labels collecting together similar archetypes. For example, the DECO class is used to identify archetypes that are certain style of decorative dungeon object.

Classes can be used to sub-group items based on their type. For example, both the FLOORFLAT type and the WALLITEM type contain a DECO class. This is useful for quickly finding the archetype you need while building your dungeon in the editor.

{{#css:

 pre {
 -moz-box-sizing: border-box;
 border: 1px solid rgb(204, 204, 204);
 border-radius: 5px 5px 5px 5px;
 background: none repeat scroll 0% 0% rgb(245, 245, 245);
 margin: 9px 0px;
 width: 100%;
 padding: 5px 10px;
 overflow: auto;
 white-space:pre;
 font-family: "Bitstream Vera Sans Mono","DejaVu Sans Mono",Monaco,monospace;
 font-size: 12px;
 line-height: 1.4;

} }}