Please or Register to create posts and topics.

[TOOL] A Propper MOD

This is a very useful tool for mappers, mainly if you haven't got any modelling knowledge.

This tool will allow you to make models out of brushes; create whatever thing into your Hammer editor by means of only brushes and then turn it quick and easily into a custom model usable in game!

Propper is not new at all, many of you know about it already. I even wrote a tutorial some time ago... But since I know many of you are having trouble in making it to work out after some Valve updates and the new SteamPipe file system, I've decided to share this little mod I managed to prepare some time ago mounted in the Alien Swarm game and as a mod.

I borrowed TopHatWaffle's batch file altogether with the required binary files from his awesome tutorial some time ago, and edited it a bit for my purposes. So credit goes to him before anything. :notworthy:

Instructions will be posted in the first post on the download topic. However, I'm attaching a .PDF version inside the zipped downloadable file ;)

Please report any bug or issue you may find.

Cheers!

jose

CHANGELOG

- v1.0 - (2014/09/05) Release
- v1.0 - (2014/09/13) Fixed a typo in the "Create Model.bat" file that made the model's textures be saved into a "sMAterials" folder. Added a couple of important notes to the mod instructions.

File Name: Propper_MOD_v1.1.7z
File Size: 1.95?MiB
Click here to download [TOOL] A Propper MOD

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

PROPPER MOD
Instructions

1. Content of this download.

Inside the zipped file there is the following content:

- "propper.fgd"
- "propper.exe"
- a folder called "Propper_MOD"

Grab the whole folder "Propper_MOD" and put it right into your Steam/SteamApps/Sourcemods/ folder, so it ends up like this:

Steam/SteamApps/Sourcemods/Propper_MOD

Restart Steam before continuing.

Grab the 2 files "propper.fgd" and "propper.exe", and place them into your SteamApps/Common/portal 2/bin/ folder.

2. Configuring Hammer.

Open your Hammer editor and go to Tools > Options > Game Configurations tab. There's a dialog box where it says "Game Data Files" at the top of the window; click on the "Add" button at the right and locate the file "propper.fgd". This will make your Hammer editor to have some new entities available. We'll only interested in this entity: "propper_model".

3. The propper_model entity.

Into Hammer, make whatever "prop" out of only brushes, and once you're done, simply select everything and tie it (Ctrl+T) to a propper_model. Regarding this entity's properties and what to put into each dialog box, let's see:

Spoiler
Sorry, only logged-in users can see spoilers.

- Name (targetname): this is just the name of the propper_model entity, mainly in the case we would like to use its shape for collisions (explained below).
- Model name: this is the name of your model and the path where it should be placed relative to your /models/ folder. Please wait up for the next section before putting here anything.
- Material path: here you select where you want your model's texture materials to be. Usually, you'll want your textures to be placed in a folder that follows the same structure than for the prop folder (i.e. if your model is "/models/props/chair.mdl", try its textures to be into "/materials/models/props/" ;)). Please wait up for the next section before putting here anything.
- Surface property: just pick up one of them; this is important for example for determining its mass or the sound it makes when hits or it's hit by any other thing in-game.
- Physics mesh: this is very important and useful as it will determine collisions of our model (see below for a detailed handling)
- Concave collisions: leave it as it is by default, Yes.
- Source folder: here is where Propper will put the source files for your props (.QC and .SMD). Please wait up for the next section before putting here anything.
- Snap to hammer grid: better set it to Yes.

A couple of little tips here:

- In order to have better defined and more detailed props, you can make your brushes-prop much bigger than you would eventually need it, and then, after Propper has outputed the 'source' files, you can use the $scale QC command to actually scale your model to the desired 'real' size, and then to compile the model yourself using a model compiler ;) Don't hesitate to post any issue regarding this here and I'll give you a hand with it.

- Collisions: in the case your model is not much complex shape-wise, you can use it as the collision model by simply putting its name (the name of the proper_model entity) into the property "Physics mesh". In the case your model is too complex, make instead a simplified shape brush bounding your model and tie it to a func_brush textured with the toolsplayerclip texture, that bounding box will be your model's collisions.

