Armors with more than 5 weapons?
I tried to create an armor with 6 weapons and it can be selected in the inv hud, but when you choose it as the armor type, it doesn't show anything other than armor type, yet every other armor I added with 5 or less weapons work just fine. How do mods make these armors with 6 and even 7 weapons?
Comments
Hud modifications.
Anyway, the game only allows you to call 6 weapons in your inventory without scripts or next/prev weapon buttons in the first place, and I think I remember doing 6 without problems by just changing the maxWeapons count or whatever it is. Is your game resolution set low? I'm not sure if the HUD changes in size based on resolution and would therefore be cutting it off...
Buuut thats not what I'm I'm talking about either...look at this pic, that menu.
And the code I have written in for the datablock for this armor in Player.cs is:
[tt]
maxWeapons = 6; // Max number of different weapons the player can have
maxGrenades = 1; // Max number of different grenades the player can have
maxMines = 1; // Max number of different mines the player can have[/tt]
So...any suggestions now? As a side note, this is the only armor I am having trouble with, and I'm guessing it's because its the only one I defined as having more than 5 weapons.
How to Add Armors
Thanks to Founder for the tutorial
What It Is
This tutorial will take you through the entire process of creating an armor, a medium-sized armor affectionatly known as "Bingo".
Step #1
First, we want to make a new damage profile for our Bingo 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 BingoPlayerDamageProfile.
Step #2
Open player.cs. Scroll down the file untill you find the datablock called: datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile First off, select this entire datablock, it's pretty long so you will have to scroll down quite a bit. Copy this and then paste it in another location within the file. Change the name of your new datablock from MediumMaleHumanArmor to BingoMaleHumanArmor.
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, BingoPlayerDamageProfile.
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 BingoFemaleHumanArmor and BingoMaleBiodermArmor, respectivly. Also change their parent datablock from MediumMaleHumanArmor to BingoMaleHumanArmor.
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] = "Bingo Man";
$InvArmor[2] = "Assault";
$InvArmor[3] = "Juggernaut";
Then change the $NameToInv directly below that to read:
$NameToInv["Scout"] = "Light";
$NameToInv["Bingo Man"] = "Bingo";
$NameToInv["Assault"] = "Medium";
$NameToInv["Juggernaut"] = "Heavy";
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, 5) $= "Bingo")
return "Bingo";
else
return "Unknown";
}
Tips
Try changing the values in the damage profile to increase or decrease your armors damage from different things.
Change the max[] values in the BingoMaleHumanArmor datablock to change your armor's carrying capacities.
Change the maxDamage value in the datablock to change his total health.
Adjust the jetpack and related settings to change his speed, air resistance and jetback use.
send me your scripts folder, would be glad to take a look and fix it...
jackhemphill66@aol.com
The armor name can be different than the datablock name. some guys just rename and use the base armor datablocks.
$NameToInv["Titan"] = "Light";
You had it
$NameToInv["Titan"] = "Ttain";
should be
$NameToInv["Titan"] = "Titan";