
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
Login Issues
Forgot password?Activate Issues
Account activation email not received? Wrong account activation email used?Other Problems?
Contact Support - Help Center Get help on the UGX Discord. Join it now!![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
The viewhands are set in _loadout.gsc. Just look for "zombiemode".
- Phil.
#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()
{
add_weapon( "zombie_colt" );
PrecacheItem( "napalmblob" );
PrecacheItem( "napalmbloblight" );
set_switch_weapon( "zombie_colt" );
set_laststand_pistol( "zombie_colt" );
set_player_viewmodel( "viewmodel_rus_guard_padded_arms");
set_player_interactive_hands( "viewmodel_rus_guard_padded_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 == "zombie_test_map" )
{
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;
}
The script looks ok. Have you included the xmodel in your map's CSV file?
- Phil.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
// Zombie Mode Stuff
include,zombiemode
include,zombiemode_dogs
// Zombie Mode Strings
localize,zombie
// Mod Strings
localize,mod
// Edited Loadout For Zombie Heroes
rawfile,maps\_loadout.gsc
// Edited LastStand For Deep Water Like Sumpf
rawfile,maps\_laststand.gsc
// Edited For Developer_Script
rawfile,maps\_debug.gsc
// Updated Menu File For Pause Screen Map
menufile,ui/objective_info.menu
stringtable,maps/mapsTable.csv
material,vending_phd_shader
material,vending_staminup_shader
material,vending_deadshot_shader
material,vending_mule_kick_shader
//fx,env/fire/fx_fire_brush_smolder_sm
//fx,env/fire/fx_fire_detail_fade_14
//fx,env/fire/fx_fire_blown_md_blk_smk_distant_w
//fx,env/fire/fx_fire_oil_md
//fx,env/fire/fx_fire_campfire_small
//fx,env/fire/fx_fire_player_torso
//fx,env/light/fx_glow_hanginglamp
//fx,env/light/fx_glow_emergency_red_blink
//fx,env/electrical/fx_elec_player_md
//fx,maps/zombie/fx_zombie_wire_spark
//fx,env/smoke/fx_smoke_smolder_sm_blk
//fx,env/smoke/fx_smoke_smolder_md_gry
//fx,env/smoke/fx_smoke_smolder_lg_gry
//fx,env/smoke/fx_smoke_wood_chimney_med
//fx,explosions/fx_default_explosion
//fx,explosions/tank_impact_dirt
xmodel,viewmodel_rus_guard_padded_arms
xmodel,viewmodel_rus_guard_padded_player
![]() | |
![]() | |
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
I don't know if I added the models correctly.
![]() | Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum. |
![]() | |
![]() | |
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
Stupid me... I was editing the wrong _loadout.gsc I had to comment and uncomment the viewhand lines in the one in the ugx_guns.iwd
Thanks for the help guys
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
![]() | Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager. |
set_player_viewmodel( "viewmodel_usa_marine_rolledup_arms");
set_player_interactive_hands( "viewmodel_usa_marine_rolledup_player");
![]() | |
![]() | |
![]() | Has the ability to issue warnings to users, edit and remove posts from the forum and to move topics to other boards. Upholds the rules of the forum. Moderates Chat Rooms. |
You can't use certain hands with CoD4 models. Try different ones. You will have the highest success rate with CoD4 hands.