- It's quite easy and handy to add multiple skins to your props by adding some code to the .QC file once Propper has outputed the source files. I'll briefly explain this in following sections.

4. The folder structure of the mod.

As you may have noticed, there are some folders inside your Propper_MOD folder:

- /bin/: this one contains all necessary files for Propper to work properly.

- /materials/: this is the folder where you have to put all the textures (.VTF and .VMT) your prop is using. Simply grab the textures you used from the "portal2/materials" folders, and put a copy of them here. Don't forget to keep the folder structure! (if you grab this texture "materials/metal/whatever.vtf", you'll need to make a "/metal" folder inside the "Propper_MOD/materials" folder and then put the texture "whatever.vtf" in there... I hope this is clear). Also, it's important that you put here any normal/bump map, env_map or detail texture specified into your .VMTs, so remember to open them and check these other texture files.

It's important to note here that Propper is only capable to handle .VTF files version v7.4 or lower. However, most of the textures that Portal2 uses are v7.5 (VTF version changelog). So you must change the version of those v7.5 VTF files (in order to check out the version of any file, open it into VTFEdit, go to the INFO tab, below the menu bar, not in the menu bar). There are several methods:

===> I prefer to do this by hexing the files myself. Get a hex editor, I use XVI32 and open the .vtf file, go to the 9th column (this may vary depending on the editor) of the first line (check out that at the right end of this line it says "vtf"), find the number 05 and change it by a 02:

Spoiler
Sorry, only logged-in users can see spoilers.

===> Tophattwaffle's VTF Version Changer (direct download!)

Another important thing: if your brush-based model in Hammer is using any of the tools textures, you should have them as well in this /materials folder in order for Propper to locate them when compiling the model. For example the toolsnodraw texture, you should use the nodraw texture on those brush sides that the player will not ever see of your model, in order to produce a more optimised model mesh.

- /models/: this is the folder where Propper will put the compiled and ready-to-be-used models.

NOTE: There is a little bug here; if by any chance you've got the Alien Swarm game installed in your computer (normally in Steam/SteamApps/Common/alien swarm/), Propper will place the model and its textures under the Alien Swarm folders.

- /vmfs/: once you finish your prop into the Hammer Editor and save it, grab the .VMF file from your SDK_Content folder and put a copy into this folder to be compiled. BUT since the content of the propper_model is currently incomplete, let's check out the next section in order to finish filling up its properties...

5. The "Create Model.bat" file.

Ok, now it's time to run this batch file. This file is located into your Propper_MOD's root folder. Find it and execute it.

NOTE: Do not run the "Propper MOD" sourcemod from your steam library as if it was a game, since it won't run the .BAT file and you'll only see a black screen previous to a crash (nothing too dangerous though :p).

This executable file works as a wizard guiding you through the process so you just must follow its instructions. It's pretty much straight forward, but just in cases:

- "I need to know the name of your model. Please type it below": Enter the name you used for your model without the .MDL extension (i.e. chair)

