+ Reply to Thread
Results 1 to 3 of 3

Thread: [MAP] Changing Player Models

  1. #1
    Senior Member
    Points: 14,832, Level: 52
    Level completed: 88%, Points required for next Level: 68
    Overall activity: 0%



    Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe has a reputation beyond repute Bauxe's Avatar
    Join Date
    Feb 2012
    Posts
    1,121
    Points
    14,832
    Total Donations For

    [DtK] [V] Bauxe      $ 20.00
    vBActivity - Stats
    Points
    4,393
    Level
    20
    vBActivity - Bars

    [MAP] Changing Player Models

    This is based on a guide originally written by Enviolinador. Some points in his guide were unclear, so instead of copying it across, I have decided to re-write it.

    Player models are something that can truely give a map life. Imagine a Jailbreak map where all 'prisoners' were just terrorist skins, and all 'wardens' were just counter-terrorist skins. Or a Zombie map where all 'zombies' were just a terrorist skin.

    I had a chat with New Guy last night about this, and it was something he had never seen done, so we decided to play around with it a little, to see about having a map change a players model (since servers contain plugins to set the player skins, not the map). Although it can't achieve anything that a plugin can't, it does help for a few things:

    1) You can choose skins to be used on your own map. Instead of having each server use different (and probably unrelated) skins, you can instead allow for skins that match your maps theme.
    2) Skins will instead be packed inside the BSP, instead of being downloaded separately.
    3) Midround skin changes are possible (at exact points in the map), such as for different minigames.

    Anyway, you get the idea. So now on to how it is done.


    Before you actually implement this into a map, you should complete the rest of the map. I will go into further detail about this, however it is to do with the modelindex, which will constantly change as you make changes.

    So first you want to find propdata.txt. This will be located inside a VPK file, so use GFCScape to extract that. Alternatively, here is the text that is inside it. Just save it as propdata.txt: http://pastebin.com/zMKPvUC4

    This file should be moved to your scripts folder if you do not use custom content, however if you do use custom content, place it in custom/foldername/scripts. For example:
    Code:
    C:\Program Files (x86)\Steam\SteamApps\common\Counter-Strike Source\cstrike\custom\skin\scripts\propdata.txt
    Open this file in notepad, and find 'BREAKABLE DATA', which is right at the bottom of the file. In here, you want to add a new scope after "MetalChunks". For my example, I will use Bauxe.
    Code:
    //=================================================================================
    //		BREAKABLE DATA. NOT PROPDATA TYPES.
    //=================================================================================
    	"BreakableModels"
    	{
    		// Sorted in order of smallest to largest
    
    		"WoodChunks"
    		{
    			"models\Gibs\wood_gib01e.mdl"	"1"
    			"models\Gibs\wood_gib01d.mdl"	"1"
    			"models\Gibs\wood_gib01c.mdl"	"1"
    			"models\Gibs\wood_gib01b.mdl"	"1"
    			"models\Gibs\wood_gib01a.mdl"	"1"
    		}
    		"GlassChunks"
    		{
    			"models\Gibs\Glass_shard01.mdl"	"1"
    			"models\Gibs\Glass_shard02.mdl"	"1"
    			"models\Gibs\Glass_shard03.mdl"	"1"
    			"models\Gibs\Glass_shard04.mdl"	"1"
    			"models\Gibs\Glass_shard05.mdl"	"1"
    			"models\Gibs\Glass_shard06.mdl"	"1"
    		}
    		"ConcreteChunks"
    		{
    			"models\props_debris\concrete_chunk08a.mdl"	"1"
    			"models\props_debris\concrete_chunk09a.mdl"	"1"
    			"models\props_debris\concrete_chunk03a.mdl"	"1"
    			"models\props_debris\concrete_chunk07a.mdl"	"1"
    			"models\props_debris\concrete_chunk09a.mdl"	"1"
    			"models\props_debris\concrete_chunk02a.mdl"	"1"
    		}
    		"MetalChunks"
    		{
    			"models\Gibs\metal_gib1.mdl"			"1"
    			"models\Gibs\metal_gib2.mdl"			"1"
    			"models\Gibs\metal_gib3.mdl"			"1"
    			"models\Gibs\metal_gib4.mdl"			"1"
    			"models\Gibs\metal_gib5.mdl"			"1"
    		}
    		"Bauxe"
    		{
    		}
    	}
    Next thing you need to do is find a model to use! Any server side model should work, so find one in your models folder that you would like to use, and just add the path into your propdata.txt
    Code:
    	
    	"Bauxe"
    		{
    			"models\player\hhp227\miku\miku.mdl"	"1"
    		}
    Compile your map, reopen CS:S and load up the map. We need to get the modelindex, which changes as other models are used in a map and such. That is why we save this part for after the map is completed.

    Once the map is loaded up, type in console: "cl_precacheinfo modelprecache" to be presented with a list of all precached models. Near the top (under metal_gib5.mdl) should be your chosen model, as well as a number next to it. In my case, 024.

    Add a trigger on your map where you wish to change the model with the following output:

    <activation method> - !activator - AddOutput - modelindex ### - 0.00

    For example:


    Recompile the map, hit the trigger and your model should be changed! To check, just type "sv_cheats 1" and then "thirdperson" in console.



    When you are doing your final release, be sure to pack the propdata.txt into your map (making sure it is stored in scripts/ and NOT your custom directory), as well as any models you added (both the model files AND the material files). Adding the model somewhere in the map as a prop_static will make packing the model much easier.


    Not an overly detailed guide, so if you have any questions, be sure to ask!


  2. The Following 5 Users Say Thank You to Bauxe For This Useful Post:


  3. #2
    Development Team
    Points: 27,109, Level: 72
    Level completed: 8%, Points required for next Level: 691
    Overall activity: 55.0%
    imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy's Avatar
    Join Date
    Feb 2011
    Location
    Hawkesbury, NSW
    Posts
    2,558
    Points
    27,109
    Total Donations For

    [DtK] [SA] imthenewguy      $ 0.00
    vBActivity - Stats
    Points
    8,887
    Level
    28
    vBActivity - Bars
    Achievements Happy Anniversary! Trend Setter Posting God
    One thing to add. Leave this until the final part of your map is complete, as the model index is guaranteed to change when you add entites.

    Nice write up - works fantastic for me.

    Stand alone Hide N seek mod here we come!

  4. The Following User Says Thank You to imthenewguy For This Useful Post:


  5. #3
    Development Team
    Points: 27,109, Level: 72
    Level completed: 8%, Points required for next Level: 691
    Overall activity: 55.0%
    imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy has a reputation beyond repute imthenewguy's Avatar
    Join Date
    Feb 2011
    Location
    Hawkesbury, NSW
    Posts
    2,558
    Points
    27,109
    Total Donations For

    [DtK] [SA] imthenewguy      $ 0.00
    vBActivity - Stats
    Points
    8,887
    Level
    28
    vBActivity - Bars
    Achievements Happy Anniversary! Trend Setter Posting God
    thats very odd. It should defs be needed because the propdata file that is generated by the map is local.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

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