February 22, 2018, 09:02:01 PM

Author Topic: player models  (Read 6609 times)

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
player models
« on: May 21, 2014, 09:57:40 PM »
i have a problem with my player models not showing up in game,  when i go in to third-person in game all i see is the floor not ever the girl player models shows up. I have followed some tuts on how to fix them, still didn`t work after, then got some help from another mapper and he has sent me to here. any help would be great as i`v been trying to sort this out for awhile now.

Thanks in advance.
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #1 on: May 21, 2014, 10:32:03 PM »
These are the steps required too add a custom payer model, maybe you can see what you are missing.

1: convert the model into a xmodel
2: include the model in your map's fastfiles:

this is done by adding the following line to a .csv zone file.
Code: [Select]
xmodel,the_name_of_the_model
I suggest you add it in your mod.csv which is the mod builder tab of Launcher.

make sure you build the fastfile, you will only need to build the mod.ff here not your map since nothing needs updating in that fastfile.

3: the model must be precached.

to precache a model you add the following line of code into a gsc script.

Code: [Select]
precachemodel("the_name_of_the_model");
but what is important is the location you place this line, as it must be called before _load.gsc is called, otherwise it has no effect.

Typically this is done in "loadout.gsc" via character files located in "cod5/raw/character/" but it is not required.

4: adding the gsc

First go to 'raw/maps/' copy '_loadout.gsc' into your mods folder -> "cod_root/mods/map_name/maps/" then open the file in a text editor.

The precache line must be added in 'init_loadout()'
and the setting of the model can be placed in: 'give_model( class )' but is not mandatory.

For example:

Code: [Select]

init_loadout()
{
     precacheModel("the_name_of_the_model");

     // rest of code below .....
}

give_model( class )
{
     self setmodel( "the_name_of_the_model" );

     // rest of code below .....
}


save the file, go to launcher and make sure it's included in your IWD list, then build the IWD (adding the models iwi files to the IWD is also required for playing in none dev mode)

And obviously you must update "the_name_of_the_model" with the actual name of your model.

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #2 on: May 21, 2014, 11:13:26 PM »
These are the steps required too add a custom payer model, maybe you can see what you are missing.


thanks man. will start looking though them and let you know if it has fixed it
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #3 on: May 21, 2014, 11:19:12 PM »
These are the steps required too add a custom payer model, maybe you can see what you are missing.


thanks man. will start looking though them and let you know if it has fixed it

Quick question are you trying to get the stock 4 player models working?

or add a custom model?

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #4 on: May 21, 2014, 11:33:48 PM »

Quick question are you trying to get the stock 4 player models working?

or add a custom model?

the stock ones. they haven`t worked since installing mod tools
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #5 on: May 22, 2014, 12:00:04 AM »

Quick question are you trying to get the stock 4 player models working?

or add a custom model?

the stock ones. they haven`t worked since installing mod tools

Did you install the mod tool 1.4 assets?

What is the name of your .map file?

Open up root/zone_source/dlc3.csv and check it has:

Code: [Select]
mptype,nazi_zombie_heroes,,

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #6 on: May 22, 2014, 12:23:44 AM »

Did you install the mod tool 1.4 assets?

What is the name of your .map file?

Open up root/zone_source/dlc3.csv and check it has:

Code: [Select]
mptype,nazi_zombie_heroes,,


nazi_zombie_dead_escape.map

yh i did the otherday when nukem told me to make sure i had it

yh i have that line right at the top of the script
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #7 on: May 22, 2014, 12:37:08 AM »
can you post you maps.gsc and _loadout.gsc

please use code tags   :-*

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #8 on: May 22, 2014, 12:48:11 AM »
can you post you maps.gsc and _loadout.gsc

please use code tags   :-*

nazi_zombie_MAPNAME.gsc

Code: [Select]

// Utilities
#include common_scripts\utility;
#include maps\_utility;
#include maps\_zombiemode_utility;
#include maps\_zombiemode_zone_manager;
#include maps\_music;

// DLC3 Utilities
#include maps\dlc3_code;
#include maps\dlc3_teleporter;

