Tags

From Towns Wiki
Jump to: navigation, search

Note: This may not be the permanent location of this page.

Brownie.png This page is a stub.
You can help out the Towns wiki by expanding it.


Tags are used by modders to give attributes to objects. Tags always begin with the tag and are almost always ended by /tag (ex. <action>"stuff"</action>). The following is divided by relevant xml file.

Contents

actions.xml[edit | edit source]

The actions.xml file is surrounded by the tag <actions>. Interior, each entry is surrounded by the tag <action>.

<id>[edit | edit source]

Value: alphanumeric. Establishes the id of the action and is used to reference the action elsewhere. This is normally done as q<action>, ie, qcut.

<priorityID>[edit | edit source]

Value: priorities.xml "id". Establishes priority of the action (see priorities.xml)

<name>[edit | edit source]

Value: any. Names the action. Only relevant to right-click actions and actions that do not create an item

<queue>[edit | edit source]

The queue tag surrounds instructions for your civilians within an action. Instructions are followed in sequentially.

<pick>[edit | edit source]

Value: items.xml entry. Instructs the civilian to move to the named item and pick it up. Multiple items can be listed, separated by commas, and results in any 1 of those items being picked up.

<pickFriendly>[edit | edit source]

Value: livingentities.xml entry. Variant on pick for picking up a living entity of type FRIENDLY.

<move>[edit | edit source]

Value: items.xml entry. Instructs the civilian to move to the named item.

<wait>[edit | edit source]

Value: numeric. Instructs the civilian to wait (do nothing) for X turns.

<destory />[edit | edit source]

Value: N/A. Instructs the civilian to destroy whatever he/she is holding (via the pick tag). Note the tag is self contained; it does not need an end tag nor any value.

<unlock />[edit | edit source]

Value: N/A. Frees the civilian from current queue to allow eating or sleeping.

<createItem>[edit | edit source]

Value: items.xml entry. Creates an item.

<createFriendly>[edit | edit source]

Value: livingentities.xml entry. Creates a living entity of type Friendly.

buildings.xml[edit | edit source]

This file is surrounded by the <buildings> tag and the entry tags are the reference IDs (ex. <pigfarm> </pigfarm>, not <building><id>pigfarm</id></building>).

<name>[edit | edit source]

Value: any. Building name, visible when you construct the building and mouse over it.

<description>[edit | edit source]

Value: any. Sub text for the building, visible when you construct it.

<width>[edit | edit source]

Value: numeric. The number of squares the building requires on the x axis. Default is 1.

<height>[edit | edit source]

Value: numeric. The number of squares the building takes on the y axis. Default is 1.

<groundData>[edit | edit source]

Value: E, 0 or 1. Sets which squares of the building citizens can walk through, starting with the north-west corner, with "1" being allowed and "0" being blocked. "E" sets the spawn location for items or entities and can be walked through. The default for 3x3 structures such as farms is "1001E0111", and for 2x2 structures like the mineshaft is "00E1".

<type>[edit | edit source]

Value: SPAWN. What the building does. Currently SPAWN is the only option (Building spawns a livingEntity or item).

<canBeBuiltUnderground>[edit | edit source]

Value: true/false, defaults true. Sets if the building can be built underground.

<mustBeBuiltOver>[edit | edit source]

Value: terrain.xml entry. Sets any terrain tiles that the building must be built over. If none are set the building can be placed anywhere.

<prerequisite>[edit | edit source]

Value: items.xml entry. Required to build the building. Multiple <prerequisite> tags can be set and are additive.

<prerequisiteFriendly>[edit | edit source]

Value: livingentities.xml entry. Variant for type Friendly on prerquisite.

<mineTerrain>[edit | edit source]

Value: true/false, defaults false. When true the item spawns the terrain it is built on (ex. mineshaft).

</automatic>[edit | edit source]

Value: true/false, defaults false. Sets the default state of the building if it is a SPAWN building.

