Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: CoD4 - Disable Viewhands

  1. #1
    Private
    Join Date
    Mar 2014
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    CoD4 - Disable Viewhands

    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:
    Click image for larger version. 

Name:	viewhands.jpeg 
Views:	53 
Size:	187.3 KB 
ID:	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?
    Last edited by kung foo man; 8th March 2014 at 17:32. Reason: Please do not rely on external image hosts, they delete images as they want

  2. #2
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    update your weapons/mp/yourweaponfile and set the viewmodel to none somewhere there?

  3. #3
    Private
    Join Date
    Mar 2014
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Already tried it.
    Click image for larger version. 

Name:	Unbenannt.PNG 
Views:	40 
Size:	5.7 KB 
ID:	668

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    viewsleeves is set in the model alias files. Example:

    character\character_mp_arab_regular_cqb.gsc:

    Code:
    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:

    Code:
    self setViewmodel("");

  5. #5
    Private
    Join Date
    Mar 2014
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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?

  6. #6
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Chefchen View Post
    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( ).

  7. The Following 2 Users Say Thank You to Tally For This Useful Post:

    Chefchen (8th March 2014),DjTranceFire (8th March 2014)

  8. #7
    Private
    Join Date
    Mar 2014
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    I dont need to code anything.
    I got my own "DjTranceFire". You should probably get one too!

  9. #8
    Private
    Join Date
    Oct 2013
    Posts
    48
    Thanks
    10
    Thanked 4 Times in 2 Posts
    Thats not the best idea..
    I'm one of the worst modder ever..
    w/e lets try it and hope the best

    Thank you Tally, thank you serthy! :P

  10. #9
    Private
    Join Date
    Mar 2014
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Tally View Post

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

    Code:
    self setViewmodel("");
    Tried it.
    This was the Output
    Code:
    Error
    script runtime error
    (see console for details)
    usage: setviewmodel(<model name>)
    Any ideas?

  11. #10
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by Chefchen View Post
    Tried it.
    This was the Output
    Code:
    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.
    Last edited by Tally; 9th March 2014 at 02:32.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •