Tribes 2 Scripting/Coding. Tribes 2 General Game Information Modifications Heads-Up-Displays Scripting/Coding Mapping Missions Custom Skin Creation Screenshots, duh! Links to Greater Sites Origional Tribes Page td>
Tribes 2 Links: Weapons Armor Vehicals Packs, Deployables Official Map Editor Guide Scripting
Tribes2 logo Team combat on an epic scale.

New Armor-Class Tutorial

Thanks to the Tribes 2 Coding Community and Nevermind for this tutorial.

Adding an armour Author: Nevermind
This tutorial will add an Armor class called the "Berzerker".

Step #1
First, we want to make a new damage profile for our Berzerker armor. This allows you to easily change the damage a given weapon does to the armor, without affecting the other armors. Open damagetypes.cs. Scroll to the bottom where there is a datablock for MediumPlayerDamageProfile. Copy it, and rename it BerzerkerPlayerDamageProfile.

Step #2
Open player.cs. Scroll down the file untill you find the datablock called: datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile

Ok, now you gotta copy the entire datablock, and then paste it right under, and then you change the name from PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile to PlayerData(BerzerkerMaleHumanArmor) : BerzerkerPlaerDamageProfile.

The last part of the datablock title refers to the damage profile for the armor. Change it to use the new damage profile we created, BerzerkerPlayerDamageProfile.

Later in player.cs, you will see definitions of MediumFemaleHumanArmor and MediumMaleBiodermArmor, you need to define a female armor datablock and a Bioderm armor datablock for your new armor, or else bad things will happen. Copy the 2 datablocks just mentioned and rename them to be BerzerkerFemaleHumanArmor and BerzerkerMaleBiodermArmor, respectivly. Also change their parent datablock from MediumMaleHumanArmor to BerzerkerMaleHumanArmor.

Step #3
Open inventoryHud.cs. Go to the section where it defines $InvArmor. The order of this array determines the order the armor appear on the HUD. Change this section to look like the following:
$InvArmor[0] = "Scout";
$InvArmor[1] = "Assault";
$InvArmor[2] = "Juggernaut";
$InvArmor[3] = "Berzerker";

Then change the $NameToInv directly below that to read:
$NameToInv["Scout"] = "Light";
$NameToInv["Assault"] = "Medium";
$NameToInv["Juggernaut"] = "Heavy";
$NameToInv["Berzerker"] = "Berzerker";

Step #4
In player.cs, find the Player::getArmorSize(%this) function. Change it to read the following:
function Player::getArmorSize(%this)
{
%dataBlock = %this.getDataBlock().getName();
if (getSubStr(%dataBlock, 0, 5) $= "Light")
return "Light";
else if (getSubStr(%dataBlock, 0, 6) $= "Medium")
return "Medium";
else if (getSubStr(%dataBlock, 0, 5) $= "Heavy")
return "Heavy";
else if (getSubStr(%dataBlock, 0, 8) $= "Berzerker")
return "Berzerker";
else
return "Unknown";
}