campaigns.xml[edit | edit source]

caravans.xml[edit | edit source]

This file is surrounded by the <caravans> tag and the entry tags are the reference IDs (ex. <food> </food>, not <caravans><id>food</id></caravans>).

<zone>[edit | edit source]

Value: zones.xml entry. The zone where the Caravan will set up. Usually zmarket but can be set to other zones.

<pricePCT>[edit | edit source]

Value: numeric. The mark-up for items sold by the Caravan. For example, if a Caravan has <pricePCT>200</pricePCT> every item sold by the caravan will be double the item's default value.

<coins>[edit | edit source]

Value: numeric. The amount of coins the Caravan carries.

<buys>[edit | edit source]

Value: items.xml "type". The types of items that the Caravan will buy from the player. Multiple items separated by commas.

<comePCT>[edit | edit source]

The chance the Caravan will arrive every time the game generates a new Caravan. Can be any number between 1-100. For example, if a caravan has <comePCT>100</comePCT> it has an equal chance of spawning with other Caravans of the same <comePCT>, but if a Caravan has <comePCT>1</comePCT> then each time the game spawns a Caravan it only has a 1% chance of spawning versus a Caravan with <comePCT>100</comePCT>

<item>[edit | edit source]

Sets a random item type that the Caravan will sell. Must be closed with a </item> tag once the following tags are set. Only 1 type per entry.

<type>[edit | edit source]

Value: items.xml "type". Sets the type for random item generation.

<PCT>[edit | edit source]

Value: numeric. The chance the Caravan will generate the item(s).

<quantity>[edit | edit source]

Value: numeric. The number of items generated within the type. Can use Towns' Dice system to generate random numbers.

effects.xml[edit | edit source]

Surrounded by tag <effects>, each entry marked by tag <effect>.

<id>[edit | edit source]

Value: alphanumeric. The effect id for referencing it elsewhere.

<name>[edit | edit source]

Value: any. The name that shows if hovering over a currently affected entity.

<icon>[edit | edit source]

<removeTarget>[edit | edit source]

Value: true/false, defaults false. Causes the entity to forget its current target.

<DOT>[edit | edit source]

Value: numeric. Does X damage (or healing if negative) every turn the effect lasts. (Damage Over Time)

<graphicChange>[edit | edit source]

Value: graphics.ini entry. Identifies a new graphic to replace the entity with during the effect.

<attackAllies>[edit | edit source]

Value: true/false, defaults false. True forces the entity to attack allies during the effect.

<lasts>[edit | edit source]

Value: numeric. How long the effect lasts in turns. If the tag is absent, the effect is always active.

<afterEffects>[edit | edit source]

Value: effects.xml "id". Triggers new effect(s) after the current ends. Multiple entries are separated by commas.

<messageWhenVanish>[edit | edit source]

Value: true/false, defaults true.

<attributePCT>[edit | edit source]

attributePCT tags modify stats of the living entity by a percentage (ex. <damagePCT>50</damagePCT> would reduce damage output by half).

<attackPCT>[edit | edit source]

Value: numeric. Modifies attack total.

<damagePCT>[edit | edit source]

Value: numeric. Modifies overall damage output.

<healthPCT>[edit | edit source]

Value: numeric. Modifies health totals (does not modify current health, only total).

<defensePCT>[edit | edit source]

Value: numeric. Modifies defense total.

<speedPCT>[edit | edit source]

Value: numeric. Modifies walkSpeed total.

<attackSpeedPCT>[edit | edit source]

Value: numeric. Modifies attackSpeed total.

Targeting & Chaining Effects[edit | edit source]

By default, effects affect the entity using the effect. In order to affect other targets, you need to make a targeting effect using one of the below methods, which then "chains" to a new effect(s) (one can chain to the same target using "afterEffects" above).

<onHitPCT>[edit | edit source]

Value: numeric. The effect occurs with % chance on melee hits.