- "How many folders deep do you want your model to be? Enter 1, 2, or 3": Enter a number taking into account that it is relative to the /models folder without considering this latter one (if for instance I want my model under "/models/props/" I'll put here a number 1, cause under "/models" I only want 1 more folder called "/props").

- "Choose your folder name": It will ask you to put the name of 1, 2 or 3 folders depending on what you chose before.

- "Please set your Model Name to: <path_and_model_name>": put the path it tells you to in your propper_model's "Model Name" property.

- "Please set your Material Path to: <path_to_the_models_textures>": put the path it tells you to in your propper_model's "Material Path" property.

- "Please set your Source Folder Name to: <path_to_the_source_files>": put the path it tells you to. It will always tells you a path relative to "C:propsource/", and it's important to note here the following: due to Propper.exe limitations acceding to folders that contain a space in its name, I couldn't be able to make these files to be placed into the Propper_MOD folder, and it's better to use the C: drive since it is the most common one to all of us (also the propper_model entity has "C:propsource/" as the default folder to save the source files). Feel free to get the source files out of that folder once Propper puts them there and move them to your desired folder/s. Note that this wizard will automatically create the "C:propsource" folder for you (it might be necessary that you deactivate the UAC in Windows 7 so creating folders in C: is allowed).

- "Now it's time to compile your model. Save your VMF to the /VMFs folder. Then enter the name of the file (with NO extension), and hit Enter. Example: Metal_Pillar": this is the moment when we put a copy of our .VMF file into the "Propper_MOD/vmfs/" folder after we have completely fill up all properties of the propper_model entity. Note that here you have to say the name of your .VMF file, that doesn't need to coincide necessarily with your model's name or the popper_model's name. I hope this is clear.

Now your model should be compiled and its textures created. Check inside "Propper_MOD/models" and "Propper_MOD/textures" respectively. You should now copy/move the model files to your "portal 2/portal2/models/" folder and the textures to "portal 2/portal2/materials/models/". Don't forget to keep the folders structure, so remember to create as many folders as you said to the wizard that you wanted your model to be.

Note that what Propper does is to create .VMT versions of your model's .VMT textures but changing the shader; for example from "LightmappedGeneric" to "VertexGeneric"... but bare in mind that this new .VMT keeps pointing to the same .VTF texture, and in the case you need to pack your custom content for publishing to workshop, you'll need to pack this new .VMT plus the .VTF texture file. And again, don't forget to also pack the normal/bump map, env_map or detail textures that your model uses.

5. Multiple Skins.

In the case you don't need more skins, the process of creating the model ends up here. But for those interested in having multiple skins, let me tell you.

Propper creates the following source files:

- yourmodelname.QC
- yourmodelname_ref.SMD
- yourmodelname_phys.SMD

We can edit the .QC file to add multiple skins to our model (I suggest you to use Notepad++... it's awesome, and free). BUT note that we will have to compile the .QC file after we're done with it in order to have actual model files, ok?

First off let's take a look to "yourmodelname_ref.SMD" file. Open it with Notepad++. You'll see something similar to this (scroll down to view the full code):

Code: Select all
version 1
nodes
0 "static_prop" -1
end
skeleton
time 0
0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
end
triangles
jose_chair_wood_01.vmt
0 -128.000000 224.000000 32.000000 -1.000000 0.000000 0.000000 2.000000 0.500000
0 -128.000000 224.000000 -32.000000 -1.000000 0.000000 0.000000 2.000000 0.000000
0 -128.000000 -224.000000 -32.000000 -1.000000 0.000000 0.000000 -1.500000 0.000000
jose_chair_wood_01.vmt
0 -128.000000 224.000000 32.000000 -1.000000 0.000000 0.000000 2.000000 0.500000
0 -128.000000 -224.000000 -32.000000 -1.000000 0.000000 0.000000 -1.500000 0.000000
0 -128.000000 -224.000000 32.000000 -1.000000 0.000000 0.000000 -1.500000 0.500000
jose_chair_wood_01.vmt
0 128.000000 -224.000000 32.000000 1.000000 0.000000 0.000000 -1.500000 0.500000
0 128.000000 -224.000000 -32.000000 1.000000 0.000000 0.000000 -1.500000 0.000000
0 128.000000 224.000000 -32.000000 1.000000 0.000000 0.000000 2.000000 0.000000
jose_chair_wood_01.vmt
0 128.000000 -224.000000 32.000000 1.000000 0.000000 0.000000 -1.500000 0.500000
0 128.000000 224.000000 -32.000000 1.000000 0.000000 0.000000 2.000000 0.000000
0 128.000000 224.000000 32.000000 1.000000 0.000000 0.000000 2.000000 0.500000
jose_chair_wood_01.vmt
0 -128.000000 -224.000000 32.000000 0.000000 -1.000000 0.000000 -1.000000 0.500000
0 -128.000000 -224.000000 -32.000000 0.000000 -1.000000 0.000000 -1.000000 0.000000
0 128.000000 -224.000000 -32.000000 0.000000 -1.000000 0.000000 1.000000 0.000000
jose_chair_wood_01.vmt
0 -128.000000 -224.000000 32.000000 0.000000 -1.000000 0.000000 -1.000000 0.500000
0 128.000000 -224.000000 -32.000000 0.000000 -1.000000 0.000000 1.000000 0.000000
0 128.000000 -224.000000 32.000000 0.000000 -1.000000 0.000000 1.000000 0.500000
jose_chair_wood_01.vmt
0 128.000000 224.000000 32.000000 0.000000 1.000000 0.000000 1.000000 0.500000
0 128.000000 224.000000 -32.000000 0.000000 1.000000 0.000000 1.000000 0.000000
0 -128.000000 224.000000 -32.000000 0.000000 1.000000 0.000000 -1.000000 0.000000
jose_chair_wood_01.vmt
0 128.000000 224.000000 32.000000 0.000000 1.000000 0.000000 1.000000 0.500000
0 -128.000000 224.000000 -32.000000 0.000000 1.000000 0.000000 -1.000000 0.000000
0 -128.000000 224.000000 32.000000 0.000000 1.000000 0.000000 -1.000000 0.500000
jose_chair_wooden_border.vmt
0 128.000000 224.000000 -32.000000 0.000000 0.000000 -1.000000 0.500000 1.000000
0 128.000000 -224.000000 -32.000000 0.000000 0.000000 -1.000000 0.500000 -0.750000
0 -128.000000 -224.000000 -32.000000 0.000000 0.000000 -1.000000 -0.500000 -0.750000
jose_chair_wooden_border.vmt
0 128.000000 224.000000 -32.000000 0.000000 0.000000 -1.000000 0.500000 1.000000
0 -128.000000 -224.000000 -32.000000 0.000000 0.000000 -1.000000 -0.500000 -0.750000
0 -128.000000 224.000000 -32.000000 0.000000 0.000000 -1.000000 -0.500000 1.000000
jose_chair_wooden_border.vmt
0 128.000000 -224.000000 32.000000 0.000000 0.000000 1.000000 0.500000 -0.750000
0 128.000000 224.000000 32.000000 0.000000 0.000000 1.000000 0.500000 1.000000
0 -128.000000 224.000000 32.000000 0.000000 0.000000 1.000000 -0.500000 1.000000
jose_chair_wooden_border.vmt
0 128.000000 -224.000000 32.000000 0.000000 0.000000 1.000000 0.500000 -0.750000
0 -128.000000 224.000000 32.000000 0.000000 0.000000 1.000000 -0.500000 1.000000
0 -128.000000 -224.000000 32.000000 0.000000 0.000000 1.000000 -0.500000 -0.750000
end

You can see how there are references to .VMT material files. Those are your model's textures and the bunch of numbers are coordinates in the model where the textures are applied to. There will appear as many .VMT references in this file as different textures your model is using. Don't be scared about all that code, we won't edit it! However, it's important the order in which the different texture references appear. In our example, you can see there are 2 different textures, the first one is "jose_chair_wood_01.vmt" and the 2nd one is "jose_chair_wooden_border". Let's remember that order for later.

Now open the "yourmodelname.QC" file into Notepad++. By default, your file should look similar to the following code:

Code: Select all
$staticprop
$modelname "props/example"
$scale "1.000000"
$body "Body" "example_ref"
$cdmaterials "models/props/example"
$sequence idle "example_ref"
$surfaceprop "concrete"
$collisionmodel "example_phys"  {
   $concave
   $maxconvexpieces 1
   $automass
}

OK, we'll need to add some more code right under the $cdmaterials line. Let's suppose we want the model to have 3 skins, and let's imagine we want to change the 2 textures the model is using, for our example I'll have to add the following code:

Code: Select all
$texturegroup skinfamilies
{
   { "jose_chair_wood_01.vmt" "jose_chair_wooden_border.vmt" }
   { "jose_chair_wood_02.vmt" "jose_chair_wooden_border_a.vmt" }
   { "jose_chair_wood_03.vmt" "jose_chair_wooden_border_b.vmt" }
}

As you can see we make groups of textures; as many groups as different skins we want. Follow the syntax: check out where the brackets go and spaces between textures' path! Note that when I introduce the 2 textures for each of the 3 skins (those 3 code blocks below the "$texturegroup skinfamilies"), I am following the order mentioned before, the order we saw into the "yourmodelname_ref.SMD" file: the first one was "jose_chair_wood_01.vmt" and the 2nd one was "jose_chair_wooden_border". Just keep the order you see into the yourmodelname_ref.SMD file.

In the case we would want to change only one of the 2 textures of the model, the first one for example, being the 2nd one common to all skins, this is how it'll end up looking like:

Code: Select all
$texturegroup skinfamilies
{
   { "jose_chair_wood_01.vmt" "jose_chair_wooden_border.vmt" }
   { "jose_chair_wood_02.vmt" "jose_chair_wooden_border.vmt" }
   { "jose_chair_wood_03.vmt" "jose_chair_wooden_border.vmt" }
}

See?

Now the final step, to compile the model. Get Crowbar, install it and run it. It's an awesome tool and works like a charm. For now, we'll just focus in compiling, so go to the Compiler tab. Then select Portal2 as the "Game to Compile for", and then press the "Set Up Games" button near the dropdown bar. You'll have to specify:

- Location of the game (gameinfo.txt) => browse your game folder, usually: "C:Program Files (x86)Steamsteamappscommonportal 2portal2gameinfo.txt"

- Location of game's model compiler (studiomdl.exe) => usually: "C:Program Files (x86)SteamSteamAppscommonPortal 2binstudiomdl.exe"

Now locate your .QC file hitting the button "Browse" and find your .QC file. If you kept the original path where Propper outputed your source files, the file should be under your "C:propsource" folder. Go through your folders and find the .QC file. Once this is done, just press the "Compile QC File" button and wait up until it's done.

You'll have all your models' files under your "portal 2/portal2/models/<your_desired_folders>/" folder. In our example above, these will be into: "portal 2/portal2/models/props/". Once more: don't forget to put the textures that Propper put into the "Propper_MOD/materials/" folder in their correct folder or you'll see purple checkerboard when you browse your model in the Hammer's model browser! In our example the textures should be into the "portal 2/portal2/materials/models/props/" folder.

And I guess this is all!

Please post any issue while using this mod, or any bug you notice. Thanks... and I'll try to help you out ;)

Cheers!

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

An easier way to setup skins would be to use the propper_skins entity. My personal Propper setup uses a fake sourcemod for the older engine, with a copy of all the P2 materials extracted and version-changed. This way I can compile the models without needing to exit Hammer. You can actually just directly run propper.exe to compile the models, it doesn't even matter where the vmf is.

The robocopy.exe program is very useful to use after triggering Propper:

Code: Select all
"C:WindowsSystem32Robocopy.exe"
"...SteamAppssourcemodspropperconfigmodels" "...SteamAppscommonPortal 2portal2_dlc2models" /S /XO

This copies any models in propperconfig/ to Portal 2's directory but only if they have a newer last-modified date, making it quite fast at finding the newly-compiled models.

My stuff:
[spoiler]- BEE2 Addons | (BEE2)
- Hammer Addons
Maps:
- Crushed Gel
- Gel is Not Always Helpful[/spoiler]

I tend to use always newer games and engines, but yours is a clever way of having it all tightly set up! :thumbup:

You could share your mod with the community as well ;)

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

I used to just use the old Source SDK. I have not really used propper since I got Blender, but propper is nice for making basic props.

:A Little Higher: :Tornate: :Blue Portals: :Vectronic: :Youtube: :Twitter: : ModDB: :Old Sig:

The more you give, the less appreciated it will be received.