Converting a reskin into a model?

Discussion in 'Mapping Questions & Discussion' started by 404UserNotFound, Feb 1, 2011.

  1. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Alright, I recently got a load of custom weapon models working on my server, all of which are from the Advanced Weaponiser. I went to this server that was running the Advanced Weaponiser and was forced to download custom weapon models.

    So I rummaged through those files and grabbed any worldmodels, as well as the materials for those worldmodels. Using the 4 plugins listed below, I was able to make custom weapons with those custom worldmodels, and everyone can see the worldmodels perfectly.

    I'm using 4 plugins from AlliedMods on my server: Give Weapon plugin, Visible Weapons, Patch for player attachments, and SDK Hooks

    So here's my question. Would it be possible to download a reskin of a weapon, let's say this Energy Sword reskin of the Kukri, which I know comes with worldmodels, and somehow convert its worldmodels (which are named w_machete.mdl) into usable worldmodels?

    I saw this guide in the archives, but upon reading over it, I don't think it's what I'm looking for.

    I already tried uploading the w_machete.mdl files for the Energy Sword, but upon applying them to a custom weapon in the Give Weapon plugin, everyone just saw me holding a Kukri. Apparently the Orange Box engine reads w_machete.mdl, and ignores the custom Energy Sword models, but uses the default w_machete.mdl model.

    So yeah....is it possible to perhaps follow that guide in the archive and rename the w_machete.mdl files to say, w_energysword.mdl, so that the game will actually be able to use them?
     
  2. gamemaster1996

    gamemaster1996 L13: Stunning Member

    Messages:
    1,065
    Positive Ratings:
    131
    Wouldn't you just decompile the model it's skinned from, change the $cdmaterial parameter to the reskinned one, rename it and then recompile it???
     
    • Thanks Thanks x 1
  3. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    I take it you're explaining how to set up custom models for clientside use? I don't want that. I'm trying to convert the reskins I download from GameBanana so that they have custom model filenames, and can be used on my server.

    The way that the Advanced Weaponiser models work, they have their own custom .mdl filenames, for example the Amateur With Feelings (Sniper Melee weapon, a golf trophy). It's filename is w_golf.mdl .

    Essentially what I want to do (to simplify this) is download some custom reskins from www.gamebanana.com and change the model filenames so that I can use them on custom weapons.

    For the majority of the reskins on GameBanana, the models' filenames use pre-existing model names, which is a bad thing. The reskins on the site (most of them) were meant to be used clientside so only the player using them could see them.

    I want to convert them from clientside reskins to custom models that I can upload to my gameserver (preferably into the "advancedweaponiser" folders in tf/models and tf/materials), and my FastDL ftp.

    For example, that Energy Sword I linked to above, as I said, it's model filename is w_machete.mdl. I want to modify that and change it from w_machete.mdl to like, w_energysword.mdl so that the game engine doesn't see w_machete.mdl, disregard the custom model, and switch over to the default w_machete.mdl.

    How do I do this? Sorry for the big post :p
     
  4. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    Are the skins in unique directories already? If so I think you should be able to just rename the .mdl and it's supporting files.
     
    • Thanks Thanks x 1
  5. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    I had placed the Energy Sword files (all named w_machete.<format>) into the tf/models/advancedweaponiser & tf/materials/advancedweaponiser folders on my gameserver, then BZIP'd them all up and placed them in the same folders, on my FastDL FTP.

    Gave myself the weapon with the models attached. Here's the code I had used, from the Give Weapon plugin's custom TXT file (tf2items.givecustom.txt):
    Code:
        "9044"
        {
            "classname"        "tf_weapon_club"
            "index"        "3"
            "slot"        "2"
            "quality"        "6"
            "level"        "100"
            "attribs"        "2 ; 2.50"
            "ammo"        "-1"
            "model"          "models/advancedweaponiser/w_machete.mdl"
        }
    Asked the people on my server what they saw, and received "Kukri" as the answer.

    I was going to try simply renaming the files, but I didn't know if that would work.

    Guess I shall try that right now, and report back with the results.
     
  6. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Alright, so I renamed the world model files to w_energysword, and upon reloading the give weapon stuff, here's the errors that popped up in the console:

    Code:
    Error Vertex File for 'weapons\w_models\w_machete.mdl' checksum -1227756467 should be 1102933642
    Error Vertex File for 'weapons\w_models\w_machete.mdl' checksum -1227756467 should be 1102933642
    MDLCache: Failed load of .VVD data for weapons\w_models\w_machete.mdl
    
    And it still looks like a Kukri.

    EDIT: Decided to try editing the w_machete.mdl (renamed to w_energysword.mdl) file in Notepad++. Here's what I saw right at the top:
    [​IMG]
    [​IMG]

    So I opened up one of the Advanced Weaponiser custom models in Notepad++, the "Atomic Punch Bat". Here's what I saw:

    [​IMG]

    I'm wondering if changing any filepaths in all the Energy Sword model/material files would work....

    Anyone have any ideas?
     
    Last edited: Feb 1, 2011
  7. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    • Thanks Thanks x 1
  8. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Changed the filepaths, re-upped the files properly, gave myself the weapon that uses the models, touched a resupply locked to change my melee weapon into the custom-model-using Kukri......crashes the server.

    EDIT: Just saw your post, Boojum. I didn't change the IDST thing, but I changed the filepaths in the .mdl file, and like 2 other files, one of which happened to be the material file which had a filepath that pointed to it's original folder. So I changed the filepaths over to advancedweaponiser/energysword/.

    As stated above, it crashes the server everytime I try to equip the Kukri with the energy sword model.

    I'll try that guide you posted and see how that goes.
     
    Last edited: Feb 1, 2011
  9. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Alright, I followed the guide and did everything properly. Uploaded the models & materials.

    Gave the weapon to another player and he appeared to be holding a Kukri.....but the weird part is....I could see a pink & transparent checkerboard shape of an Energy Sword.

    So....kind of a win? Not exactly sure what went wrong.
     
  10. Hell-met

    Hell-met L1: Registered

    Messages:
    43
    Positive Ratings:
    8
    Can't you just use a hex editor
     
  11. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    I'm using Notepad++ which is essentially a hex editor.

    I've run into a roadblock with my next attempt at making a custom model (seeing as the Energy Sword was a fail).

    Shiban's Barrett Sniper Rifle

    I've got the QC open in Notepad++, and here's what I see:

    Code:
    $cd "C:\Users\404 User Not Found\Desktop\Extracts"
    $modelname "weapons\w_models\w_sniperrifle.mdl"
    $model "w_sniperrifle" "LOLREFF.smd"
    $cdmaterials "\Models\weapons\SHIBARRETT\"
    $texturegroup skinfamilies
    {
        {"Bodeh.vmt"
     "Scopeh.vmt"
     "Bodehshitz.vmt"
     "Lazr.vmt"
    }
         {"Bodeh.vmt"
     "Scopeh.vmt"
     "Bodehshitz.vmt"
     "Lazr_blue.vmt"
    }
     }
    $hboxset "default"
    // Model uses material "Bodeh.vmt"
    // Model uses material "Scopeh.vmt"
    // Model uses material "Bodehshitz.vmt"
    // Model uses material "Lazr.vmt"
    // Model uses material "sniper_red.vmt"
    // Model uses material ",.vmt"
    // Model uses material "sniper_blue.vmt"
    // Model uses material "Lazr_blue.vmt"
    $attachment "muzzle" "weapon_bone" 0.00 3.77 41.90 rotate -90.00 -0.00 0.00
    $surfaceprop "metal"
    $illumposition -2.589 -3.923 4.458
    $sequence idle "idle" fps 30.00
    $collisionmodel "phymodel.smd" {
    
        $mass 1.0
        $inertia 1.00
        $damping 0.00
        $rotdamping 0.00
    }
    Now, I know what parts to edit; mainly this stuff:

    Code:
    $cd "C:\Users\404 User Not Found\Desktop\Extracts"
    $modelname "weapons\w_models\w_sniperrifle.mdl"
    $model "w_sniperrifle" "LOLREFF.smd"
    $cdmaterials "\Models\weapons\SHIBARRETT\"
    But I want to be able to do the following:

    1. Place the model files in tf/models/advancedweaponiser/barrettsniper on my gameserver, and my FastDL FTP
    2. Place the material files in tf/materials/advancedweaponiser/barrettsniper on my gameserver, and my FastDL FTP
    3. Rename the model to w_barrettsniper.mdl
    4. In doing the above 3, I'm hoping to be able to set it as the model of a custom weapon in the Give Weapon plugin, and when I equip said weapon, because I'm using the world model, everyone has to be able to see it.
    What do I change? Do I change anything for $model? Or do I leave that alone? I am confused :(
     
    Last edited: Feb 1, 2011
  12. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    The $model line refers to the actual mesh files that will be compiled, so leave it be. The other things you can change to what you want.
     
    • Thanks Thanks x 1
  13. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Thanks Boojum! You. Are. The. Best.

    *bows to the almighty Boojum*
     
  14. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Quick question though....

    I just successfully compiled the Barrett Sniper models.....but what about the materials?

    I just opened its' one material file in Notepad++ and saw this:

    Bodeh.vmt
    Code:
    "VertexLitGeneric"
    {
        "$baseTexture" "models\weapons\SHIBARRETT\Bodeh"
    
        "$phong" "1"
        "$phongexponent" "25"
        "$phongboost" "5"    
        "$lightwarptexture" "models\lightwarps\weapon_lightwarp"
        "$phongfresnelranges"    "[.25 .5 1]"
        "$basemapalphaphongmask" "1"
    
        "$rimlight" "1"
        "$rimlightexponent" "3"    
        "$rimlightboost" ".25"
    }
    Code:
    "$baseTexture" "models\weapons\SHIBARRETT\Bodeh"
    ^Should I not be changing this to "advancedweaponiser\barrettsniper\Bodeh"? Because I thought I'd be able to place the material files into the advancedweaponiser folder (where all the advancedweaponiser materials go. i like things neat and tidy), and have everything work.

    Does this mean I have to place the material files into "materials\models\weapons\SHIBARRETT" for them to work properly?

    I have a feeling this is why the Energy Sword material didn't work properly, and instead left the Kukri visible, with this faint pink checkerboard in the shape of an Energy Sword.
     
    Last edited: Feb 1, 2011
  15. A Boojum Snark

    aa A Boojum Snark Toraipoddodezain Mazahabado

    Messages:
    4,767
    Positive Ratings:
    5,508
    Yes, that's why the sword didn't work. The VMT needs to be changed to reflect the new location of the VTF.
     
    • Thanks Thanks x 1
  16. 404UserNotFound

    404UserNotFound No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    225
    Positive Ratings:
    55
    Ahhh, so just a simple rename of the filepath, and that's it? Obviously, I have to do this for each VMT (as this Barrett Sniper came with a few).

    I shall do just that, then.

    Thank you again Boojum, "thanks" will be distributed to you, as you have helped me learn how to turn reskins into custom models.