Creating new items

From Teraurge
Jump to navigationJump to search

Inventory items are quite simple to create, at least on the technical level. There are only a couple of things needed to make new ones. You always need a definition in items.txt and, if you're making an equippable weapon or armour, a sprite.

Items.txt[edit | edit source]

Items are defined in-between <(name) (...) (name)> tags. The name is used both in dialogue functions and internally in its unaltered form and in the in-game UI where it's slightly edited (underline _ characters are replaced by spaces and the first letter of the name is capitalised). Attributes are then specified in the same way as in environment stats and character stats; that is, attribute name followed by a colon, a space and the value.

Currently, multiple files cannot be loaded on top of each other and an edit to the master items.txt under Teraurge\database\items has to be done. To be fixed in later versions.

General stats[edit | edit source]

No matter what kind of item you're creating, you need to include these stats:

Attribute Value
slot Type of the item. Possible values: head, torso, legs, socks, shoes, boots, hands, mainhand, sidearm, offhand or inventory.

Most of these are obvious but some aren't as clear as others. The difference between shoes and boots is that boots trigger a change in the sprite of an equipped legs item to use the "tucked" variant.
Inventory type is for unequippable items, like keys, quest items, torches, etc. They only exist in the player's inventory and can only be used through a dialogue. They currently can't have any sort of a sprite, which is to be changed in future versions.

adats, krats Value of the item in the two currencies in the game. Currently, the value stays the same no matter if the player is buying or selling the item or where.
text The item's description.

Equippable item stats[edit | edit source]

These attributes are used if you're making a piece of armour or a weapon. You don't need to specify all of them, only those that you need.

Attribute Value
heat_res, cold_res, impact_res, slash_res, pierce_res, magic_res, bio_res Various resistances the item gives the player when equipped.
card The card that is given to the player when equipped. These are used during combat, usually as attacks.
card_n The number of cards of the previously specified type given to the player.

Graphics[edit | edit source]

The difference between male and female sprites of starting clothing.

Unless you're making unequippable items, you need to create sprites for the items. These are 700x700 transparent PNG files that overlay most of the inventory screen. There will be a lot of empty space in the sprites. Weapons only have a single sprite (stored in database\items\graphics\equipped_items), but clothes and armour allows for both male and female sprites to be used (stored in database\items\graphics\default_f and default_m).

Use the included default_m.png and default_f.png files to take measures and to create fitting clothing.

Naming scheme[edit | edit source]

Sprites are expected to have the same filename as specified in the item's nametag. Weapons are left like that while clothing requires a suffix or two. Male clothing filename is followed by _m while female clothing is followed by _f. Since legwear can be triggered to change its sprite to a tucked variant by equipping boots, you need to also include sprites with the _tucked suffix.

Examples[edit | edit source]

The first example is a spoon that can only be carried in the player's inventory:

<spoon
  slot: inventory
  adats: 1
  krats: 0
  text: A tablespoon made of a silvery material.
spoon> 

This next item are armoured pants. They give the player decent protection and allow them to use a stronger kick during combat:

<armoured_pants
  slot: legs
  adats: 15
  krats: 0
  text: Re-inforced trousers with sewed in sharpened metal plates. Tough, strong, and painful to be kicked with.
  
  impact_res: 2
  slash_res: 4
  pierce_res: 2
  
  card: metal_kick
  card_n: 2
armoured_pants>

You can use up to four different sprites for this one:

  • armoured_pants_m - the default sprite when equipped as a male player.
  • armoured_pants_f - the default sprite when equipped as a female player.
  • armoured_pants_m_tucked - the sprite when equipped as a male player with a boots item also equipped.
  • armoured_pants_f_tucked - the sprite when equipped as a male player with a boots item also equipped.