main()
{
level.DLC3 = spawnStruct(); // Leave This Line Or Else It Breaks Everything

// Must Change These To Your Maps
level.DLC3.createArt = maps\createart\nazi_zombie_dead_escape_art::main;
level.DLC3.createFX = maps\createfx\nazi_zombie_dead_escape_fx::main;
// level.DLC3.myFX = ::preCacheMyFX;

//////////////////////////////////////////////////
    //Music Player .gsc
    //////////////////////////////////////////////////
    preCacheModel ("zombie_zapper_cagelight_green");
    game["tom_music_player"] = "tom_music_player";
    PrecacheMenu( game["tom_music_player"] );
    level thread maps\tom_music_player_unl::main();

/*--------------------
FX
----------------------*/
DLC3_FX();

/*--------------------
LEVEL VARIABLES
----------------------*/

// Variable Containing Helpful Text For Modders -- Don't Remove
level.modderHelpText = [];

//
// Change Or Tweak All Of These LEVEL.DLC3 Variables Below For Your Level If You Wish
//

// Edit The Value In Mod.STR For Your Level Introscreen Place
level.DLC3.introString = &"nazi zombie tes";

// Weapons. Pointer function automatically loads weapons used in Der Riese.
level.DLC3.weapons = maps\dlc3_code::include_weapons;

// Power Ups. Pointer function automatically loads power ups used in Der Riese.
level.DLC3.powerUps =  maps\dlc3_code::include_powerups;
             include_powerup( "gtlad" );

// Adjusts how much melee damage a player with the perk will do, needs only be set once. Stock is 1000.
level.DLC3.perk_altMeleeDamage = 1000;

// Adjusts barrier search override. Stock is 400.
level.DLC3.barrierSearchOverride = 400;

// Adjusts power up drop max per round. Stock is 3.
level.DLC3.powerUpDropMax = 5;

// _loadout Variables
level.DLC3.useCoopHeroes = true;

// Bridge Feature
level.DLC3.useBridge = false;

// Hell Hounds
level.DLC3.useHellHounds = true;

// Mixed Rounds
level.DLC3.useMixedRounds = true;

// Magic Boxes -- The Script_Noteworthy Value Names On Purchase Trigger In Radiant
boxArray = [];
boxArray[ boxArray.size ] = "start_chest";
boxArray[ boxArray.size ] = "chest1";
boxArray[ boxArray.size ] = "chest2";
boxArray[ boxArray.size ] = "chest3";
boxArray[ boxArray.size ] = "chest4";
boxArray[ boxArray.size ] = "chest5";
level.DLC3.PandoraBoxes = boxArray;

// Initial Zone(s) -- Zone(s) You Want Activated At Map Start
zones = [];
zones[ zones.size ] = "start_zone";
level.DLC3.initialZones = zones;

// Electricity Switch -- If False Map Will Start With Power On
level.DLC3.useElectricSwitch = true;

// Electric Traps
level.DLC3.useElectricTraps = true;

// _zombiemode_weapons Variables
level.DLC3.usePandoraBoxLight = true;
level.DLC3.useChestPulls = true;
level.DLC3.useChestMoves = true;
level.DLC3.useWeaponSpawn = true;
level.DLC3.useGiveWeapon = true;

// _zombiemode_spawner Varibles
level.DLC3.riserZombiesGoToDoorsFirst = true;
level.DLC3.riserZombiesInActiveZonesOnly = true;
level.DLC3.assureNodes = true;

// _zombiemode_perks Variables
level.DLC3.perksNeedPowerOn = true;

// _zombiemode_devgui Variables
level.DLC3.powerSwitch = true;

/*--------------------
FUNCTION CALLS - PRE _Load
----------------------*/
level thread DLC3_threadCalls();
//maps\_destructible_opel_blitz::init();
/*--------------------
ZOMBIE MODE
----------------------*/
[[level.DLC3.weapons]]();
[[level.DLC3.powerUps]]();
level.tom_victory = false;
  end_trig = getentarray( "end_game","targetname" );
    array_thread( end_trig,::end_game );
maps\_zombiemode::main();
thread zombiesleft_hud();

/*--------------------
FUNCTION CALLS - POST _Load
----------------------*/
level.zone_manager_init_func = ::dlc3_zone_init;
level thread DLC3_threadCalls2();
}

dlc3_zone_init()
{

add_adjacent_zone( "start_zone", "zone1", "enter_zone1" );
add_adjacent_zone( "zone1", "zone2", "enter_zone2" );
    add_adjacent_zone( "zone2", "zone3", "enter_zone3" );
add_adjacent_zone( "zone2", "zone4", "enter_zone4" );
add_adjacent_zone( "zone4", "zone5", "enter_zone5" );
}
/*
zombiesleft_hud()
{   
Remaining = create_simple_hud();
  Remaining.horzAlign = "center";
  Remaining.vertAlign = "middle";
    Remaining.alignX = "Left";
    Remaining.alignY = "middle";
    Remaining.y = 230;
    Remaining.x = 60;
    Remaining.foreground = 1;
    Remaining.fontscale = 8.0;
    Remaining.alpha = 1;
    Remaining.color = ( 0.423, 0.004, 0 );


    ZombiesLeft = create_simple_hud();
    ZombiesLeft.horzAlign = "center";
    ZombiesLeft.vertAlign = "middle";
    ZombiesLeft.alignX = "center";
    ZombiesLeft.alignY = "middle";
    ZombiesLeft.y = 230;
    ZombiesLeft.x = -1;
    ZombiesLeft.foreground = 1;
    ZombiesLeft.fontscale = 8.0;
    ZombiesLeft.alpha = 1;
    ZombiesLeft.color = ( 0.423, 0.004, 0 );
    ZombiesLeft SetText("Zombies Left: ");


while(1)
{
remainingZombies = get_enemy_count() + level.zombie_total;
Remaining SetValue(remainingZombies);

if(remainingZombies == 0 )
{
Remaining.alpha = 0;
while(1)
{
remainingZombies = get_enemy_count() + level.zombie_total;
if(remainingZombies != 0 )
{
Remaining.alpha = 1;
break;
}
wait 0.5;
}
}
wait 0.5;
}

}
*/

