Difference between revisions of "How to make OC playermodels"

From Obsidian Conflict Wiki
Jump to: navigation, search
(progress in fixing up fenix's grammar lols)
Line 4: Line 4:
  
  
Original tutorial written by Fug, with tips and tricks of Maestro Fénix.
+
Original tutorial written by Fug, with added tips and tricks by Maestro Fénix.
  
In this tutorial you will learn about to make a playermodel for Obsidian Conflict.
+
In this tutorial you will learn how to make a playermodel for Obsidian Conflict.
  
  
Line 27: Line 27:
  
  
==Preparing the model==
+
==Preparing the textures==
  
First, you will have to create the folder of the new model that you want do. Go to Obsidian folder (remember: Steam/steamapps/sourcemods), and go to the following folder to create a new one:
+
First, you need to create a new folder for the model you're going to make. Go to the Obsidian Conflict folder (remember: Steam/steamapps/sourcemods/obsidian), and then navigate to materials/models/player Create a new folder in this directory with the name of your model; copy the materials that your model uses into this folder, then open the VMT files.
  
Materials/models/player (here, create a folder using right-click->create new folder, and name it as the name of your model).
 
  
 
+
You will see something like this:
Go to the textures of the model, place them in this new folder, and open their .VMT files.
 
 
 
You will see somethink like this (example):
 
  
  
Line 52: Line 48:
 
}</pre>
 
}</pre>
  
Go to the "$baseTexture" line, and change "Models/player/Mossman/mossman_sheet" for the rute where is placed the textures of your model.
+
Go to the "$baseTexture" line, and change "Models/player/Mossman/mossman_sheet" so that it reflects where your textures are located, E.G. "Models/player/MyFirstModel/mossman_sheet".
  
(Make sure that you write correctly the name and the rute, or you will see your model purple and black chequered)  
+
(If you enter something invalid, your model will have the error texture(purple & black checkered))  
  
Once you modified all the .VMT files, you are ready to convert the model to be used in Obsidian Conflict.
+
Once you have modified all the .VMT files, you are ready to convert the model to be used as a playermodel.
  
  

Revision as of 01:26, 8 April 2011

WIP.png This page is still a Work In Progress


Original tutorial written by Fug, with added tips and tricks by Maestro Fénix.

In this tutorial you will learn how to make a playermodel for Obsidian Conflict.


You will need...

  • Source Development Kit (SDK): Available in your Steam->Games->Tools
  • A image editing program (Paint.net, Photoshop, Paint Shop...)


Preparing the textures

First, you need to create a new folder for the model you're going to make. Go to the Obsidian Conflict folder (remember: Steam/steamapps/sourcemods/obsidian), and then navigate to materials/models/player Create a new folder in this directory with the name of your model; copy the materials that your model uses into this folder, then open the VMT files.


You will see something like this:


"VertexLitGeneric"
{
	"$baseTexture" "Models/player/Mossman/mossman_sheet"
	"$envmap" 			"env_cubemap"
                "$bumpmap" "models/player/Mossman/Mossman_normal"
	"$normalmapalphaenvmapmask" 1
	"$envmapcontrast" .20
	"$envmapsaturation"0.9
	"$envmaptint" "[ .36 .36 .36 ]"
        "$halflambert" 1
	"$nodecal" "1"
}

Go to the "$baseTexture" line, and change "Models/player/Mossman/mossman_sheet" so that it reflects where your textures are located, E.G. "Models/player/MyFirstModel/mossman_sheet".

(If you enter something invalid, your model will have the error texture(purple & black checkered))

Once you have modified all the .VMT files, you are ready to convert the model to be used as a playermodel.


Converting the model

Go to the model files, and open the .MDL file with Notepad++. Go to the first line and search IDST0. If is the same, then is ok. If you found it as a IDST, , change it to IDST0. This will allow you decompile an Orange Box model.


Open MDLDecompiler. Select the model that you want decompile and the folder where you want put the files. Wait until a pop-out window appears saying "(model) model decompiled".


(If for some reason crashes, try again 3-4 times. If still without work, try with StudioCompiler.

Go to the folder where the new files are. You will see some files with the extension .SMD and a single file with the extension .QC called mdldecompiler. Open it with Wordpad.


This file sets all the configuration of the model. This is an example:

$cd "C:\Users\Rafa\Desktop\Nueva carpeta (5)"
$modelname "player\Flandre.mdl"
$model "body" "ref.smd"
$cdmaterials "models\player\Flandre\"
$hboxset "default"
// Model uses material "txFlanFace.vmt"
// Model uses material "txFlandre.vmt"
$includemodel "player/female_shared.mdl"
$includemodel "player/female_ss.mdl"
$includemodel "player/female_gestures.mdl"
$includemodel "player/female_postures.mdl"
$surfaceprop "flesh"
$illumposition 0.016 0.578 34.522
$sequence ragdoll "ragdoll" ACT_DIERAGDOLL 1 fps 30.00
$ikchain rhand ValveBiped.Bip01_R_Hand knee  0.707 0.707 0.000
$ikchain lhand ValveBiped.Bip01_L_Hand knee  0.707 0.707 0.000
$ikchain rfoot ValveBiped.Bip01_R_Foot knee  0.707 -0.707 0.000
$ikchain lfoot ValveBiped.Bip01_L_Foot knee  0.707 -0.707 0.000
$collisionjoints "phymodel.smd" {

	$mass 60.0
	$inertia 10.00
	$damping 0.01
	$rotdamping 1.50
	$rootbone "valvebiped.bip01_pelvis"
	$jointmerge "ValveBiped.Bip01_Pelvis" "ValveBiped.Bip01_Spine1"

(more things)


$cd indicates where the compiler must read the decompilated files (change it if after decompile the model you moved this files to another folder).


$modelname indicates the path where will be created the model and their name. Change it for the path that the model will use and their name if you want rename it. For a playermodel the path is "player/nameofthemodel.mdl".


$cdmaterials indicates the path where will be the textures of the model. Write right the path or you will see your model black and purple chequered.


$includemodel indicates the path and the name of the animations of the model. For make a Obsidian Conflict playermodel you must put:


  • For a male model:
$includemodel "player/male_shared.mdl"
$includemodel "player/male_ss.mdl"
$includemodel "player/male_gestures.mdl"
$includemodel "player/male_postures.mdl"


  • For a female model:
$includemodel "player/female_shared.mdl"
$includemodel "player/female_ss.mdl"
$includemodel "player/female_gestures.mdl"
$includemodel "player/female_postures.mdl"


$surfaceprop: It used to define what type of physical surface have the model. The default is flesh (organic-human). The complete list is here. Note: If you used this command in the .VMT files to define multiple types of surface, and now you use here this command, it will override them. Eliminate the command from the mdldecompiler.qc or use the "default" value.


And that´s is all you must modify to make a playermodel.


Giving the final touches

Save it and open GUIStudioMDL. Select OrangeBox in "SDK version" and select in "Target mod/gameinfo path" Obsidian Conflict (you must have configurated SDK for OC). Load the .QC file in file->load .qc file and push the "Compile" button.

Once GUIStudioMDL finished compiling (it will say "Completed "mdldecompiler.qc""), open Source SDK, select Source 2007 in "Engine version" and Obsidian Conflict in "Current game" (you need have to be configurated SDK for OC). Once HLMV get opened, go to file->load model and search your model.


And if everything are went good, you should be able to see your model with their animations.

Once you see that your model work, go to Obsidian/models/player folder and create a new text file. Call it with the same name of your model and put this:


ModelSettings
{
   //Use this option to choose a base script to use instead.
   "usefile"   "none"

   //base model rig to use. Use either Male_01 or Female_01 for best results.
   "basemodel"   "Male_01"

   //Voice Sound 0=none, 1=male, 2=female, 3=combine
   "voice"      "1"

   //Footstep Sound 1=shoe, 2=combine boots
   "footsteps"   "1"

   //Gibs, 1 = generic human, 2 = generic alien, 3 = human rebel ragdoll gibs, 4 = Ragdoll only
   "Gibs"      "4"
}

Using the values that come there, you can set the voice, sounds and gibs of the model.


Lastly, go to Obsidian/materials/VGUI/playermodels/player and create a .VMT file and .VTF file.

In the .VMT file (you can copy an existant one and clear it to use), put the following:


UnlitGeneric
{
// Original shader: BaseTimesVertexColorAlphaBlendNoOverbright
   "$translucent" "1"
   "$basetexture"   "vgui\playermodels\player\Hostage_01"
   "$vertexcolor" "1"
   "$vertexalpha" "1"
   "$no_fullbright" "1"
   "$ignorez"   "1"
   "$decalscale" "0.250"

}

In "$basetexture", change the "hostage_01" for the name of your .VTF file, that must be named like your model.


To create the .VTF file, take your photo, transform it to .tga, open it in VTFEdit and save it in .VTF format. Name it like your model.


Once you have colocated the two files in the Obsidian/materials/VGUI/playermodels/player path, test it in game (check if the VGUI image work properly). If everything work (animations, sounds, image...) then significates that you create with success a playermodel.