Detail Props on World Spawn, Start to Finish.

Posted by on Mar 29, 2011 in Past Stories

We’ve all seen those grass details on various maps and wanted them to be on our maps as well. Good new! You’re going to learn something today, how to create a sprite card, and make all the necessary items to make this work. Lets go over what you’ll need for this: Hammer Editor VTFedit NotePad++ (Not needed, but recommended) Photoshop (GIMP should work, but I don’t know how to use it all that well. NOTE: I will NOT be supporting any questions about using GIMP for this.) Common knowledge, and about 45% of a normal sized human brain. Well lets get started, you’ll need to make a sprite card for you to use. I’ve already gotten my hands on one from Dark Artz Entertainment, thanks for the image guys. There are a couple rules whilst creating this image that MUST be followed. It must be a square image, unless you are shipping your own mode and have access to code. (EX: 512×512, 256×256, 1024×1024) There must be at least one pixel between each item you a have on the card. Place your items on a grid like formation, like I have on mine. Make sure to have the image be transparent Gradient fade out the bottom of each item using the alpha channel. (See the black and white image, that is the alpha channel for the image.) Now we will create the VMT for the sprite card. I’ve already done the heavy lifting, so I’ll just give you guys the code. Place the VTF and VMT into “materials/detail” and use the following: UnlitGeneric { $translucent 1 $baseTexture "detail[VTF NAME]" $nocull 1 $vertexcolor 1 $vertexalpha 1 $receiveflashlight 1 $singlepassflashlight 1 } That will do it for the VMT side of things. Next we will set up the detail.vbsp file that will define the rules for placing these props. I heavily recommend using NotePad++ for this part, because it shows you what brackets are connected. Start by creating a new text file in the root directory of your game. (EX: for counter strike source the path would be, steam/steamapps/youraccount/Counter-Strike Source/cstrike/detail.vbsp) Name the file mydetail.vbsp, the default name is “detail.vbsp” if used it will be used over the stock one. You can name it what ever you want though. Add the following to the newly created VBSP file: detail { Detailtype { density [float] Group# { alpha [0-1] Model { [settings] } } } } Now let me clear up some of these things for you guys, it’s all pretty simple after you know what you’re looking at! Where it says “Detailtype” this is what you would name the group you are about to create. So I’m going to walk you through placing some simple grass sprites on the level, I’m going to use “Grass_Green_lvl1” Density is how thick the sprites are placed, a good starting value is 1500. For you tech specific people, here is the formula for how often...

Read More »