//dans end game
end_game()
{
    user = undefined;
    cost = 50000;                                        //change to cost that you want

    self setCursorHint("HINT_NOICON");
    self UseTriggerRequireLookAt();
    self setHintString("The power must be activated first");                //remove line if you want it to work without power

    flag_wait( "electricity_on" );                                //remove line if you want it to work without power

    self setHintString("press &&1 to Escape this hell hole [Cost: "+cost+"]");            //text hint trigger

    while(1)
    {
        self waittill("trigger", user);
        if( is_player_valid(user) && user.score >= cost )
        {
            play_sound_at_pos( "cha_ching", self.origin );
            user thread maps\_zombiemode_score::minus_to_player_score( cost );
            self delete();

            level notify( "end_game" );
                        level notify("tom_planes");
            level.tom_victory = true;
        }
        else
        {
            play_sound_at_pos( "no_cha_ching", self.origin );
        }
    }
}

zombiesleft_hud()
{   
Remaining = create_simple_hud();
  Remaining.horzAlign = "center";
  Remaining.vertAlign = "middle";
    Remaining.alignX = "Left";
    Remaining.alignY = "middle";
    Remaining.y = 230;
    Remaining.x = 60;
    Remaining.foreground = 1;
    Remaining.fontscale = 8.0;
    Remaining.alpha = 1;
    Remaining.color = ( 0.423, 0.004, 0 );


    ZombiesLeft = create_simple_hud();
    ZombiesLeft.horzAlign = "center";
    ZombiesLeft.vertAlign = "middle";
    ZombiesLeft.alignX = "center";
    ZombiesLeft.alignY = "middle";
    ZombiesLeft.y = 230;
    ZombiesLeft.x = -1;
    ZombiesLeft.foreground = 1;
    ZombiesLeft.fontscale = 8.0;
    ZombiesLeft.alpha = 1;
    ZombiesLeft.color = ( 0.423, 0.004, 0 );
    ZombiesLeft SetText("Fuckers Left: ");


while(1)
{
remainingZombies = get_enemy_count() + level.zombie_total;
Remaining SetValue(remainingZombies);

if(remainingZombies == 0 )
{
Remaining.alpha = 0;
while(1)
{
remainingZombies = get_enemy_count() + level.zombie_total;
if(remainingZombies != 0 )
{
Remaining.alpha = 1;
break;
}
wait 0.5;
}
}
wait 0.5;
}
}

cant post my _loadout.gsc says its over 20000 characters

_loadout.gsc

Code: [Select]
#include maps\_utility;

