UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Changing Viewhands. Help Please.

HOT
broken avatar :(
Created 12 years ago
by lpsssmdlj
0 Members and 1 Guest are viewing this topic.
9,977 views
broken avatar :(
×
broken avatar :(
Location: usConnecticut
Date Registered: 24 February 2013
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Signature
Maps In Progress:

25%
×
lpsssmdlj's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
lpsssmdlj's Contact & Social LinkslpsssmdljAfterTheFallKnitdly
I've been searching all over the internet for a few days and I haven't been able to find a decent tutorial on how to change your character's viewhands in game. I've searched both this site and zombiemodding but still haven't found anything. Most of the topics I find are about people having a problem with this but then they simply post: "I fixed it" and then close the topic with no explanation on how they did it. I'm using the UGX Mod for my zombies map and I want to change the default marine hand to a model that has gloves on it or something similar to that. If anyone could help me out with the scripting and whatnot then that would be awesome.  :)
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 5 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
The viewhands are set in _loadout.gsc. Just look for "zombiemode".

- Phil.
broken avatar :(
×
broken avatar :(
Location: usConnecticut
Date Registered: 24 February 2013
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
lpsssmdlj's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
lpsssmdlj's Contact & Social LinkslpsssmdljAfterTheFallKnitdly
The viewhands are set in _loadout.gsc. Just look for "zombiemode".

- Phil.

Thanks for responding.

I've edited the viewmodel lines under the zombiemode section in the _loadout.gsc but after building the mods and using the project mover to move the files, the new hands still don't show up in game. Its as if I've never changed them.

I'm a noob when it comes to scripting and changing stuff in the gsc and csv files. I honestly have no idea what I'm doing at times so I really appreciate the help :)

Here's my _loadout.gsc

Code Snippet
Plaintext
#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;
}
Last Edit: April 14, 2013, 02:59:44 am by lpsssmdlj
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 5 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
The script looks ok. Have you included the xmodel in your map's CSV file?

- Phil.
broken avatar :(
×
broken avatar :(
Location: auMelbourne
Date Registered: 6 August 2012
Last active: 8 years ago
Posts
125
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
TMG Modeller and Animator
Signature
Current W.I.P Map
nazi_zombie_ash (the name may change)
Map Progress:
65%

Need help with guns, sounds or models send me a PM
×
P0rkRoyalz's Groups
P0rkRoyalz's Contact & Social LinksP0rkRoyalza13xm33P0rkRoyalz
The script looks ok. Have you included the xmodel in your map's CSV file?

- Phil.
like Phil said make sure you included them in the mod.csv, past experiences  :gusta:
broken avatar :(
×
broken avatar :(
Location: usConnecticut
Date Registered: 24 February 2013
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
lpsssmdlj's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
lpsssmdlj's Contact & Social LinkslpsssmdljAfterTheFallKnitdly
That may be my problem, trying it now.

[Edit]

I tried adding it to the csv and I still have the same viewmodel in game. Here's my mod.csv
I don't know if I added the models correctly.

Code Snippet
Plaintext
// 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
Last Edit: April 14, 2013, 03:42:33 pm by lpsssmdlj
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,655Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
Signature
If Java had true garbage collection, most programs would delete themselves upon execution.
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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.
It's an irrelevant question, because if you had set the viewhands correctly in code you would either

a) have invisible hands because you didn't include the hands properly in csv and did not precache them in script
or
b) would see your new hands and have it be finished.

But since you still see your old hands, then nothing has changed and you need to revisit your loadout.gsc
broken avatar :(
×
broken avatar :(
Location: usConnecticut
Date Registered: 24 February 2013
Last active: 5 years ago
Posts
10
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
×
lpsssmdlj's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
lpsssmdlj's Contact & Social LinkslpsssmdljAfterTheFallKnitdly
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  :lol:
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,655Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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  :lol:
no problem  :gusta:
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 17 February 2013
Last active: 9 years ago
Posts
107
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
Signature
MAPS:
Dale's Dock
Compound
Dale's Dig

×
trebeltom1's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
trebeltom1's Contact & Social LinksWaffle Fries
sorry for scraping in, but where are the viewhands for each player in zombies specified... can't find them in the loadout or the char_zomb_player csv or gsc
broken avatar :(
×
broken avatar :(
Location: de
Date Registered: 6 August 2012
Last active: 5 years ago
Posts
277
Respect
Forum Rank
Mr. Elemental
Primary Group
Community Scripter Elite
My Groups
More
×
YaPh1l's Groups
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
YaPh1l's Contact & Social Links
The zombiemode characters in WaW all use the same viewhands.

- Phil.
broken avatar :(
×
broken avatar :(
Location: gb
Date Registered: 17 February 2013
Last active: 9 years ago
Posts
107
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Community Mapper
My Groups
More
My Contact & Social Links
More
×
trebeltom1's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
trebeltom1's Contact & Social LinksWaffle Fries
oh ok thanks
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 April 2013
Last active: 9 years ago
Posts
49
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
I decided to try changing the viewhands in my ugx loadout.gsc too, but I ran into a small problem. Everything seems to load fine, but when I try to ADS there is no animation...the crosshairs minimize but the hands do nothing.

This is what I set the _loadout.gsc zombiemode to:
Code Snippet
Plaintext
		set_player_viewmodel( "viewmodel_usa_marine_rolledup_arms");
set_player_interactive_hands( "viewmodel_usa_marine_rolledup_player");

Is there some kind of restriction with the new guns and these old waw models? I can't seem to figure out the problem, also when I change the interactive hands back to the black kit ones it seems to make no difference. Any help would be appreciated, thanks.
broken avatar :(
×
broken avatar :(
[UGX] Founder
Location: usBay Area, California
Date Registered: 24 June 2011
Last active: 2 years ago
Posts
5,551
Respect
6,655Add +1
Forum Rank
Immortal
Primary Group
UGX Administrator
My Groups
More
My Contact & Social Links
More
×
treminaor's Groups
UGX Administrator
UGX Team Member
UGX Site Moderator 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.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 21 April 2013
Last active: 9 years ago
Posts
49
Respect
Forum Rank
Legless Crawler
Primary Group
Member
My Contact & Social Links
More
×
You can't use certain hands with CoD4 models. Try different ones. You will have the highest success rate with CoD4 hands.
Alright thank you, I'll see what other CoD5 models work before trying CoD4.

 
Loading ...