Custom Starting Weapon
Change the starting weapon on your map
Basic
Add a single starting weapon for everybody
- Open your map's GSC file in
usermaps/scripts/zm - In your
main()function, add:
level.start_weapon = (getWeapon("GUN_NAME"));
- Replace
GUN_NAMEwith the internal name for the weapon
Scripted
Add a scripted event to decide the starting weapon
- If you haven't already, copy
zm_usermap.gscfromCall of Duty Black Ops III/share/raw/scripts/zm - In your maps folder in usermaps, paste
zm_usermap.gscintoscripts/zm
Randomized from list
- Inside the
main()function underload::main();in the pastedzm_usermap.gsc, add:
level.start_weapons = [];
level.start_weapons[level.start_weapons.size] = "GUN_ONE";
level.start_weapons[level.start_weapons.size] = "GUN_TWO";
level.start_weapons[level.start_weapons.size] = "GUN_THREE";
- Find the
giveCustomLoadout()function and replace it with this:
function giveCustomLoadout( takeAllWeapons, alreadySpawned )
{
self GiveWeapon( level.weaponBaseMelee ); // Knife
if( !IsDefined( level.start_weapons ) || level.start_weapons.size == 0 )
{
self zm_utility::give_start_weapon( true ); // Fallback
return;
}
random_index = RandomInt( level.start_weapons.size );
start_wep_str = level.start_weapons[ random_index ];
start_wep = GetWeapon( start_wep_str );
self GiveWeapon( start_wep );
//self GiveMaxAmmo( start_wep ); // Full ammo
self SwitchToWeapon( start_wep ); // Auto-switch
}
Set Weapon Per Character
- Inside the
main()function underload::main();in the pastedzm_usermap.gsc, add:
level.start_weapons = [];
level.start_weapons[level.start_weapons.size] = "GUN_ONE";
level.start_weapons[level.start_weapons.size] = "GUN_TWO";
level.start_weapons[level.start_weapons.size] = "GUN_THREE";
- Find the
giveCustomLoadout()function and replace it with this:
function giveCustomLoadout( takeAllWeapons, alreadySpawned )
{
self GiveWeapon( level.weaponBaseMelee );
if( !IsDefined( level.start_weapons ) || level.start_weapons.size == 0 )
{
self zm_utility::give_start_weapon( true ); // Fallback
return;
}
start_wep_str = level.start_weapons[ random_index ];
start_wep = GetWeapon( self.characterIndex );
self GiveWeapon( start_wep );
//self GiveMaxAmmo( start_wep ); // Full ammo
self SwitchToWeapon( start_wep ); // Auto-switch
}