A. Editing a character’s leveling attributes with <OnLevelUp>
Only playable characters gain experience from defeating enemies; however, any character in the game can be leveled up through tags and scripts! If a character’s level is going to be changed in-game, then that character needs to have an OnLevelUp tag within <Char> to tell the game what to do with them when the level-up occurs.
There are two basic aspects to <OnLevelUp>: attributes (which determine the probability that a given stat will improve when the character levels up), and attacks to learn when the character hits a certain level. We’ll start with the attributes.
Other than charname, there are 16 attributes inside <OnLevelUp>; these correspond to the character’s existing stats. Whenever a character levels up in Telepath Tactics, the game randomly selects two different stats to improve. The stats are shuffled like a deck of cards; the number associated with each stat in <OnLevelUp> determines the number of “cards” shuffled into the deck. A higher number means a higher probability of being selected.
These are the attributes:
- hp – probability of gaining maximum health on level up.
- en – probability of gaining maximum energy on level up.
- ctrLimit – probability of gaining an extra counterattack on level up.
- dodge – probability of gaining extra dodge on level up.
- acc – probability of gaining extra accuracy on level up.
- str – probability of gaining strength on level up.
- psyP – probability of gaining psy power on level up.
- psyD – probability of gaining psy defense on level up.
- prcRes – probability of gaining pierce resistance on level up.
- slshRes – probability of gaining slash resistance on level up.
- crshRes – probability of gaining crush resistance on level up.
- mnRes – probability of gaining mental resistance on level up.
- htRes – probability of gaining heat resistance on level up.
- cdRes – probability of gaining cold resistance on level up.
- ltRes – probability of gaining light resistance on level up.
- shRes – probability of gaining shadow resistance on level up.
To increase the likelihood of a given stat improving upon level-up, just increase its numerical value; decrease it to lower the likelihood. Note, however, that any stat with a 0 next to it will never increase upon leveling up. (Also, don’t use numbers below 0 here; bad things may happen.)
Got it? Try changing Tobias’s OnLevelUp attributes so that he develops differently from Ann Veal!
B. Editing a character’s attacks to learn with <OnLevelUp>
Character stat improvement, while important, is only half of the picture when it comes to leveling up! Characters (including enemies) can also learn new attacks and abilities as they increase in level.
Attacks to learn are defined in between <OnLevelUp> and </OnLevelUp> using a level number, a comma, then the name of the attack to learn at that level. Suppose, for instance, that we want Tobias to learn the Bayonet attack at level 2. We tell the game to do this like so:
<OnLevelUp charname=”Tobias/Funke” … shRes=”0″>2,Bayonet</OnLevelUp>
To queue up additional attacks to learn, we just put an extra comma on the end and keep going in the same manner. Here, we tell the game that at level 4, we also want him to learn Powder Bolt:
<OnLevelUp charname=”Tobias/Funke” … shRes=”0″>2,Bayonet,4,Powder Bolt</OnLevelUp>
You can have any character learn any attack that exists in Attacks.xml in this way.
Note: weapon-based special attacks depend upon the character being able to use the basic attack for that weapon type. This prevents characters from running around and using weapon-dependent special abilities even when they don’t have a weapon; but it also means that characters who can’t use that weapon in the first place can’t use them either!
For example: Double Strike depends upon Sword. Since Tobias is the wrong class to use swords, he’s never going to have the Sword attack available, and thus will never be able to use Double Strike even if you teach it to him!
To check whether an attack depends upon another attack in this way, look in Attacks.xml and see if there’s a separate attack named in its dependsUpon attribute. For Tobias, we’re going to want to stick to attacks that either depend upon Crossbow, or have no dependsUpon attack at all.
Okay! That about covers what we need to know for setting up a character’s leveling scheme. (We’ll talk about character promotions much later on.) In the next part, we’ll set up the player’s starting army roster and create a battle.