CHARDEF
From SphereWiki
Missing languages
A CHARDEF block defines the basic properties of a character.
Contents
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. |
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. |
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. |
TSPEECH speech_defname | RW | ?? | Gets a list of speech handlers for the character, or adds a speech 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
[CHARDEF 01] // character animation 01 in mul files DEFNAME=c_ogre NAME=#NAMES_OGRE the Ogre // #NAMES_OGRE translates the name from a name group in sphere_name.scp SOUND=snd_MONSTER_OGRE1 // makes an ogre sound ICON=i_pet_OGRE // turns into i_pet_ogre when shrunk ANIM=078c7f CAN=MT_WALK|MT_USEHANDS // can walk and use its hands DAM=5,15 // deals between 5 and 15 damage with its fists ARMOR=16 // has a defense value of 16 without wearing armour RESOURCES=6 i_ribs_raw // made of 6 raw ribs, when carved FOODTYPE=15 t_meat_raw // ogre eats items with the TYPE t_meat_raw, up to a maximum of 15 food DESIRES=c_ogre, t_arock // likes rocks and other ogres AVERSIONS=t_TRAP,r_civilization // doesn't like traps and civilized regions ON=@Create // stuff that happens to the created instance of a character. NPC = brain_monster STR = {165 195} DEX = {46 65} INT = {46 70} PARRYING = {45.0 55.0} MAGICRESISTANCE = {45.0 60.0} TACTICS = {60.0 70.0} WRESTLING = {70.0 80.0} FAME = 4500 KARMA = {-1000 -1999} ON=@NPCRestock ITEM = loot_OGRE // receives ogre loot