Overview Screenshots Downloads News Documentation Thanks Simugraph Home Page

H-World - Items and monster configuration

Descriptions are up to date with H-World version 0.0.3. Up to date descriptions can be found in the header of the file [module]/data/beings.sects.

Item and monster configuration

H-World treats items and monsters very similar. Basically monsters are just items that have an AI and can act by themselves.

Items and monsters are configured in the file [module]data/beings.sects. This file is divided into sections, each section describes the properties of one item or monster. If a monster has a body made of limbs, or if an item is made from parts, the limbs and parts are described in [module]data/limbs.sects. The syntax of the beings.sects and limbs.sects files is identical.

Item example:

begin section small_bronze_shield
name = Bronze buckler
ident = bronze buckler
type = shield
image = 130
image.inventory = 122
width = 4
height = 4
block = 20
end section
    

A section is opened with begin section <identifier> and closed with end section. Between them, there are definition for the items properties. The definitions have the form property = value. The semantics of all properties will be described below.

Monsters are configured just like items, but can have different properties.

Monster example:

begin section tiger_bug
name = Tiger bug
ident = tiger bug
image = 65
width = 4
height = 4
image.inventory = -1
love = 0
hate = 16
fear = 8
type = body
vital = true
CPmax = 15
CPcurr = 15
BPmax = 30
BPcurr = 30
cp = 15
bp = 30
direction = 0
attacks = 1
attack[0].name = Pinch
attack[0].verb = pinch
attack[0].damages = 2
attack[0].damage[0].type = scratch
attack[0].damage[0].damage = %1d2
attack[0].damage[1].type = blunt
attack[0].damage[1].damage = %1d1
end section
    

Property types

The properties are typed, and H-World tries to make an educated guess about the type. Strings must start with a character, integer numbers must start with a digit. Dice sets start with %.

The property descriptions mark String properties with (string), integer number properties with (int) and dice set properties with (dice).

Basic properties

Required properties are marked with (*). All other properties are optional.

Property Description
name (string) name of the thing (*)
ident (string) name of the 'whole', required for root things

H-World can work with plain items and monsters and items and monsters that are assembled from parts. In case of plain items and monsters ident and name are required. Usually ident is name in lower case. For items and monsters made from parts, ident is the name for the complete thing, and name is the name of the part that is described in the config section.

AI control properties

Property Description
love (int) This value determines how much the monster feels attracted by monsters of the same type. Being in a group also reduces fear, thus monsters with high fear and love, try to find companions first, and then attack as a group.
hate (int) This value determines how much the monster hates the player. 0 results in neutral monsters. Hate is affected by fear - depending if the monster has more fear or more hate it will attack or flee. Hate is not influenced by the love setting.
fear (int) This value determines how much the monster fears the player. Values higher than 0 lead to monsters that can flee. Hate and and being in a group (as result of love > 0) both reduce fear.

I.e. love = 2, hate = 2 and fear = 3 results in grouping, and attacking only if 3 or more in group.

I.e. love = 0, hate = 16 and fear = 8 results in non-grouping, fearless attacking monsters.

Item part/body part properties

If a monster or a item has a body made of different limbs or parts, the limbs or parts are organized in a tree-like structure. Each limb or item part declares it's sub-limbs or sub-parts. Usually such complex structures are not required and thus all properties regarding sub-limbs or sub-parts are optional.

These are due to change and only preliminary.

# CPmax (int)           : max cutpoints (root thing)
# CPcurr (int)          : current cutpoints (root thing)
# BPmax (int)           : max bluntpoints (root thing)
# BPcurr (int)          : current bluntpoints (root thing)
# cp (int)              : limb cut points
# bp (int)              : limb blunt points
# hp.blunt (int)	: hitpoints for blunt damage
# hp.cut (int)          : hitpoints for other damage
Property Description
type (string) limb type/item type (*)
subtype (string) limb subtype/item subtype
vital (string) is this a vital limb ? ("true"). A monster dies if a vital limbs cut points drop below 0. A monster gets unconscious if a vital limbs blunt points drop below 0. (In H-World 0.0.3 only death is implemented).
hold_size.x (int) maximum width of thing this limb can hold
hold_size.y (int) maximum height of thing this limb can hold
direction (int) in the body structure view, this is the relative position of this limb/item part to parent limb/item part (octants) 0 = (1,0), 1 = (1,-1), 2 = (0,-1), 3 = (-1,-1), 4 = (-1,0), 5 = (-1,1), 6 = (0,1), 7 = (1,1)
limbs (int) number of connected limbs/item parts (sub limbs or parts).
limb[0] (string) section name of the 1st connected limb
limb[0].direction (int) Override for default limb direction of the 1st limb. This is useful to reuse limbs or item parts in different bodies or items

Appearance

Property Description
image (int/string) image number or filename for display in game (*)
image.inventory (int/string) image number or filename to display in inventory view for this thing (*)

Inventory and size properties

Property Description
width (int) Item width, used to determine if it fits for a limb. See thing_hold.x
height (int) Item height, used to determine if it fits for a limb. See thing_hold.y
inventory (string) has inventory ("true") or not
inventory.width (int) Width of the inventory
inventory.height (int) Height of the inventory

Item usages

In H-World, items and limbs can provide/have several usages. In H-World 0.0.3 only a "pick up thing" usage is implemented. Future version will allow to call scripts for usages, thus allowing to extend the game engine with additional functionality.

Property Description
usages (int) Number of usages this item has or this limb provides.
usage[0].verb (string) The verb to output/display if this usage is executed. For usage name "lua_call" this is also the name of the Lua function to call. (*)
usage[0].name (string) The name of the usage. Currently used to determine the type of the usage. In H-World available is only "pick_thing", but future version will provide a "lua_call" usage to call Lua script functions if the item is used.

Combat properties

In H-World, items can provide several attacks, i.e. sword can be swung or can be used to stab. Similarly a monster can have several attacks. (In H-World 0.0.3 the monster AI always uses the first attack).

Each attack can cause a number of damage types, i.e. blunt, cutting piercing and scratching damage. Different kinds of armor protect against different damage types. Blunt damage reduces blunt points, cutting, piercing and scratching damage reduces cut points of the target.

Property Description
attacks (int) number of attacks
attack[0].name (string) name of attack
attack[0].verb (string) output of attack i.e. 'bite' -> XY bite(s) ZZ
attack[0].damages (int) number of damage types
attack[0].damage[0].type (string) "cut", "blunt", "pierce", "scratch"
attack[0].damage[0].damage (string) %xdy, damage dice
block Most things are more or les useful to block a attack. This is the chance to block a attack (in %) with this item.

Default equipment

Some monsters and the player need to be created with some default equipment. The following properties determine the default equipment.

Property Description
things (int) number of things this thing is generated with
thing[0] (string) name of first sub-thing to generate (*)
thing[0].location.type (string) where (which limb type) to put the sub-thing (*)
thing[0].location.subtype (string) where (which limb subtype) to put the sub-thing

AI properties

Monsters can define Lua function to be called as part of their AI. See scripts.html, section AI scripts for details.

Property Description
AI (int) Number of AI scripts this being will use.
AI[0] (string) Base Lua function name of the first AI script to call. (See [module]/scripts/ai.lua). Each AI action is a pair of Lua functions, one to check if it is good to execute the actions now, and one that actually executed the action. The _check and _execute postfixes will be added by the H-World engine to the base funtion name automatically.

Hansjörg Malthaner
Last modified: Mon Sep 13 17:13:35 CEST 2004