<onRangedHitPCT>[edit | edit source]

Value: numeric. Same as onHitPCT but for ranged hits.

<onHitEffects>[edit | edit source]

Value: effects.xml "id". Effect(s) which occurs on the target when onHitPCT is succesful. Multiple entries are separated by commas (ex. <onHitEffects>stunned,bleeding</onHitEffects>).

<onRangedHitEffects>[edit | edit source]

Value: effects.xml "id". Same as onHitEffects but for ranged attacks.

<castEffects>[edit | edit source]

Value: effects.xml "id". While affected, the entity will "cast" the effect(s) listed. Multiple entries are separated by commas.

<castCooldown>[edit | edit source]

Value: numeric. The time in turns between castEffects.

<castTargets>[edit | edit source]

Value: livingentities.xml "type" or entry. Establishes possible targets of castEffects (ex. <castTargets>ENEMY,FRIENDLY,froggy</castTargets>).

heroes.xml[edit | edit source]

items.xml[edit | edit source]

This file is surrounded by the <items> tag and the entry tags are the reference IDs (ex. <stool> </stool>, not <item><id>stool</id></item>).

<name>[edit | edit source]

Value: any. Names the item - this is what shows on hover as well as in menus if the item is created via an action.

<description>[edit | edit source]

Value: any. Sets the hover subtext for the item.

<type>[edit | edit source]

<action>[edit | edit source]

Value: actions.xml "id". References an action that the item can be right-clicked to preform.

<locked>[edit | edit source]

Value: true/false, defaults false. True means the item cannot be moved once placed unless invalidated (such as by removing terrain beneath it).

<buildingTime>[edit | edit source]

Value: numeric. If the item is auto-produced via a building, this tag sets the turns required for 1 spawn.

<prerequisite>[edit | edit source]

Value: items.xml entry. If the item is produced by a building, this sets item(s) required to make 1 of the item. Each tag is one prerequisite item.

<stackable>[edit | edit source]

Value: true/false, defaults false. True allows the item to be stored in containers.

<stackableSize>[edit | edit source]

Value: numeric. Establishes how many "slots" in a container an item requires.

<container>[edit | edit source]

Value: true/false, defaults false. True allows the item to store other items.

<containerSize>[edit | edit source]

Value: numeric. Establishes the amount of item "slots" the container can hold.

<canBeEaten>[edit | edit source]

Value: true/false, defaults false. True makes the item edible,

<foodValue>[edit | edit source]

Value: numeric. Determines eating preference with higher numbers being selected over lower ones (highest vanilla value is 6 for cookies).

<foodFillPCT>[edit | edit source]

Value: numeric. The percentage the food fills (can be over 100).

<foodEatTime>[edit | edit source]

Value: numeric. How many turns is required to consume the food.

<foodEffects>[edit | edit source]

Value: effects.xml "id". Sets effects for eating the food. Multiple entries separated with commas.

<maxAge>[edit | edit source]

Value: numeric. Sets the item to disappear after X turns.

<maxAgeItem>[edit | edit source]

Value: items.xml entry. Spawns a new item when maxAge expires.

<habitat>[edit | edit source]

Value: terrain.xml entry. One entry per tag, multiple tags acceptable.

Equipment Tags[edit | edit source]

These tags are for equipment items specifically.

<location>[edit | edit source]

Value: WEAPON/HEAD/BODY/LEGS/FEET. This allows the item to be equipped in the specified slot.

<level>[edit | edit source]

Value: numeric. Sets the level of the equipment; used for auto-equip discrimination.

<ranged>[edit | edit source]

Value: true/false, defaults false. True means the item can be fired up to total LOS value.

<rangedAmmo>[edit | edit source]

Value: graphics.ini entry. Sets the graphic of the projectile.

<rangedCharges>[edit | edit source]

Value: numeric/INFINITE. Sets how many projectiles can be fired before the item is destroyed, or, unlimited if set INFINITE.

