Difference between revisions of "CHARDEF"

From SphereWiki
Jump to: navigation, search
m (Properties)
(Properties)
Line 87: Line 87:
 
|-
 
|-
 
| [[TAG]]''.name'' || RW || ?? || Gets or sets the value of a TAG.
 
| [[TAG]]''.name'' || RW || ?? || Gets or sets the value of a TAG.
 +
|-
 +
| [[THROWDAM]] ''min,max'' || RW || y || Gets or sets a range of damage used for thrown objects.
 +
|-
 +
| [[THROWDAM]] ''dam'' || RW || y || Gets or sets the constant damage used for thrown objects.
 +
|-
 +
| [[THROWOBJ]] ''id'' || RW || y || Gets or sets the ID of an object to be thrown by NPCs.
 +
|-
 +
| [[THROWRANGE]] ''min,max'' || RW || y || Gets or sets the range that an object can be thrown at.
 +
|-
 +
| [[THROWRANGE]] ''max'' || RW || y || Gets or sets the range that an object can be thrown at with a default min of 2.
 
|-
 
|-
 
| [[TSPEECH]] ''speech_defname'' || RW || ?? || Gets a list of speech handlers for the character, or adds a speech handler to the character.
 
| [[TSPEECH]] ''speech_defname'' || RW || ?? || Gets a list of speech handlers for the character, or adds a speech handler to the character.

Revision as of 17:07, 4 January 2014

Help
Available languages



A CHARDEF block defines the basic properties of a character.


Properties

Here is a list of all character definition properties.

Name Read/Write Override† Description
ANIM RW  ?? Gets or sets a mask of animations that the character supports. The default value is 0ffffff.
ARMOR RW  ?? Gets or sets the character's base defense without armour.
AVERSIONS RW  ?? Gets or sets a list of things that the character does not like.
BASEID R  ?? Gets the defname of the character if set, otherwise the ID.
BLOODCOLOR RW  ?? Gets or sets the character's blood colour (a value of -1 prevents the creature from bleeding at all.)
CAN RW  ?? Gets or sets attributes for the character. See can_flags in sphere_defs.scp.
COLOR RW  ?? Gets or sets the character colour.
DAM min,max RW  ?? Gets or sets the base damage that the character will deal without a weapon.
DAM.LO R  ?? Gets the minimum base damage the character will deal without a weapon.
DAM.HI R  ?? Gets the maximum base damage the character will deal without a weapon.
DEFNAME RW  ?? Gets or sets defname of the character.
DESIRES RW  ?? Gets or sets a list of things that the character likes.
DEX RW  ?? Gets or sets the dexterity that is set when a character polymorphs into this character.
DISPID R  ?? Gets the ID that the character displays as.
FOODTYPE RW  ?? Gets or sets a list of things that the character can eat.
HEIGHT RW  ?? Gets or sets the height of the character.
HIREDAYWAGE RW  ?? Gets or sets how much gold is needed to hire the character for one day.
ICON RW  ?? Gets or sets the item that can be used to represent the character in figurine form.
ID RW  ?? Gets or sets the ID of the character to inherit property values from.
INSTANCES R  ?? Returns the number of this character that exist in the world.
INT RW  ?? Gets or sets the intelligence that is set when a character polymorphs into this character.
JOB R  ?? Gets the character's job title.
MAXFOOD R  ?? Gets the maximum food level that the character can have.
MOVERATE RW Y Gets or sets the percent movement rate of the character. The higher it is, the slower the NPC will be. If undefined, the default is 100.
NAME RW  ?? Gets or sets the name of the character.
RANGE min, max RW Y Gets or sets the attack range of the character.
RANGEH R  ?? Gets the maximum attack range of the character.
RANGEL R  ?? Gets the minimum attack range of the character.
RESDISPDNHUE RW  ?? Gets or sets the colour to display as to clients who don't have a high enough RESDISP to see the character.
RESDISPNID RW  ?? Gets or sets the character ID to display as to clients who don't have a high enough RESDISP to see the character.
RESLEVEL RW  ?? Gets or sets the minimum RESDISP required for a client to see the character.
RESOURCES RW  ?? Gets or sets the resources that the character is made of.
RESOURCES.COUNT R  ?? Gets the number of different resources that the character is made of.
RESOURCES.n.KEY R  ?? Gets the BASEID of the nth resource that the character is made of. (zero-based)
RESOURCES.n.VAL R  ?? Gets the amount of the nth resource that the character is made of. (zero-based)
SOUND RW  ?? Gets or sets the generic sound that the character makes.
STR RW  ?? Gets or sets the strength that is set when a character polymorphs into this character.
TAG.name RW  ?? Gets or sets the value of a TAG.
THROWDAM min,max RW y Gets or sets a range of damage used for thrown objects.
THROWDAM dam RW y Gets or sets the constant damage used for thrown objects.
THROWOBJ id RW y Gets or sets the ID of an object to be thrown by NPCs.
THROWRANGE min,max RW y Gets or sets the range that an object can be thrown at.
THROWRANGE max RW y Gets or sets the range that an object can be thrown at with a default min of 2.
TSPEECH speech_defname RW  ?? Gets a list of speech handlers for the character, or adds a speech handler to the character.
TEVENTS event_defname RW  ?? Gets a list of event handlers for the character, or adds an event handler to the character.