init_loadout()
{
// MikeD (7/30/2007): New method of precaching/giving weapons.
// Set the level variables.
if( !IsDefined( level.player_loadout ) )
{
level.player_loadout = [];
}

// CODER MOD
// With the player joining later now we need to precache all weapons for the level
init_models_and_variables_loadout();

players = get_players();
for ( i = 0; i < players.size; i++ )
{
players[i] give_loadout();
players[i].pers["class"] = "closequarters";
}
level.loadoutComplete = true;
level notify("loadout complete");


// these precaches should only happen per level and campaign

if (level.campaign == "russian")
{
if (level.script == "ber2")
{
mptype\player_rus_guard_wet::precache();
}
else if (level.script == "sniper")
{
// nothing!
}
else
{
mptype\player_rus_guard::precache();
}
}
else if (level.campaign == "american")
{
if (level.script == "pel1")
{
mptype\player_usa_marine::precache();
}
else if (level.script == "pel1a" || level.script == "pel2")
{
mptype\player_usa_marine::precache();
}
else if (level.script == "oki2")
{
mptype\player_usa_marine_wet::precache();
}
else if( level.script == "mak")
{
mptype\player_usa_raider::precache();
}
else if ( level.script == "pby_fly")
{
//nothing
}
else if( level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_asylum" || level.script == "nazi_zombie_factory" || level.script == "zombie_test_map" )
{

mptype\nazi_zombie_heroes::precache();

}
else
{
mptype\player_usa_marine::precache();
}
}
else
{
mptype\player_usa_marine::precache();
}
}

init_models_and_variables_loadout()
{
// SCRIPTER_MOD
// MikeD (3/16/2007): Testmap for Coop
if( level.script == "coop_test1" )
{
add_weapon( "m1garand" );
add_weapon( "thompson" );
add_weapon( "fraggrenade" );
set_switch_weapon( "m1garand" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( level.script == "mak" ) // MikeD
{
add_weapon( "nambu" );
set_switch_weapon( "nambu" );
set_laststand_pistol( "nambu" );

set_player_viewmodel( "viewmodel_usa_raider_arms" );
set_player_interactive_hands( "viewmodel_usa_raider_player" );

level.campaign = "american";
return;
}
else if( level.script == "pel1" ) // Jesse
{
add_weapon( "colt");
add_weapon( "m1garand_bayonet" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
add_weapon( "rocket_barrage" );
set_action_slot( 4, "weapon", "rocket_barrage" );
set_secondary_offhand( "smoke" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

// CODER MOD (Austin & Sumeet 11/3/07)
// Fix bugs #1056 & #1057 with co-op players having no weapon selected
set_switch_weapon( "m1garand_bayonet" );

level.campaign = "american";
return;
}
else if( level.script == "pel1a" ) // MikeD
{
add_weapon( "m1garand" );
PrecacheItem( "m2_flamethrower" );
//add_weapon( "m2_flamethrower" );
add_weapon( "thompson" );
//TFLAME - Bug about 3 weapons
//add_weapon( "colt" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );
// set_switch_weapon( "m2_flamethrower" );
set_switch_weapon( "m1garand" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "pel1b" )
{
// TODO add level-specific weapons
add_weapon( "shotgun" );
add_weapon( "30cal_bipod" );
//add_weapon( "colt");
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "30cal_bipod" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");

level.campaign = "american";
return;
}
else if (level.script == "pby_fly" ) // Gavin
{
//add_weapon( "pby_backgun" );
//add_weapon( "pby_frontgun" );
//add_weapon( "pby_rightgun" );
//add_weapon( "pby_leftgun" );
//set_action_slot( 1, "weapon", "pby_frontgun" );
//set_action_slot( 4, "weapon", "pby_rightgun" );
//set_action_slot( 2, "weapon", "pby_backgun" );
//set_action_slot( 3, "weapon", "pby_leftgun" );

set_laststand_pistol( "colt" ); // No revive while in the air!

set_player_viewmodel( "viewmodel_usa_pbycrew_arms");

level.campaign = "american";
return;
}
else if( level.script == "pel2" ) // DPG (7/9/2007): Peleliu 2
{
add_weapon( "colt" );

add_weapon( "bar" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );

set_switch_weapon( "bar" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "see1" ) // Alex Liu
{
add_weapon( "mosin_rifle" );
add_weapon( "tokarev" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "see2" ) // DPG (7/9/2007): Seelow 2
{
//add_weapon( "mosin_rifle" );
add_weapon( "m2_flamethrower" );
add_weapon( "ppsh" );
add_weapon( "stick_grenade" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "m2_flamethrower" );

set_laststand_pistol( "none" ); // Players are in a tank

// SRS 6/24/2008: don't need visible viewarms because you're in a tank

level.campaign = "russian";
return;
}
else if( level.script == "ber1" ) // Bloodlust (7/06/2007): Berlin 1
{
add_weapon( "tokarev" );
add_weapon( "mosin_rifle" );
add_weapon( "stick_grenade" );
//add_weapon( "m8_white_smoke" );
add_weapon( "molotov" );
set_secondary_offhand( "molotov" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "ber1_geo" ) // Bloodlust (10/22/2007): Berlin 1 Geo (for Brandon)
{
add_weapon( "mosin_rifle" );
add_weapon( "ppsh" );
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "mosin_rifle" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "ber2" ) // SS
{
add_weapon( "ppsh" );
add_weapon( "tokarev" );
//add_weapon( "mosin_rifle" );  // SRS 5/9/2008: need to pick either the rifle or the SMG to start
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "ppsh" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "sniper" ) // TFlame 2/12/08 - only weapon player should have is a scoped rifle
{
add_weapon( "mosin_rifle_scoped" );
add_weapon( "stick_grenade" );
set_switch_weapon("mosin_rifle_scoped");

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");
set_player_interactive_hands( "viewmodel_rus_guard_player" );

level.campaign = "russian";
return;
}
else if( level.script == "ber3" ) // Joyal
{
add_weapon( "svt40" );
add_weapon( "ppsh" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "ppsh" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel("viewmodel_rus_guard_arms");
level.campaign = "russian";
return;
}
else if( level.script == "ber3b" ) // SS
{
add_weapon( "tokarev" );
add_weapon( "svt40" );
// CODER_MOD: Austin (7/31/08): added stick grenade for russian campaign to replace smoke (BUG 17665)
add_weapon( "stick_grenade" );
add_weapon( "molotov" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "svt40" );

set_laststand_pistol( "tokarev" );

set_player_viewmodel( "viewmodel_rus_guard_arms");

level.campaign = "russian";
return;
}
else if( level.script == "oki2" ) // JeremyS
{
add_weapon( "30cal_wet" );
//add_weapon( "m2_flamethrower_wet" );
PrecacheItem( "m2_flamethrower_wet" );
add_weapon( "thompson_wet" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
//add_weapon( "satchel_charge" );
set_secondary_offhand( "smoke" );
// set_switch_weapon( "m2_flamethrower_wet" );
set_switch_weapon( "thompson_wet" );


set_laststand_pistol( "colt_wet" );

set_player_viewmodel( "viewmodel_usa_marinewet_rolledup_arms");
set_player_interactive_hands( "viewmodel_usa_marinewet_rolledup_player" ); // Uncomment this if you want "interactive" hands for Banzai

level.campaign = "american";
return;
}
else if( level.script == "prologue" ) // Lucas (03/14/2008)
{
add_weapon( "m1garand" );
add_weapon( "colt" );
set_switch_weapon( "colt" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( level.script == "oki3" ) // ChrisP
{
add_weapon( "m1garand" );
add_weapon( "thompson" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
add_weapon("air_support");
set_action_slot( 4, "weapon", "air_support" );
set_secondary_offhand( "smoke" );
set_switch_weapon( "m1garand" );
set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player" );

level.campaign = "american";
return;
}
else if( level.script == "living_battlefield" )
{
add_weapon( "m1garand_bayonet" );
add_weapon( "thompson" );
add_weapon( "molotov" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
add_weapon( "fraggrenade" );
set_secondary_offhand( "flash" );
set_switch_weapon( "m1garand_bayonet" );

set_laststand_pistol( "colt" );

set_player_viewmodel( "viewmodel_usa_marine_arms");

level.campaign = "american";
return;
}
else if( GetDvar( "zombiemode" ) == "1" || IsSubStr( level.script, "nazi_zombie_" ) || level.script == "nazi_zombie_dead_escape" )

{
add_weapon( "tom_axe" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_switch_weapon( "tom_axe" );

set_laststand_pistol( "ray_gun" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");

level.campaign = "american";
return;
}
else if( IsSubStr( level.script, "intro_" ) ) // Support for the intro movies for the campaigns
{
return;
}
else if( level.script == "credits" )
{
set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");
level.campaign = "american";
return;
}


//------------------------------------
// level.script is not a single player level. give default weapons.
println ("loadout.gsc:     No level listing in _loadout.gsc, giving default guns!!!! =======================");

// default weapons
add_weapon( "colt" );
add_weapon( "m1garand" );
add_weapon( "fraggrenade" );
add_weapon( "m8_white_smoke" );
set_secondary_offhand( "smoke" );

set_laststand_pistol( "colt" );
set_switch_weapon( "m1garand" );

// SRS 6/29/2008: updated to allow defaulted maps to have different level.campaign default viewarms
if( IsDefined( level.campaign ) && level.campaign == "russian" )
{
set_player_viewmodel( "viewmodel_rus_guard_arms");
}
else
{
set_player_viewmodel( "viewmodel_usa_marine_arms");
level.campaign = "american";
}
}

// This will precache and set the loadout rather than duplicating work.
add_weapon( weapon_name )
{
PrecacheItem( weapon_name );
level.player_loadout[level.player_loadout.size] = weapon_name;
}

// This sets the secondary offhand type when the player spawns in
set_secondary_offhand( weapon_name )
{
level.player_secondaryoffhand = weapon_name;
}

// This sets the the switchtoweapon when the player spawns in
set_switch_weapon( weapon_name )
{
level.player_switchweapon = weapon_name;
}

// This sets the the action slot for when the player spawns in
set_action_slot( num, option1, option2 )
{

if( num < 2 || num > 4)
{
if(level.script != "pby_fly")  // GLocke 11/15/2007 - The flying level uses all 4 dpad slots
{
// Not using 1, since it's defaulted to grenade launcher.
assertmsg( "_loadout.gsc: set_action_slot must be set with a number greater than 1 and less than 5" );
}
}

// Glocke 12/03/07 - added precaching of weapon type for action slot
if(IsDefined(option1))
{
if(option1 == "weapon")
{
PrecacheItem(option2);
level.player_loadout[level.player_loadout.size] = option2;
}
}

if( !IsDefined( level.player_actionslots ) )
{
level.player_actionslots = [];
}

action_slot = SpawnStruct();
action_slot.num = num;
action_slot.option1 = option1;

if( IsDefined( option2 ) )
{
action_slot.option2 = option2;
}

level.player_actionslots[level.player_actionslots.size] = action_slot;
}

// Sets the player's viewmodel
set_player_viewmodel( viewmodel )
{
PrecacheModel( viewmodel );
level.player_viewmodel = viewmodel;
}

// Sets the player's handmodel used for "interactive" hands and banzai attacks
set_player_interactive_hands( model )
{
level.player_interactive_hands = model;
PrecacheModel( level.player_interactive_hands );
}

// Sets the player's laststand pistol
set_laststand_pistol( weapon )
{
level.laststandpistol = weapon;
}

give_loadout(wait_for_switch_weapon)
{
if( !IsDefined( game["gaveweapons"] ) )
{
game["gaveweapons"] = 0;
}

if( !IsDefined( game["expectedlevel"] ) )
{
game["expectedlevel"] = "";
}

if( game["expectedlevel"] != level.script )
{
game["gaveweapons"] = 0;
}

if( game["gaveweapons"] == 0 )
{
game["gaveweapons"] = 1;
}

// MikeD (4/18/2008): In order to be able to throw a grenade back, the player first needs to at
// least have a grenade in his inventory before doing so. So let's try to find out and give it to him
// then take it away.
gave_grenade = false;

// First check to see if we are giving him a grenade, if so, skip this process.
for( i = 0; i < level.player_loadout.size; i++ )
{
if( WeaponType( level.player_loadout[i] ) == "grenade" )
{
gave_grenade = true;
break;
}
}

// If we do not have a grenade then try to automatically assign one
// If we can't automatically do this, then the scripter needs to do by hand in the level
if( !gave_grenade )
{
if( IsDefined( level.player_grenade ) )
{
grenade = level.player_grenade;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
gave_grenade = true;
}

if( !gave_grenade )
{
// Get all of the AI and assign any grenade to the player
ai = GetAiArray( "allies" );

if( IsDefined( ai ) )
{
for( i = 0; i < ai.size; i++ )
{
if( IsDefined( ai[i].grenadeWeapon ) )
{
grenade = ai[i].grenadeWeapon;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
break;
}
}
}

println( "^3LOADOUT ISSUE: Unable to give a grenade, the player need to be given a grenade and then take it away in order for the player to throw back grenades, but not have any grenades in his inventory." );
}
}

for( i = 0; i < level.player_loadout.size; i++ )
{
self GiveWeapon( level.player_loadout[i] );
}

self SetActionSlot( 1, "" );
self SetActionSlot( 2, "" );
self SetActionSlot( 3, "altMode" ); // toggles between attached grenade launcher
self SetActionSlot( 4, "" );

if( IsDefined( level.player_actionslots ) )
{
for( i = 0; i < level.player_actionslots.size; i++ )
{
num = level.player_actionslots[i].num;
option1 = level.player_actionslots[i].option1;

if( IsDefined( level.player_actionslots[i].option2 ) )
{
option2 = level.player_actionslots[i].option2;
self SetActionSlot( num, option1, option2 );
}
else
{
self SetActionSlot( num, option1 );
}
}
}

if( IsDefined( level.player_switchweapon ) )
{
// the wait was added to fix a revive issue with the host
// for some reson the SwitchToWeapon message gets lost
// this can be removed if that is ever resolved
if ( isdefined(wait_for_switch_weapon) && wait_for_switch_weapon == true )
{
wait(0.5);
}
self SwitchToWeapon( level.player_switchweapon );
}

wait(0.5);

self player_flag_set("loadout_given");
}

give_model( class )
{
// switch ( level.campaign )
// {
// case "russian":
// self mptype\player_rus_guard::main();
// break;
// case "american":
// default:
// self mptype\player_usa_marine::main();
// break;

if (level.campaign == "russian")
{
if (level.script == "ber2")
{
self mptype\player_rus_guard_wet::main();
}
else if (level.script == "sniper")
{
// nothing!
}
else
{
self mptype\player_rus_guard::main();
}
}
else if (level.campaign == "american")
{
if (level.script == "pel1")
{
self mptype\player_usa_marine::main();
}
else if (level.script == "pel1a" || level.script == "pel2")
{
self mptype\player_usa_marine::main();
}
else if (level.script == "oki2")
{
self mptype\player_usa_marine_wet::main();
}
else if (level.script == "mak")
{
self mptype\player_usa_raider::main();
}
else if ( level.script == "pby_fly")
{
//nothing
}
else if( level.script == "nazi_zombie_sumpf" || level.script == "nazi_zombie_asylum" || level.script == "nazi_zombie_factory" || level.script == "nazi_zombie_dead_escape" ) //player model
{

switch( self.entity_num)
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}

}
else
{
self mptype\player_usa_marine::main();
}
}
else
{
self mptype\player_usa_marine::main();
}







// }

// MikeD (3/28/2008): If specified, give the player his hands
if( IsDefined( level.player_viewmodel ) )
{
self SetViewModel( level.player_viewmodel );
}
}

///////////////////////////////////////////////
// SavePlayerWeaponStatePersistent
//
// Saves the player's weapons and ammo state persistently( in the game variable )
// so that it can be restored in a different map.
// You can use strings for the slot:
//
// SavePlayerWeaponStatePersistent( "russianCampaign" );
//
// Or you can just use numbers:
//
// SavePlayerWeaponStatePersistent( 0 );
// SavePlayerWeaponStatePersistent( 1 ); etc.
//
// In a different map, you can restore using RestorePlayerWeaponStatePersistent( slot );
// Make sure that you always persist the data between map changes.

SavePlayerWeaponStatePersistent( slot )
{
current = level.player getCurrentWeapon();
if ( ( !isdefined( current ) ) || ( current == "none" ) )
assertmsg( "Player's current weapon is 'none' or undefined. Make sure 'disableWeapons()' has not been called on the player when trying to save weapon states." );
game[ "weaponstates" ][ slot ][ "current" ] = current;

offhand = level.player getcurrentoffhand();
game[ "weaponstates" ][ slot ][ "offhand" ] = offhand;

game[ "weaponstates" ][ slot ][ "list" ] = [];
weapList = level.player GetWeaponsList();
for ( weapIdx = 0; weapIdx < weapList.size; weapIdx++ )
{
game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ] = weapList[ weapIdx ];

// below is only used if we want to NOT give max ammo
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] = level.player GetWeaponAmmoClip( weapList[ weapIdx ] );
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] = level.player GetWeaponAmmoStock( weapList[ weapIdx ] );
}
}

RestorePlayerWeaponStatePersistent( slot )
{
if ( !isDefined( game[ "weaponstates" ] ) )
return false;
if ( !isDefined( game[ "weaponstates" ][ slot ] ) )
return false;

level.player takeallweapons();

for ( weapIdx = 0; weapIdx < game[ "weaponstates" ][ slot ][ "list" ].size; weapIdx++ )
{
weapName = game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ];

if ( isdefined( level.legit_weapons ) )
{
// weapon doesn't exist in this level
if ( !isdefined( level.legit_weapons[ weapName ] ) )
continue;
}

// don't carry over C4 or claymores
if ( weapName == "c4" )
continue;
if ( weapName == "claymore" )
continue;
level.player GiveWeapon( weapName );
level.player GiveMaxAmmo( weapName );

// below is only used if we want to NOT give max ammo
// level.player SetWeaponAmmoClip( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] );
// level.player SetWeaponAmmoStock( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] );
}

if ( isdefined( level.legit_weapons ) )
{
weapname = game[ "weaponstates" ][ slot ][ "offhand" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player switchtooffhand( weapname );

weapname = game[ "weaponstates" ][ slot ][ "current" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player SwitchToWeapon( weapname );
}
else
{
level.player switchtooffhand( game[ "weaponstates" ][ slot ][ "offhand" ] );
level.player SwitchToWeapon( game[ "weaponstates" ][ slot ][ "current" ] );
}

return true;
}
« Last Edit: May 22, 2014, 01:04:11 AM by FATKIDSLOV3CAK3 »
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #9 on: May 22, 2014, 01:01:30 AM »
cant post my _loadout.gsc says its over 20000 characters

I've make the limit 40k , just edit post and add it  :)

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #10 on: May 22, 2014, 01:04:59 AM »
I've make the limit 40k , just edit post and add it  :)

done now for you man
« Last Edit: May 22, 2014, 01:20:09 AM by WinCat »
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #11 on: May 22, 2014, 01:22:34 AM »
Replace the contents of your _loadout.gsc with this:

Code: [Select]
#include maps\_utility;

init_loadout()
{
mptype\nazi_zombie_heroes::precache();
}

init_models_and_variables_loadout()
{
add_weapon( "tom_axe" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_switch_weapon( "tom_axe" );

set_laststand_pistol( "ray_gun" );

set_player_viewmodel( "viewmodel_usa_marine_arms");
set_player_interactive_hands( "viewmodel_usa_marine_player");

level.campaign = "american";
return;

}

// This will precache and set the loadout rather than duplicating work.
add_weapon( weapon_name )
{
PrecacheItem( weapon_name );
level.player_loadout[level.player_loadout.size] = weapon_name;
}

// This sets the secondary offhand type when the player spawns in
set_secondary_offhand( weapon_name )
{
level.player_secondaryoffhand = weapon_name;
}

// This sets the the switchtoweapon when the player spawns in
set_switch_weapon( weapon_name )
{
level.player_switchweapon = weapon_name;
}

// This sets the the action slot for when the player spawns in
set_action_slot( num, option1, option2 )
{

if( num < 2 || num > 4)
{
if(level.script != "pby_fly")  // GLocke 11/15/2007 - The flying level uses all 4 dpad slots
{
// Not using 1, since it's defaulted to grenade launcher.
assertmsg( "_loadout.gsc: set_action_slot must be set with a number greater than 1 and less than 5" );
}
}

// Glocke 12/03/07 - added precaching of weapon type for action slot
if(IsDefined(option1))
{
if(option1 == "weapon")
{
PrecacheItem(option2);
level.player_loadout[level.player_loadout.size] = option2;
}
}

if( !IsDefined( level.player_actionslots ) )
{
level.player_actionslots = [];
}

action_slot = SpawnStruct();
action_slot.num = num;
action_slot.option1 = option1;

if( IsDefined( option2 ) )
{
action_slot.option2 = option2;
}

level.player_actionslots[level.player_actionslots.size] = action_slot;
}

// Sets the player's viewmodel
set_player_viewmodel( viewmodel )
{
PrecacheModel( viewmodel );
level.player_viewmodel = viewmodel;
}

// Sets the player's handmodel used for "interactive" hands and banzai attacks
set_player_interactive_hands( model )
{
level.player_interactive_hands = model;
PrecacheModel( level.player_interactive_hands );
}

// Sets the player's laststand pistol
set_laststand_pistol( weapon )
{
level.laststandpistol = weapon;
}

give_loadout(wait_for_switch_weapon)
{
if( !IsDefined( game["gaveweapons"] ) )
{
game["gaveweapons"] = 0;
}

if( !IsDefined( game["expectedlevel"] ) )
{
game["expectedlevel"] = "";
}

if( game["expectedlevel"] != level.script )
{
game["gaveweapons"] = 0;
}

if( game["gaveweapons"] == 0 )
{
game["gaveweapons"] = 1;
}

// MikeD (4/18/2008): In order to be able to throw a grenade back, the player first needs to at
// least have a grenade in his inventory before doing so. So let's try to find out and give it to him
// then take it away.
gave_grenade = false;

// First check to see if we are giving him a grenade, if so, skip this process.
for( i = 0; i < level.player_loadout.size; i++ )
{
if( WeaponType( level.player_loadout[i] ) == "grenade" )
{
gave_grenade = true;
break;
}
}

// If we do not have a grenade then try to automatically assign one
// If we can't automatically do this, then the scripter needs to do by hand in the level
if( !gave_grenade )
{
if( IsDefined( level.player_grenade ) )
{
grenade = level.player_grenade;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
gave_grenade = true;
}

if( !gave_grenade )
{
// Get all of the AI and assign any grenade to the player
ai = GetAiArray( "allies" );

if( IsDefined( ai ) )
{
for( i = 0; i < ai.size; i++ )
{
if( IsDefined( ai[i].grenadeWeapon ) )
{
grenade = ai[i].grenadeWeapon;
self GiveWeapon( grenade );
self SetWeaponAmmoStock( grenade, 0 );
break;
}
}
}

println( "^3LOADOUT ISSUE: Unable to give a grenade, the player need to be given a grenade and then take it away in order for the player to throw back grenades, but not have any grenades in his inventory." );
}
}

for( i = 0; i < level.player_loadout.size; i++ )
{
self GiveWeapon( level.player_loadout[i] );
}

self SetActionSlot( 1, "" );
self SetActionSlot( 2, "" );
self SetActionSlot( 3, "altMode" ); // toggles between attached grenade launcher
self SetActionSlot( 4, "" );

if( IsDefined( level.player_actionslots ) )
{
for( i = 0; i < level.player_actionslots.size; i++ )
{
num = level.player_actionslots[i].num;
option1 = level.player_actionslots[i].option1;

if( IsDefined( level.player_actionslots[i].option2 ) )
{
option2 = level.player_actionslots[i].option2;
self SetActionSlot( num, option1, option2 );
}
else
{
self SetActionSlot( num, option1 );
}
}
}

if( IsDefined( level.player_switchweapon ) )
{
// the wait was added to fix a revive issue with the host
// for some reson the SwitchToWeapon message gets lost
// this can be removed if that is ever resolved
if ( isdefined(wait_for_switch_weapon) && wait_for_switch_weapon == true )
{
wait(0.5);
}
self SwitchToWeapon( level.player_switchweapon );
}

wait(0.5);

self player_flag_set("loadout_given");
}

give_model( class )
{
switch( self.entity_num)
{
case 0:
character\char_zomb_player_0::main();
break;
case 1:
character\char_zomb_player_1::main();
break;
case 2:
character\char_zomb_player_2::main();
break;
case 3:
character\char_zomb_player_3::main();
break;
}

if( IsDefined( level.player_viewmodel ) )
{
self SetViewModel( level.player_viewmodel );
}
}

SavePlayerWeaponStatePersistent( slot )
{
current = level.player getCurrentWeapon();
if ( ( !isdefined( current ) ) || ( current == "none" ) )
assertmsg( "Player's current weapon is 'none' or undefined. Make sure 'disableWeapons()' has not been called on the player when trying to save weapon states." );
game[ "weaponstates" ][ slot ][ "current" ] = current;

offhand = level.player getcurrentoffhand();
game[ "weaponstates" ][ slot ][ "offhand" ] = offhand;

game[ "weaponstates" ][ slot ][ "list" ] = [];
weapList = level.player GetWeaponsList();
for ( weapIdx = 0; weapIdx < weapList.size; weapIdx++ )
{
game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ] = weapList[ weapIdx ];

// below is only used if we want to NOT give max ammo
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] = level.player GetWeaponAmmoClip( weapList[ weapIdx ] );
// game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] = level.player GetWeaponAmmoStock( weapList[ weapIdx ] );
}
}

RestorePlayerWeaponStatePersistent( slot )
{
if ( !isDefined( game[ "weaponstates" ] ) )
return false;
if ( !isDefined( game[ "weaponstates" ][ slot ] ) )
return false;

level.player takeallweapons();

for ( weapIdx = 0; weapIdx < game[ "weaponstates" ][ slot ][ "list" ].size; weapIdx++ )
{
weapName = game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "name" ];

if ( isdefined( level.legit_weapons ) )
{
// weapon doesn't exist in this level
if ( !isdefined( level.legit_weapons[ weapName ] ) )
continue;
}

// don't carry over C4 or claymores
if ( weapName == "c4" )
continue;
if ( weapName == "claymore" )
continue;
level.player GiveWeapon( weapName );
level.player GiveMaxAmmo( weapName );

// below is only used if we want to NOT give max ammo
// level.player SetWeaponAmmoClip( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "clip" ] );
// level.player SetWeaponAmmoStock( weapName, game[ "weaponstates" ][ slot ][ "list" ][ weapIdx ][ "stock" ] );
}

if ( isdefined( level.legit_weapons ) )
{
weapname = game[ "weaponstates" ][ slot ][ "offhand" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player switchtooffhand( weapname );

weapname = game[ "weaponstates" ][ slot ][ "current" ];
if ( isdefined( level.legit_weapons[ weapName ] ) )
level.player SwitchToWeapon( weapname );
}
else
{
level.player switchtooffhand( game[ "weaponstates" ][ slot ][ "offhand" ] );
level.player SwitchToWeapon( game[ "weaponstates" ][ slot ][ "current" ] );
}

return true;
}

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #12 on: May 22, 2014, 01:31:40 AM »
Replace the contents of your _loadout.gsc with this:

right got player models now thank you :-* but have no viewhands  :(
EVERYBODY LOVES CAKE :P

WinCat

  • Founder
  • ***
  • Posts: 1094
  • Karma: 86
    • View Profile
    • My Site
Re: player models
« Reply #13 on: May 22, 2014, 01:37:48 AM »
My bad I removed one to many lines  :-X
just update the code below, it's from the top of the _loadout.gsc

Old:
Code: [Select]
init_loadout()
{
mptype\nazi_zombie_heroes::precache();

}

New:
Code: [Select]
init_loadout()
{
mptype\nazi_zombie_heroes::precache();
init_models_and_variables_loadout();
}

FATKIDSLOV3CAK3

  • Recently Bitten
  • **
  • Posts: 16
  • Karma: 0
    • View Profile
    • TWITCH
Re: player models
« Reply #14 on: May 22, 2014, 01:44:30 AM »
My bad I removed one to many lines  :-X
just update the code below, it's from the top of the _loadout.gsc

yay it works great now man thanks alot for all the help :D
EVERYBODY LOVES CAKE :P