DSB/Archetypes

From DmWiki
Revision as of 18:27, 10 December 2012 by Gambit37 (talk | contribs)
Jump to navigationJump to search

Overview

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

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. There are many different properties available, and different types of archetypes will use different properties. Every customisation you make to a dungeon object is made by altering or adding to the properties of its archetype.

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
}

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.

UNDEFINED
Special types used by core engine system functions

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