Some properties can be overridden on a individual character basis. For example, you can set TAG.OVERRIDE.MOVERATE on a specific NPC to speed up or slow down the speed at which that one NPC will move.

INI Overrides

Name Description
TAG.OVERRIDE.RUNNINGPENALTY This special tag overrides the INI setting of the same name on a per character basis.
TAG.OVERRIDE.STAMINALOSSATWEIGHT This special tag overrides the INI setting of the same name on a per character basis.

Examples

This first example shows a "base" CHARDEF... these are identified by the fact that the CHARDEF keyword is followed by a number:

[CHARDEF 01]        // This is a "base" chardef for character animation 01 (from the mul/uop files)
// This is the start of the "base" properties.
// Values set in the base properties cannot have a range (you cannot use {1 10})
DEFNAME=c_ogre                    // The DEFNAME is a friendly name to reference this CHARDEF
NAME=ogre                         // This is the creature's name as seen in-game
ICON=i_pet_ogre                   // If the creature is shrunk, this is the item that will result
SOUND=snd_monster_ogre1           // This is the start of the sound entries for this creature
CAN=MT_WALK|MT_USEHANDS|MT_EQUIP  // These flags are defined in the can_flags area of sphere_defs.scp
DAM=18,22                         // This is the range of damage they creature will cause when not using a weapon
ARMOR=30                          // ARMOR is the physical damage resistance *before* additional armor is equipped
DESIRES=r_forests,t_gold,t_coin,t_gem,t_arock
AVERSIONS=t_trap,r_civilization
FOODTYPE=35 t_meat_raw            // This is the maximum amount (and types) of food the creature eats
RESOURCES=2 i_ribs_raw            // If this creature's corpse is carved, these resources will be created
BLOODCOLOR=colors_blood           // This is the color of this creatures blood
MOVERATE=100
TAG.Barding.Diff=48.8             // When a TAG is added to the "base properties", all existing creatures are affected
TAG.SlayerGroup=OGRE,REPOND
TEVENTS=e_carnivores2             // EVENTS are collections of triggers used by CHARDEFs. Each TEVENT must be on its own line.
CATEGORY=Monsters                 // CATEGORY, SUBSECTION, and DESCRIPTION are used by the GM tool "Axis"
SUBSECTION=Giants
DESCRIPTION=Ogre

// This is the end of the "base" properties, and the start of the "triggers".
// You can override *most* base properties in a trigger if necessary.

ON=@Create                        // This is the @Create trigger
    NAME=#NAMES_OGRE               // #NAMES_OGRE is an array of names defined in sphere_names.scp
    TITLE=the ogre
    NPC=brain_monster              // The available "brains" are defined in sphere_defs.scp
    FAME={1500 1999}               // The { } marks are used to set a range of possible values
    KARMA={-1500 -1999}
    STR={165 195}
    MAXHITS={100 120}              // If MAXHITS is not set, the default value is the same as STR
    DEX={45 65}
    MAXSTAM={45 65}                // If MAXSTAM is not set, the default value is the same as DEX
    INT={45 70}
    MAXMANA={45 70}                // If MAXMANA is not set, the default value is the same as INT
    MAGICRESISTANCE={55.0 70.0}
    PARRYING={60.0 70.0}
    TACTICS={60.0 70.0}
    WRESTLING={70.0 80.0}
    MODAR={0 5}                    // Setting MODAR in @Create lets us add o-5 more ARMOR to this creature
    RESCOLD={15 25}
    RESENERGY={15 25}
    RESFIRE={15 25}
    RESPOISON={15 25}
ON=@NPCRestock
    ITEM=loot_ogre                 // This references a TEMPLATE in the sphere_templates_loot.scp file