---------------------------------------------------------------------------------------------------------------
Spawning Favorites Tutorial
---------------------------------------------------------------------------------------------------------------
This tutorial will spawn a player with thier last selected Favorite armor and weapons. It has a check to make sure the chosen armor exists on the server (incase thier saved favorites are from another server), otherwise spawns in the defaults.
Step #1
// ------------------------------------------
// DefaultGame.cs
// ------------------------------------------
In function DefaultGame::playerSpawned, Replace this line:
%game.equip(%player);
with this:
%client = %player.client;
%size = $NameToInv[%client.favorites[0]];
if (%client.race $= "Bioderm")
%armor = %size @ "Male" @ %client.race @ Armor;
else
%armor = %size @ %client.sex @ %client.race @ Armor;
if (!(isObject(%armor)))
%game.equip(%player);
else
{
for(%i =0; %i<$InventoryHudCount; %i++)
%client.setInventoryHudItem($InventoryHudData[%i, itemDataName], 0, 1);
buyFavorites(%client);
if (%client.player.weaponCount > 0)
%player.selectWeaponSlot( 0 );
}
If you want to force people to spawn in a default armor, but base thier spawn weapons on thier favorites, replace
buyFavorites(%client) with buyDeployableFavorites(%client). To change the default armor to something other then
light, in player.cs find the line $defaultPlayerArmor = "Light"; and change it to what you want. To modify the
default weapons loaded, edit DefaultGame::equip in defaultGame.cs.