Thread: Fixing multi-part replacement models

Results 1 to 11 of 11
  1. #1
    Administrator Sven Viking's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    New Zealand
    Posts
    8,099

    Exclamation Fixing multi-part replacement models

    If you're making, or have made, a replacement model with multiple animation files (e.g. grue.mdl, grue01.mdl, grue02.mdl... anything with a "modelname01.mdl" file. modelnamet.mdl files don't count), then you need to read this.


    Short version, for people who already have an idea of what I'm meaning:
    If your replacement model includes 0?.mdl files, open the main .mdl file in a hex editor, and replace any instances of "filename0?.mdl" with "yourfilename0?.mdl" (replace the characters, do not insert!) Save the file. This will solve serious problems some people may have with your model otherwise.


    Full version:
    After reskinning a model in a model viewer, and often after editing a model in Milkshape, information as to the locations of the model's secondary files (modelname01.mdl, modelname02.mdl, etc.) is left in the .mdl file (does not effect single-file models, or single-file models with their textures in a separate t.mdl file).

    This can cause the models to break up into separate polygons when playing certain animations, or freeze or crash some people's computers when playing certain animations. Sometimes you may not experience these problems, but someone else who has the high-definition pack installed, or uses a model replacement for that model normally, or such, will.


    To fix the problem, first make sure that your replacement model's filename is different from the default (e.g. if it's a Barney replacement, rename the files to something other than barney.mdl). Then you'll need a HEX editor... Hex Workshop is good.
    http://www.bpsoft.com/downloads/

    Open the .mdl file in your hex editor (only the .mdl file matters), and search for the text string "01.mdl" (no quotes). You should find something like:
    .....models\barney01.mdl.........

    Overwrite the filename with the correct filename for your model, e.g.:
    .....models\pinkdressbarn01.mdl..

    DO NOT Insert any text... if you change the length of the file, it will not work. You need to overwrite the characters (including some of the "."s if your filename is longer than the default).

    Then search for 02.mdl, and repeat the process until there are no more 0?.mdl files.

    Save the .mdl file. Your replacement model should now be fixed.

    Be warned that the editor will probably leave the modified date as it is, and the filesize will of course be identical, so it may be impossible to tell which is the updated file without checking it in a hex editor again.
    Sven Viking

  2. #2
    Banned GhostReconGE's Avatar
    Join Date
    Jun 2003
    Location
    In a Mystical Land.....
    Posts
    30
    so this will fix the Mess up Dancing thing. Cause when I make "some" custom skins the grunts go all messy on my and do a dancing where they split into 50 pieces.

  3. #3
    The Man 60 Megabyte File's Avatar
    Join Date
    Aug 2001
    Location
    New Jersey, where crime and corruption roam free.
    Posts
    3,540
    Or if you know how to work Milkshape, you can do all that by decompiling the model, and going into the QC file and deleted the line that says
    $externaltextures
    . It should be near the top.

    Then recompile the model and you will have no T or extra "01, 02, T" models

    60_Megabyte_File
    Sven Co-op Message Board Moderator

  4. #4
    Administrator Sven Viking's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    New Zealand
    Posts
    8,099
    $externaltextures shouldn't make a difference... that should just get rid of the t.mdl file. The 01, 02, etc. files are created by splitting the animations into groups.

    I think decompiling a model in Milkshape may remove the group information, though... so decompiling and recompiling may fix the problem by combining all animations into the one file.

    Only problem with that is that it can take up more memory (all the animations are loaded to memory, whereas if they're split into different files, each file is loaded only if one of the animations it contains end up being used). Unless your map already uses a heap of RAM, though, this isn't likely to matter.
    Sven Viking

  5. #5
    Banned GhostReconGE's Avatar
    Join Date
    Jun 2003
    Location
    In a Mystical Land.....
    Posts
    30
    Also, Some of the models I make have funny animiations. When they attack they signal foward with der hands like squad come over here. but that is their fire animation that is messed up. I know it is off topic but can u help me?

  6. #6
    Administrator Sven Viking's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    New Zealand
    Posts
    8,099
    Hmm... try using the animation SMD files from the Half-Life SDK, perhaps? Maybe use the SDK's hgrunt QC file as your base, too. Decompiling in milkshape causes problems with some models.
    Sven Viking

  7. #7
    The Christmas Poo Mr.Hankey's Avatar
    Join Date
    Apr 2003
    Location
    Ontario, Canada
    Posts
    198
    Wait ... if you're just removing the sequence files (modelname0*.mdl), why not just go into the .QC file and delete the " $sequencegroup " lines?

    And while you're at it, you can also delete the " $externaltextures " line to remove the T.mdl ...

    EDIT: Oops, did ready 60's post

    EDIT[2]: 60 MegabyteFile, that only removes the T.mdl
    You need to delete the lines which have '$sequencegroup' in them
    Howdie Ho!

  8. #8
    Administrator Sven Viking's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    New Zealand
    Posts
    8,099
    Yup. Only problem with that is that it can take up more memory (all the animations are loaded to memory, whereas if they're split into different files, each file is loaded only if one of the animations it contains end up being used). Unless your map already uses a heap of RAM, though, this isn't likely to matter.
    Sven Viking

  9. #9
    Desintigrator of Souls
    Join Date
    Dec 2003
    Location
    Denmark
    Posts
    2,885
    i have no idea what this does...

    are you talking about how to remove the if-these-sequences-
    are-used-and-they-are-not-in-the-model-then-do-a-dance-
    situasions?
    the truth about scientology

  10. #10
    more wpoly = more fun Tuesday's Avenger's Avatar  
    Contributor
    Join Date
    Mar 2004
    Location
    United States
    Posts
    1,458
    erg... wish i was a member when I was making my earlier hgrunt models... had to figure out to remove the $sequencegroup lines on my own... that was a pain. I had the fun issue of seeing my grunts either crash the game or fragment into bazare deformed shapes in the middle of battle.

    *kicks himself for not reading this*

  11. #11
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Fixing multi-part replacement models

    Oh, didn't notice this thread before. This happens because the game tries to load sequence groups using the filename embedded into the main file. It fails and then tries to access the data even if it's not there, causing random behavior (usually crashes). Sven Co-op's sequence group loader was updated to fall back to loading them based on the main model's path, but the engine's loader has not as far as i know of, so this shouldn't happen as often now.

    And yes, i realize this thread is 13 years old. Just making sure people know.

Posting Permissions

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