Texures

Avatar
portal2companioncube
108 Posts
Posted Feb 26, 2012
Is there a way to modify a texture? I'm putting a grass texture in my map, but it's letting me shoot portals on it. Is there a way to make it a non-portalable surface? And, yes, there is a non-portalable surface underneath it.
Advertisement
Registered users don’t see ads! Register now!
Avatar
CamBen
973 Posts
Posted Feb 26, 2012
Replied 8 minutes later
My best guess is to put a nodraw texture or anything else non-portable and invisible a tiny layer over the grass.
Avatar
Lpfreaky90
2,842 Posts
Posted Feb 26, 2012
Replied 24 minutes later
Yes, you can edit textures.

Most important thing to know about source textures: they consist of a vmf and vmt file.
VMF = the image (Dimensions need to be a power of 2. (so 1,2,4,8,16,32,64,128,256,512 (or 1024 but this might need some more tweaking))

VMT = a text file to describe how a texure must be in-game.
The VMT is what you want to edit in this case. Just open the VMT file with notepad and you'll see something like this:

As an example I took nature/forest_grass_01:

LightmappedGeneric
{
$baseTexture "nature/forest_grass_01"
$surfaceprop dirt
"%keywords" ep2
}

$baseTexture is the texture (the vmf file) that is used by this material.
$surfaceprop is the type of texture this is. This determines the sounds that you make on them. This behaviour is regulated by <game>\scripts\surfaceproperties_manifest.txt
%keywords is something you can set so it's easier to find.

Because you don't want to overwrite other people's textures, I ALWAYS put my custom materials in a special sub-folder (in my case portal 2/portal2/materials/Lp.)

So, next step is to copy/paste this text in a new notepad file. (I'll call this one grass_forest_01_noportal.) And save it in portal 2/portal2/materials/Lp.

To actually tell the engine that you can't place portals on a surface add

&quot;%noportal&quot; 1

That was easy!

Then it's time to do the actual modification:

LightmappedGeneric
{
$baseTexture &quot;nature/forest_grass_01&quot;
$surfaceprop dirt
&quot;%keywords&quot; noportal
&quot;%noportal&quot; 1
}

And now you should have a nice piece of grass where you can't place portals on.

Hope that was helpful :smile:
~Lp

Avatar
CamBen
973 Posts
Posted Feb 26, 2012
Replied 5 minutes later
I was just about to edit my post after messing w/ a vmt, trying to make a companion cube poster into my "chell's house" map. (and it worked!)
Avatar
portal2companioncube
108 Posts
Posted Feb 27, 2012
Replied 1 day later

CamBen wrote:
My best guess is to put a nodraw texture or anything else non-portable and invisible a tiny layer over the grass.

When I tried that, it made all the colors smear together. If you've played "Weighted Wonderland" it kind of does the same thing. It only happened on the area where I put the "nodraw" texture. Everywhere else it was fine, but on the ground everything just smeared together.

Avatar
portal2companioncube
108 Posts
Posted Feb 27, 2012
Replied 3 minutes later

lpfreaky90 wrote:
Yes, you can edit textures.

Most important thing to know about source textures: they consist of a vmf and vmt file.
VMF = the image (Dimensions need to be a power of 2. (so 1,2,4,8,16,32,64,128,256,512 (or 1024 but this might need some more tweaking))

VMT = a text file to describe how a texure must be in-game.
The VMT is what you want to edit in this case. Just open the VMT file with notepad and you'll see something like this:

As an example I took nature/forest_grass_01:
```
LightmappedGeneric
{
$baseTexture "nature/forest_grass_01"
$surfaceprop dirt
"%keywords" ep2
}

> $baseTexture is the texture (the vmf file) that is used by this material.
> $surfaceprop is the type of texture this is. This determines the sounds that you make on them. This behaviour is regulated by <game>\scripts\surfaceproperties_manifest.txt
> %keywords is something you can set so it's easier to find.
>
> Because you don't want to overwrite other people's textures, I ALWAYS put my custom materials in a special sub-folder (in my case portal 2/portal2/materials/Lp.)
>
> So, next step is to copy/paste this text in a new notepad file. (I'll call this one grass_forest_01_noportal.) And save it in portal 2/portal2/materials/Lp.
>
> To actually tell the engine that you can't place portals on a surface add
> ```
"%noportal" 1

That was easy!

Then it's time to do the actual modification:
```
LightmappedGeneric
{
$baseTexture "nature/forest_grass_01"
$surfaceprop dirt
"%keywords" noportal
"%noportal" 1
}

```

And now you should have a nice piece of grass where you can't place portals on.

Hope that was helpful :smile:
~Lp

Okay, this is so weird. The texture you used shows up in the texture browser, but it doesn't show up in Windows Explorer. It's like it's using a texture that doesn't exist. I checked the cache files for Portal 2 Authoring Tools and Portal 2; they both had a few files missing that were then downloaded, but I checked for that texture again and it still wasn't there. Do you know why this is?

Avatar
BEARD!
169 Posts
Posted Feb 27, 2012
Replied 9 minutes later
Is the texture file inside one of the gcfs vpks? They're located in steamapps\common\portal 2\portal2 and GCFScape can read them.

EDIT: as pointed out, Portal 2 uses vpks

Avatar
Spam Nugget
492 Posts
Posted Feb 27, 2012
Replied 58 minutes later
Yeah it will be in there, but remember that in portal 2 they are in vpks, not gcfs. GCFScape will still open them. The one you will want to open is pak01_dir.vpk, this is the only one you will need to bother with.
Avatar
Lpfreaky90
2,842 Posts
Posted Feb 27, 2012
Replied 2 hours later
Both the vmt and vmf files are not in your folders, they are in pak01_dir.vpk. But that doesn't really matter, just adding this custom vmt file to your portal 2/portal2/materials/<something>/ should work :wink:

For portal 2 it doesn't matter if the texture is in the vpk or in the materials/ folder. And references to textures in the vpk work perfectly fine. :smile:

Avatar
portal2companioncube
108 Posts
Posted Feb 28, 2012
Replied 21 hours later
I think it's because the map is so spread out. It's not big, really; it's just spread out, if that makes sense. Eventually I got it to compile. I tried compiling at different points in the map and eventually got it to work. I made some changes and now I'm having trouble finding that spot, again. I got that disabled, but it's still not working. Again, I tried loading the pointfile, now it's showing a red line going from the top of the map, to the bottom, and back to the top again without touching any brushes or entities. WHAT'S GOING ON?!?!?!?!?! :thumbdown: :1dn: :thumbdown: :1dn:
Avatar
Lpfreaky90
2,842 Posts
Posted Feb 28, 2012
Replied 10 minutes later
Could you upload your vmf so I can take a look at it?
Advertisement
Registered users don’t see ads! Register now!
Avatar
portal2companioncube
108 Posts
Posted Feb 28, 2012
Replied 18 minutes later
Sorry, that last post was meant to go in the topic, "Leaks." I accidentally put it in here.