Results 1 to 2 of 2

Thread: Stuck in a script for character models

  1. #1
    ... connecting
    Join Date
    Feb 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Stuck in a script for character models

    I'm stuck in a problem so let me start from the beginning , simple and small

    This is about my Cod4 promod 216 live raw which I'm using for my promod snd server , I'm posting this here cause there is no other place in the internet better than here about the topic I'm talking about.

    I wanted to add a few character model for my cod4 promod server. I've put all the files perfectly in images/materials/material_properties/xmodel/xmodelparts/xmodelsurfs , precatched em and edited the mod.csv and compiled it. Since I didn't knew what's the code to select the skin in game , I opened a zombie mod source to read its code to select skins. Here's what I found out

    main()
    {
    self setModel("anna");
    self setViewmodel("viewhands_tf141");
    self.voice = "russian";
    self.armor = "light";
    }

    precache()
    {
    precacheModel("anna");
    precacheModel("viewhands_tf141");
    }

    and another one

    main()
    {
    self setModel("Nyreen_ME3");
    self setViewmodel("viewhands_tf141");
    self.voice = "russian";
    self.armor = "none";
    }

    precache()
    {
    precacheModel("Nyreen_ME3");
    precacheModel("viewhands_tf141");
    }

    As you can see , there is a Viewmodel named viewhands_tf141 in both main and precache. I don't understand what is this viewhands_tf141 ? there is no viewhands_tf141 in my mod source and all I could guess is that since Zombie always makes the players select on one side of the team and the other one is for zombies, maybe viewhands_tf141 means only the team of the players can get the models , not the zombies. So what should I actually put here for setViewmodel and precacheModel ?

    Thank you for your patience and time for reading out my problem. Hope you'll help out this fellow person.
    Last edited by Raven's Fantasy; 24th February 2018 at 21:33.

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    In cod4, all model stuff starts in maps/mp/gametypes/_teams.gsc, in the function setPlayerModels().
    It calls a bunch of mptype/*.gsc scripts's precache() function, which looks like this:

    PHP Code:
    // THIS FILE IS AUTOGENERATED, DO NOT MODIFY
    main()
    {

        
    character\character_mp_usmc_specops::main();
    }

    precache()
    {
        
    character\character_mp_usmc_specops::precache();

    So, chasing that to the character/ folder leads us to this:

    PHP Code:
    // THIS FILE IS AUTOGENERATED, DO NOT MODIFY
    main()
    {
        
    self setModel("body_mp_usmc_specops");
        
    self attach("head_mp_usmc_tactical_mich_stripes_nomex"""true);
        
    self setViewmodel("viewmodel_base_viewhands");
        
    self.voice "american";
    }

    precache()
    {
        
    precacheModel("body_mp_usmc_specops");
        
    precacheModel("head_mp_usmc_tactical_mich_stripes_nomex");
        
    precacheModel("viewmodel_base_viewhands");

    The precache() in there does the precaching, while the main() is called on a player when he spawns to set his model.

    If you want to change the models, the easiest way to make something that's understandable is to edit the _teams.gsc file to point to different mptype/ files, in which you can directly do the precache/main stuff then.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (24th February 2018),YuriJurek (25th February 2018)

Tags for this Thread

Posting Permissions

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