Modding Portal 2 Models

Avatar
Dewin
43 Posts
Posted Apr 30, 2011
I'm looking for a way to decompile Portal 2 models. Specifically, I'm looking to add a few skins to some of them.

Particularly I'd like to add new skins for some of the various light models so they have a "turned off" skin.

I'm aware of MDL Decompiler and StudioCompiler, but neither semm to be currently working with Portal 2 models. Any ideas?

Advertisement
Registered users don’t see ads! Register now!
Avatar
Dewin
43 Posts
Posted Apr 30, 2011
Replied 8 hours later
And my inner computer programmer (wait, is it really inner when I do that for a living?) discovered that the file format for MDL is fairly well documented and I might be able to write a utility to do just that.

Hmmm...

You know, if only I didn't have all these side projects related to mapping and could actually map. :-p

Avatar
naitoookami
20 Posts
Posted Apr 30, 2011
Replied 3 minutes later
to make new skins you dont have to decompile the models just search for their materials and edit them
Avatar
msleeper
4,136 Posts
Admin
Posted Apr 30, 2011
Replied 3 hours later
Adding skins is really simple, like naitoookami said you just Decompile them and then add a new skin when you recompile it. I'm not sure if the tools have been updated for Portal 2 (there is usually some sort of format change between game versions), but I don't know for sure.
Avatar
Dewin
43 Posts
Posted Apr 30, 2011
Replied 1 hour later

naitoookami wrote:
to make new skins you dont have to decompile the models just search for their materials and edit them

I didn't want to replace the original skins. I wanted to create an altered version of the model that adds more skins on top of the original ones.

msleeper wrote:
Adding skins is really simple, like naitoookami said you just Decompile them and then add a new skin when you recompile it. I'm not sure if the tools have been updated for Portal 2 (there is usually some sort of format change between game versions), but I don't know for sure.

The whole problem is I haven't managed to successfully decompile any Portal2 models in the first place.

I have, however, managed to successfully (using the program I'm writing) insert 300 bytes or so into the middle of a model file and have the model still (mostly) load in model viewer after patching up various things. The goal here is to be able to take an existing model, add a few textures to its catalog, and then add a few skins using the new textures. This requires increasing the size of various structures in the file and relocating them -- not easy, but fortunately the MDL format is fairly well documented.

Avatar
msleeper
4,136 Posts
Admin
Posted Apr 30, 2011
Replied 39 minutes later
You're reinventing the wheel. Just wait for the decompile/recompile tools to get updated and released and this operation will literally take 2 seconds.
Avatar
ollj
4 Posts
Posted May 02, 2011
Replied 1 day later
the .mdl format is very easy, its been used for over a decade in thousands of the best selling games ever by now and there are tons of tools and turorials for it.

how hard cann you fail?

Advertisement
Registered users don’t see ads! Register now!
Avatar
naitoookami
20 Posts
Posted May 02, 2011
Replied 11 hours later
ok didnt know you wanted an entirely different model all ya gotta do is edit the texture then hex the model you can look up model hexing on google