<attack>[edit | edit source]

Value: numeric. Sets a flat attack modifier for the equipment, generally partially random.

<defense>[edit | edit source]

Value: numeric. Sets a flat defense modifier for the equipment, generally partially random.

<damage>[edit | edit source]

Value: numeric. Sets a flat damage modifier for the equipment, generally partially random (note that random values only apply when item is created, not per hit).

<LOS>[edit | edit source]

Value: numeric. Sets a flat LOS (Line Of Sight) modifier for the equipment, generally partially or entirely random if present. It is the distance (in spaces) that an entity can see, or fire a ranged weapon.

<walkSpeed>[edit | edit source]

Value: numeric. Sets a flat movement speed modifier for the equipment.

<attackSpeed>[edit | edit source]

Value: numeric. Sets a flat attack speed modifier for the equipment.

<verb>[edit | edit source]

Value: any. Sets the attack verb of a weapon for messages (ex. Chris hits froggy for 100 damage).

<verbInfinitive>[edit | edit source]

Value: any. Sets the infinitive attack verb of a weapon for messages (ex. Chris attempts to hit froggy but misses).

<value>[edit | edit source]

Value: numeric. Monetary base value for caravan trading purposes. Note that this can be enhanced by prefixes, suffixes, better random values (for equipment) and caravan random price percentage.

livingentities.xml[edit | edit source]

matspanel.xml[edit | edit source]

menu.xml[edit | edit source]

menu_production.xml[edit | edit source]

menu_right.xml[edit | edit source]

names.xml[edit | edit source]

prefixsuffix.xml[edit | edit source]

prices.xml[edit | edit source]

priorities.xml[edit | edit source]

skills.xml[edit | edit source]

terrain.xml[edit | edit source]

types.xml[edit | edit source]

zones.xml[edit | edit source]

graphics.ini[edit | edit source]

Map Gen Files[edit | edit source]

Found within data/campaigns/c1/map name

gen_dungeons.xml[edit | edit source]

gen_items.xml[edit | edit source]

gen_livingentities.xml[edit | edit source]

gen_map.xml[edit | edit source]

<numLevelsOutside>[edit | edit source]

<numLevelsUnderground>[edit | edit source]

<mainTerrain>[edit | edit source]

<numCitizens>[edit | edit source]

<numCitizens>XX</numCitizens> Changing the number between these tags, will change the number of townies a player/you start off with. The base number of starting townies is 11.

<startingLevel>[edit | edit source]

Miscellaneous[edit | edit source]

This section is for tag modifiers and things not covered specifically by an xml section.

useSource="true"[edit | edit source]

Found in actions.xml, this modifies <pick> and <move> tags (ex. <pick useSource="true">rmwood</pick>), and is necessary to enable a right click action on an item or entity.

esES="XYZ"[edit | edit source]

Found on <name>, <description>, and attackverb tags, this enables a Spanish translation (ex. <attackVerb esES="golpea">punches</attackVerb>).

Random Numerical Values[edit | edit source]

Numeric values generally accept randomization using the "d" mechanism (ex. 1d200+1 randoms 1 to 200 plus 1).

deprecated[edit | edit source]

<type>[edit | edit source]

<type> is what group the object belongs to

Possible Type values[edit | edit source]

<type> has a range of possible values, depending on which file it is located in.

items.xml[edit | edit source]

  • rawmaterials
  • rawfood
  • prepfood
  • utils
  • decorative
  • furniture
  • weapon
  • armor

<maxAge>[edit | edit source]

maxAge determines the "lifespan" of an item or living entity in turns. The object or entity is destroyed once this expires.

<item code=" " parameter= " "/>[edit | edit source]

Code = action type
parameter = action name

Valid code=" " values[edit | edit source]

Note: do not confuse code=" " with the <type> tag located in the action

  • QUEUE
  • QUEUEANDPLACE
  • QUEUEANDPLACEROW