Rusted Cube Button
Quote from TreasureGhost on October 15, 2015, 1:42 pmApparently valve didn't design a rusted model for it, does someone have any tips of how making it look rusted in overgrown or a model of it?
Gladly appreciated, thanksTreasureGhost
Apparently valve didn't design a rusted model for it, does someone have any tips of how making it look rusted in overgrown or a model of it?
Gladly appreciated, thanks
TreasureGhost
Quote from DaMaGepy on October 15, 2015, 3:03 pmthere are destroyed button models, where parts are missing... for exemple:
models/props/portal_button_damaged02.mdl
models/props/portal_button_damaged01.mdl
there are destroyed button models, where parts are missing... for exemple:
models/props/portal_button_damaged02.mdl
models/props/portal_button_damaged01.mdl
Quote from Gemarakup on October 15, 2015, 4:09 pmMake a reskinned model. If you know how to edit textures properly. Then it involves making a hexed model and some stuff. So, if you're willing... http://forums.thinking.withportals.com/post45825.html?hilit=%20hex#p45825 The models above aren't square. Unless by "cube button" you mean "button". In that case, you just change the model value to one of those models.
Make a reskinned model. If you know how to edit textures properly. Then it involves making a hexed model and some stuff. So, if you're willing... http://forums.thinking.withportals.com/post45825.html?hilit=%20hex#p45825 The models above aren't square. Unless by "cube button" you mean "button". In that case, you just change the model value to one of those models.
Quote from TreasureGhost on October 15, 2015, 11:42 pmA cube button is a button that was designed only for cubes.
A cube button is a button that was designed only for cubes.
Quote from Gemarakup on October 16, 2015, 6:07 amTreasureGhost wrote:A cube button is a button that was designed only for cubes.Yes, and since there isn't a rusted model, you need to make a reskined model.
Yes, and since there isn't a rusted model, you need to make a reskined model.
Quote from josepezdj on October 16, 2015, 2:20 pm@TreasureGhost: This is the way to go:
1. Locate the model into your model browser by simply typing "button" and searching for the cube-button. Check out its full location. In this case: "models/props/box_socket.mdl".
2. Use GCFScape to open the packed file where you have the majority of Portal2 files: ".../common/portal 2/portal2/pak01_dir.VPK". You'll notice there's a folder structure inside the packed .VPK file. You'll see the "materials" and the "models" folder. You can select a bunch of files, right-click and export whatever files to your local folders, or just drag them out of the GCFScape's window to any of your local folder's window or to your desktop. Bare in mind that every model is composed of (at least) 5 files; let's see this model:
Oh, one tip about searching into GFCScape: hit Ctrl+F to find whatever, and when the Find window pops up, select "Substring" from the drop-down menu in the "Match" dialog box. This is what I did in that screenshot above...
3. Usually, in order to know exactly what textures the model is using, it's recommendable to open the model file .MDL in whatever Hex Editor. Let's take a look in the "box_socket.mdl" model:
- First look:
The first line tells the model name and its path within the 'models' folder- We'll need to scroll down to the very bottom part of the window:
4. OK, now we know the 2 materials the model is using and the path for them. We can use GFCScape to extract these materials and the associated textures. So extract these 4 files:
- box_socket.VMT (material file)
- box_socket.VTF (texture file)
- box_socket_orange.VMT (material file)
- box_socket_orange.VTF (texture file)5. You'll need now the VTFEdit to open the .VTF texture files and export then to an editable format, like for example .JPG. Edit the textures as you like and then save them again. Depending on the image editor that you use you'll need a plugin to be able to save directly to .VTF format (there are 2 available that I know of: for Paint.Net and for PS). Otherwise you can import (Ctrl+I) your edited textures into VTFEdit and then save them again as .VTF
6. Now you should have a model that reads your materials/textures. This can be achieved mainly by 2 different methods:
- Hexing the model file.
- Decompiling the model, editing the .QC file and the reference.SMD file, and then recompiling the model again.Obviously the first option is the quickest and more stable one. Crowbar decompiles-recompiles quite efficiently the vast majority of the models, although not all of them.
Take into account the following points about hexing a model:
- What you see into the hex editor is a bunch of code; you can't understand many of these symbols but they are very important for the model to work properly! You can't erase, move or edit any of them, ok?
- You must focus in the letters that you can identify... You must position the cursor right on top of the letter you want to change and then type the new letter, that's all. NEVER use the backspace key! you'll get everything moved from position and will screw up your model. In the case you want to correct a letter you just wrote, go backwards with the left arrow key and type the letter again.
OK, the goal when hexing a model is to change the paths inside it to make it look for our custom textures. Due to the restrictions I just mentioned above, you should make sure the number of letters of the paths and names are exactly the same as they currently are. For example, I use to have my hexed models coming from the 'props' models folder into my local folder called 'hexed'. Both are 5 letters long.
After hexing the box_socket.MDL file following my example, it will end up like this:
- Top part
- Bottom part
Save your model after editing it
7. For your hexed model to work, you'll obviously have to put the 5 files you have (the model file .MDL and the rest 4 you extracted) in place, into the "common/portal 2/portal2/models/hexed" local folder you must create. Then, you'll need your edited material/texture files (box_socket.VMT, box_socket.VTF, box_socket_orange.VMT and box_socket_orange.VTF) inside: "common/portal 2/portal2/materials/models/hexed"
And the final step is to edit the path inside the .VMT material files:
From
- Code: Select all
VertexLitGeneric
{
$basetexture "models/props/box_socket"
$selfillum 1
$bumpmap "models/props/metal_box_normal"
$phong 1$phongboost 4
$phongfresnelranges "[1 1.5 2]"
}To
- Code: Select all
VertexLitGeneric
{
$basetexture "models/hexed/box_socket"
$selfillum 1
$bumpmap "models/props/metal_box_normal"
$phong 1$phongboost 4
$phongfresnelranges "[1 1.5 2]"
}I hope it's all clear, give me a buzz if you need a hand on it
@TreasureGhost: This is the way to go:
1. Locate the model into your model browser by simply typing "button" and searching for the cube-button. Check out its full location. In this case: "models/props/box_socket.mdl".
2. Use GCFScape to open the packed file where you have the majority of Portal2 files: ".../common/portal 2/portal2/pak01_dir.VPK". You'll notice there's a folder structure inside the packed .VPK file. You'll see the "materials" and the "models" folder. You can select a bunch of files, right-click and export whatever files to your local folders, or just drag them out of the GCFScape's window to any of your local folder's window or to your desktop. Bare in mind that every model is composed of (at least) 5 files; let's see this model:
Oh, one tip about searching into GFCScape: hit Ctrl+F to find whatever, and when the Find window pops up, select "Substring" from the drop-down menu in the "Match" dialog box. This is what I did in that screenshot above...
3. Usually, in order to know exactly what textures the model is using, it's recommendable to open the model file .MDL in whatever Hex Editor. Let's take a look in the "box_socket.mdl" model:
- First look:
The first line tells the model name and its path within the 'models' folder
- We'll need to scroll down to the very bottom part of the window:
4. OK, now we know the 2 materials the model is using and the path for them. We can use GFCScape to extract these materials and the associated textures. So extract these 4 files:
- box_socket.VMT (material file)
- box_socket.VTF (texture file)
- box_socket_orange.VMT (material file)
- box_socket_orange.VTF (texture file)
5. You'll need now the VTFEdit to open the .VTF texture files and export then to an editable format, like for example .JPG. Edit the textures as you like and then save them again. Depending on the image editor that you use you'll need a plugin to be able to save directly to .VTF format (there are 2 available that I know of: for Paint.Net and for PS). Otherwise you can import (Ctrl+I) your edited textures into VTFEdit and then save them again as .VTF
6. Now you should have a model that reads your materials/textures. This can be achieved mainly by 2 different methods:
- Hexing the model file.
- Decompiling the model, editing the .QC file and the reference.SMD file, and then recompiling the model again.
Obviously the first option is the quickest and more stable one. Crowbar decompiles-recompiles quite efficiently the vast majority of the models, although not all of them.
Take into account the following points about hexing a model:
- What you see into the hex editor is a bunch of code; you can't understand many of these symbols but they are very important for the model to work properly! You can't erase, move or edit any of them, ok?
- You must focus in the letters that you can identify... You must position the cursor right on top of the letter you want to change and then type the new letter, that's all. NEVER use the backspace key! you'll get everything moved from position and will screw up your model. In the case you want to correct a letter you just wrote, go backwards with the left arrow key and type the letter again.
OK, the goal when hexing a model is to change the paths inside it to make it look for our custom textures. Due to the restrictions I just mentioned above, you should make sure the number of letters of the paths and names are exactly the same as they currently are. For example, I use to have my hexed models coming from the 'props' models folder into my local folder called 'hexed'. Both are 5 letters long.
After hexing the box_socket.MDL file following my example, it will end up like this:
- Top part
- Bottom part
Save your model after editing it
7. For your hexed model to work, you'll obviously have to put the 5 files you have (the model file .MDL and the rest 4 you extracted) in place, into the "common/portal 2/portal2/models/hexed" local folder you must create. Then, you'll need your edited material/texture files (box_socket.VMT, box_socket.VTF, box_socket_orange.VMT and box_socket_orange.VTF) inside: "common/portal 2/portal2/materials/models/hexed"
And the final step is to edit the path inside the .VMT material files:
From
- Code: Select all
VertexLitGeneric
{
$basetexture "models/props/box_socket"
$selfillum 1
$bumpmap "models/props/metal_box_normal"
$phong 1$phongboost 4
$phongfresnelranges "[1 1.5 2]"
}
To
- Code: Select all
VertexLitGeneric
{
$basetexture "models/hexed/box_socket"
$selfillum 1
$bumpmap "models/props/metal_box_normal"
$phong 1$phongboost 4
$phongfresnelranges "[1 1.5 2]"
}
I hope it's all clear, give me a buzz if you need a hand on it