April 21, 2015

Tutorial: Making a Telepath Tactics Campaign, Part 16

<< Continued from Part 15

A. Creating a new item icon

We’ve been delving deep into scripting stuff these past few tutorials, but we still haven’t talked about one of the most fundamental things you can mod in the game: items! Let’s talk about those now.

We’ll start by talking about icons. You can always reuse an existing icon for a new item, of course, but it’s better to make a new icon for it so that it’s visually distinct for the player.

To create an item icon, we first need some pixel editing software. There are a lot of good options, and many of them free–here are a few popular ones: PyxelEdit, Asesprite, GIMP, GraphicsGale, and Pixie.

Once you have your pixel editing software installed, open the program and create a new image with a transparent background, 48 pixels wide by 48 pixels high.

Paint the item icon onto the background. Do your best to keep it centered, and try to leave at least a pixel or two clear around the edges so you don’t end up overlapping the border on the background. (Note that the game composites the icon with the background automatically–don’t put the background into the item icon image.)

Once you have your icon, save it as a .PNG file in Telepath Tactics > Data > UI > Item Icons.

B. Creating a new item

With our item’s icon all ready to go, it’s time to make the item itself! Open up ItemClasses.xml in your XML editor.

Notice that each item is defined within the attributes of a single <Item></Item> XML tag. Copy-paste an existing item to use as a template, then change its name and begin experimenting with altering its attributes. The attributes of each item are as follows:

  • name – the item’s name.
  • useableWiththis tells the game whether an item is used, equipped, or whether it has some automatic effect upon being grabbed. Use automatic to make the item trigger immediately on pickup; use triggered for a regular useable item; use quest if it’s a quest item (the player won’t be able to drop or use it); or use the name of one of the game’s eight equipment slots (Weapon HandOff Hand, Head, Neck, Torso, Back, Feet, Accessory) if it’s a piece of equipment–it will become equippable only in the named slot.
  • requirementsthis tells the game what characteristics a character has to possess before he or she can either use or equip an item. There are three requirement types: race, class, and level. An item may use any combination of these three.
    • Race requirements – To create race requirements, type r, a colon, then the names of every race that can use or equip the item, separated by commas. This will tell the game that characters belonging to any of the named races (and only those races) may use or equip the item.
    • Class requirements – To create class requirements, type c, a colon, then the names of every class that can use or equip the item, separated by commas. This will tell the game that characters belonging to any of the named classes (and only those classes) may use or equip the item.
    • Level requirement – To create a level requirement, type l, a colon, then the minimum required level for a character to use or equip the item.
      • Usage example: requirements=”r:Human,Spriggat/c:Swordsman,Fencer/l:6″ will tell the game that the item can only be used or equipped by a character that is a Human or a Spriggat; that is either a Swordsman or Fencer; and that is level 6 or higher.
  • endsStatustype in the name of a status effect you want the item to end. To end multiple status effects, type in each status effect’s name separated by a forward slash.
  • NOTE: you can type all in lieu of specific status effects if you want the item to remove every status effect on the character.
  • addsStatustype in the name of a status effect you want the item to grant. To grant multiple status effects, type in each status effect’s name separated by a forward slash.
  • grantsAtk type in the name of an attack you want the item to grant. To grant multiple attacks, type in each attack’s name separated by a forward slash.
    • Note: attacks granted by triggered and automatic items will last for the remainder of the battle. Attacks granted by equipped items will remain for as long as the item is equipped.
  • consumedAfterfor triggered and automatic items, this sets the maximum number of times an item can be used before it will be fully consumed and vanish. For items that are useableWith Weapon Hand, however, if this is set to any number above 0, that determines the weapon’s durability. The weapon can be used exactly that number of times before breaking. (Just leave it at 0 if you want the weapon to be indestructible.)
  • itemValue ignore this one for now; just leave it set to 0.
  • hpPlusan integer added to the character’s current health.
    • Negative integers will decrease the stat, while 0 will have no effect; negative integers and 0 behave the same way with all of the following integer attributes as well.
  • pspPlusan integer added to the character’s current energy.
  • maxHPPlusan integer added to the character’s maximum health.
  • maxPsPPlusan integer added to the character’s maximum energy.
  • spdPlusan integer added to the character’s current speed.
  • dodgePlusan integer added to the character’s current dodge percentage.
  • strPlusan integer added to the character’s current strength.
  • perPlusan integer added to the character’s current perception.
  • psyPPlusan integer added to the character’s current psy power.
  • psyDPlusan integer added to the character’s current psy defense.
  • prcResPlusan integer added to the character’s current pierce resistance.
  • slshResPlusan integer added to the character’s current slash resistance.
  • crshResPlusan integer added to the character’s current crush resistance.
  • mnResPlusan integer added to the character’s current mental resistance.
  • htResPlusan integer added to the character’s current heat resistance.
  • cdResPlusan integer added to the character’s current cold resistance.
  • ltResPlusan integer added to the character’s current light resistance.
  • shResPlusan integer added to the character’s current shadow resistance.
  • poiResPlusan integer added to the character’s current poison resistance.
  • accPlusan integer added to the character’s current base attack accuracy percentage.
  • ctrLimitPlusan integer added to the character’s current counter limit.
  • commonalitya whole number representing the item’s commonality. The higher the number, the more common it is; the closer to 0, the rarer it is. This directly impacts the probability of an item dropping in a random item drop, or appearing in the inventory of a character or object whose inventory contains an -R- symbol; the higher the commonality value, the more likely it is to be randomly selected, while a commonality of 0 means it will never be selected. Commonality also determines whether the item falls within the commonality range of an R[x-y] symbol. (For example: a chest with R[12-15] in its inventory will spawn with a randomly selected item that has a commonality value between 12 and 15. Items with commonality higher than 15 or lower than 12 will not be selected.)
  • addsTagscharacter tags that the game will add to any character who equips the item (the game will remove these tags from the character upon unequipping the item). This can also be used with triggered and automatic items, in which case the tags will be attached permanently. Tags consist of the tag name; if the tag has any attributes, place a comma between the tag name and its attributes, delimiting each attribute with a colon. To add multiple tags, delimit each with a forward slash.
    • Usage example: <Item name=”Lockpicks” … addsTags=”ModDmgForClass,+:50:Chest”…></Item> This tells the game to add a single character tag, ModDmgForClass, to any character who equips Lockpicks. The parameters on this tag tell the game to give her attacks +50 damage against characters or objects of the class “Chest.” The tag will be removed again when the Lockpicks are unequipped.
  • imagethe filename of the item’s icon, minus the .png file extension. (Just use the name you picked in Section A above.)
  • descriptionthe text description of the item as it appears in-game.

Just as with the characters in CharClasses.xml, it will cause problems here if you delete any of the item attributes or change their order. Don’t do that.

That’s all! Go have fun and experiment with creating your own items. In the next part of the tutorial, we’ll learn about creating custom scripts, then learn how to make items trigger them. See you next time!

 


Continued in Part 17 >>