PDA

View Full Version : CoD4 - Disable Viewhands



Chefchen
8th March 2014, 18:02
so, ive created a weapon which is basically your hands.
The only problem i got is that i dont need viewhands to hold my hands (obviously my charackter is no 4 handed guy.)
Basically it looks like this:
667

This is btw cg_gun_x 20. Without it the viewhands are blocking the whole screen.
(ehm yes, this thing in the middle are the viewhands, and the hands on the side is my weapon)
So, can i disable viewhands for a weapon?

serthy
8th March 2014, 20:27
update your weapons/mp/yourweaponfile and set the viewmodel to none somewhere there?

Chefchen
8th March 2014, 20:38
Already tried it.
668

Tally
8th March 2014, 22:21
viewsleeves is set in the model alias files. Example:

character\character_mp_arab_regular_cqb.gsc:


main()
{
self setModel("body_mp_arab_regular_cqb");
self attach("head_mp_arab_regular_headwrap", "", true);
self setViewmodel("viewhands_desert_opfor");
self.voice = "arab";
}

precache()
{
precacheModel("body_mp_arab_regular_cqb");
precacheModel("head_mp_arab_regular_headwrap");
precacheModel("viewhands_desert_opfor");
}


So, try updating the model alias file to not use any viewsleeves:


self setViewmodel("");

Chefchen
8th March 2014, 22:28
So, can i also disable it while using a certain weapon?
For example i disable it while holding a AKu and enable it while holding an ak?
Should be possible right?

Tally
8th March 2014, 23:07
So, can i also disable it while using a certain weapon?
For example i disable it while holding a AKu and enable it while holding an ak?
Should be possible right?

You can do, but it requires a fair bit of scripting. As I said, the weapon file has nothing to do with setting the viewsleeves model. What you will have to do is create a character alias file for each weapon you want to change the viewsleeves model and then run the player through the character alias detaching every model and then attaching the ones you want when the player is holding particular weapons.

NOTE - the way its done in the stock game is exactly the same - the weapon sets the class, and then the player is given each character alias file based on the class. Just check out maps\mp\gametypes\_teams::playerModelForWeapon( ).

Chefchen
8th March 2014, 23:49
I dont need to code anything.
I got my own "DjTranceFire". You should probably get one too!

DjTranceFire
9th March 2014, 00:01
Thats not the best idea.. :D
I'm one of the worst modder ever.. :D
w/e lets try it and hope the best :D

Thank you Tally, thank you serthy! :P

Chefchen
9th March 2014, 00:23
So, try updating the model alias file to not use any viewsleeves:


self setViewmodel("");

Tried it.
This was the Output

Error
script runtime error
(see console for details)
usage: setviewmodel(<model name>)
Any ideas?

Tally
9th March 2014, 03:04
Tried it.
This was the Output

Error
script runtime error
(see console for details)
usage: setviewmodel(<model name>)
Any ideas?

I played around with it and it seems you cannot completely remove viewhands. You must have some kind of model attached as the view model. Whether this is an invisible model or not, you still need a model on the end of your arms.

Even if you detach all models, your view model will still be the last viewhands model used. Only the world wont see you, but in first person you will see the last viewhands model until you replace it with a legitimate model.

DjTranceFire
9th March 2014, 04:52
Does anyone here maybe know how to create custom weapons in blender/maya and maybe can help us? :D
Anything is going the right way but its seems impossible to create just 2 hands that can punch.. :(