Skip to content
Luke M. edited this page Jul 3, 2013 · 4 revisions

Foreword

There are three main files attached to Life entities:

  • .XML - Defines some basic metadata, like name and species, in addition to its skeletal structure.
  • .JSON - The "compiled" version of the .XML file. The engine understands this better than the XML format.
  • .DAT - Controls the entity's behaviors in a variety of situations. Also referred to as "raw script."

Creating and Defining the Entity

Create a new file in data/life using the .xml extension. Name it as you which; we'll use it later when adding the new entity to the spawn list. Create another file in the same directory with the same name, this time with the .dat extension.

Skeleton

Copy the following into your newly-created .xml file: https://gist.github.com/flags/5922560

Anything before the <body> helps give the engine some idea of what the entity looks like (in addition to some metadata) before we define the skeleton itself. The tags are as follows:

  • name - Name of this entity. $FIRST_AND_LAST_NAME_FROM_SPECIES can be used to randomly assign a name based on species.
  • species - Species for this entity. human, dog, etc. You can define your own.
  • type - Unused (for now.) Vague classification for the entity. humanoid, animal, etc.
  • flags - See Entity Flags below.
  • vars - For assigning variables mentioned in flags
  • icon - Visual representation of the entity.

Entity Flags

  • LEGS - List of limbs that the entity will walk on. If there are multiple limbs PER leg, list the first one only.
  • ARMS - Same as legs.
  • HANDS - Same as legs.
  • HUNGER - Entity is affected by hunger. You will need to set hunger_max= and then define hunger=hunger_max.
  • THIRST - Same as hunger. You will need to set thirst_max= and then define thirst=thirst_max.
  • CAN_SEE - Self-explanatory. Make sure to include sight in a limb's AFFECTS array if you want the entity's sight to be affected by injuries to that limb. You must also set vision_max=.
  • MELEE - List of limbs that can be used during melee combat.

Limb Flags

  • SKIN - Self-explanatory.
  • MUSCLE - Self-explanatory.
  • BONE - Self-explanatory.
  • CRUCIAL - Houses a major artery.