I'll try to stay wikipedia on this guide, but this was seriously fucking frustrating to figure out and I hope it no longer has to be for anybody anymore. Also if anybody has a better way to do this please post, I tried using 7-zip but LZMA compression ruins everything and pakrat pisses all over itself and the map if you try to save with it.
Please try sv_skyname first. You have to type it like this:
sv_skyname tf2_sky_04
sv_skyname sky_well_01
sv_skyname sky_hydro_01
No directions in the names. I can't nail down when it was fixed but it is fixed now. Do it and ignore this guide unless you need to run an old version of TF2.
This guide is mainly for lawena users but all lawema really does is automate copying skyboxes and switching custom folders, so this is all generalizable beyond just skyboxes and doable without lawena just using the custom folder.
tools that are required in case 2:
http://www.riintouge.com/VIDE/
https://github.com/ata4/bspsrc/releases
https://github.com/ruarai/CompilePal/releases
A lot of people encounter issues when they try to lawena-replace skyboxes on custom maps, or custom maps with custom skyboxes.
This is either because the map is using a skybox tf2 has by default that lawena isn't replacing, or overriding the skybox with its embedded version.
In the first case all you have to do is extract all the skybox materials (vmt and vtf) from
tf/tf2_misc_dir.vpk,
tf/tf2_textures_dir.vpk,
hl2/hl2_misc_dir.vpk,
hl2/hl2_textures_dir.vpk and put them into your lawena install's skybox folder. It will be able to replace those from now on, and you'll also be able to replace skyboxes to them.
https://rapidgrab.net/i/ztbL6.png
The second case is much more involved and requires editing the map, but you don't have to recompile.
To begin, check if you can open it with vide. Open vide, open the pakfile editor (rightmost icon) and try to open your bsp.
If you get a list of files like this:
https://rapidgrab.net/i/VBnNP.png
Then you're good, go in and delete all the skybox VTF & VMTs. [click > un/delete > save bsp]
You should be able to replace the sky like normal after that, since the map has no VTFs of its own to override with it will use yours.
But if vide gives you an incomplete read error:
https://rapidgrab.net/i/iazuG.png
You'll have to decompress it, and then extract and destroy all the materials in it.
Open a CMD window and type this:
"C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\bspzip.exe" -repack "full path to your map, just drag the map file onto the window so it auto-types the path for you"
and hit enter.
https://rapidgrab.net/i/w6vpA.png
It should say 'successfully repacked' when it's done.
Now open bspsrc and hit the 'other' tab. Check 'extract embedded files'
and untick 'smart extracting' (we need cubemaps to be extracted)
NOTE: If you wanna be a little bitch about things you could rebuild the cubemaps, which will make reflections reflect your new skybox instead of the first one. Keep smart extract enabled and don't bother renaming any folders in the extracted materials step. Check cubemaps in compilepal (I think on publish so hdr and ldr are made, make sure no source games are running or it will fail) or type buildcubemaps in console to make new ones once you've replaced the skybox. You'll have to do this for every new sky texture you put in if you really want accurate reflections.
then go back to the maps tab and drag your map onto it, and hit decompile
Make sure you don't decompile to the tf folder, because we have to use the folders in it later.
https://rapidgrab.net/i/nLOir.png
https://rapidgrab.net/i/eaWQ5.png
Go to your decompiled map's materials and copy everything in the skybox folder to your lawena install/skybox.
Then, in decompiled materials folder, delete every VTF related to the skybox. The map will be re-packed without them.
https://rapidgrab.net/i/wQHbq.png
Now it's time to destroy all the material files in the uncompressed map. We'll be putting all but the skybox VTFs back in a moment.
Open CMD and type
"C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\bspzip.exe" -deletecubemaps "full path to your map"
I know that sounds stupid but the command is broken and deletes every VTF
If they ever change -deletecubemaps, I don't know a way to delete the vtf files, so you'd have to rename all the $basetextures in the VMT files to some other sky vtf texture before the next step.
Some maps have different properties on their skyboxes that will misalign any replacement skyboxes that are put in. These are specified in the VMT files. We'd delete them too if we could, but until a way to do this without recompiling is discovered, they're stuck in there. We can only edit them. Not all skyboxes have it, but check all the extracted vmt files in the decompiled materials/skybox folder now for "$basetexturetransform".
You can delete the line, but it's probably safer and faster to //comment it out like this.
https://rapidgrab.net/i/8Nz72.png
https://rapidgrab.net/i/tC6s7.png
Sometimes they also just decide to have opposite VMT $basetexture values. You'll just have to have a careful eye.
Nevermind below paragraph, you probably have demos that already have a specified map name, just hold the edited map files somewhere else and switch them out during recording
In order to avoid constantly renaming in order to play normally or having broken cubemaps in the final BSP, we're going to have a different name for the map when it's exported, and that means a different name for the cubemap folder is required. Go into your decompiled map's /materials/maps/mapname and rename the folder to something else like mapname_noskyvtf.
There's also another one, don't ask why, materials/maps/mapname/maps/mapname/, rename that one too
[img]https://rapidgrab.net/i/4nkNz.png[/img]
They must match the final BSP name once you pack, so rename yourmap.bsp and yourmap_d.vmf to their new name now.
Now we need to pack everything but the skybox texture we deleted back into the BSP. Check all the folders that came out of bspsrc and if they exist in /tf, rename them so they won't add redundant embedded default textures to the final repack.
Then drag the folders into /tf.
https://rapidgrab.net/i/UlzS9.png
Now open compilepal and select TF2. If you don't see your TF2 in the selection prompt, go to TF2/bin, open and close hammer.exe once and open compilepal again.
You need your map's BSP in tf/maps for this step.
Add your map's decompiled VMF and select either publish option (or just whatever shows the pack checkbox, or add it manually)
Uncheck everything but pack.
https://rapidgrab.net/i/9Eekl.png
hit 'compile' to automatically embed all the stuff you put in /tf earlier.
This shouldn't take long.
https://rapidgrab.net/i/BNWHq.png
and you're finally done, dispose of the folders you dragged into TF and un-rename the ones you renamed last step.
Select whatever skybox you want from lawena's list and do your thing.
If you want the map to be as small as it was run bspzip on the map with -repack -compress.
POC: Reckoner, no sky vtfs: https://mega.nz/file/WZEBHYwI#0EzfGBEqLPHzrsYT8wJ2lVIlgEZYdx73v1J__RUXkqM
And, extended lawena skybox logic in case it helps anyone:
https://rapidgrab.net/i/xWJHE.png
I'll try to stay wikipedia on this guide, but this was seriously fucking frustrating to figure out and I hope it no longer has to be for anybody anymore. Also if anybody has a better way to do this please post, I tried using 7-zip but LZMA compression ruins everything and pakrat pisses all over itself and the map if you try to save with it.
[b]Please try sv_skyname first. You have to type it like this:
sv_skyname tf2_sky_04
sv_skyname sky_well_01
sv_skyname sky_hydro_01
No directions in the names. I can't nail down when it was fixed but it is fixed now. Do it and ignore this guide unless you need to run an old version of TF2.
[/b]
This guide is mainly for lawena users but all lawema really does is automate copying skyboxes and switching custom folders, so this is all generalizable beyond just skyboxes and doable without lawena just using the custom folder.
tools that are required in case 2:
http://www.riintouge.com/VIDE/
https://github.com/ata4/bspsrc/releases
https://github.com/ruarai/CompilePal/releases
A lot of people encounter issues when they try to lawena-replace skyboxes on custom maps, or custom maps with custom skyboxes.
This is either because the map is using a skybox tf2 has by default that lawena isn't replacing, or overriding the skybox with its embedded version.
In the first case all you have to do is extract all the skybox materials (vmt and vtf) from
tf/tf2_misc_dir.vpk,
tf/tf2_textures_dir.vpk,
hl2/hl2_misc_dir.vpk,
hl2/hl2_textures_dir.vpk and put them into your lawena install's skybox folder. It will be able to replace those from now on, and you'll also be able to replace skyboxes to them.
[img]https://rapidgrab.net/i/ztbL6.png[/img]
The second case is much more involved and requires editing the map, but you don't have to recompile.
To begin, check if you can open it with vide. Open vide, open the pakfile editor (rightmost icon) and try to open your bsp.
If you get a list of files like this: [img]https://rapidgrab.net/i/VBnNP.png[/img]
Then you're good, go in and delete all the skybox VTF & VMTs. [click > un/delete > save bsp]
You should be able to replace the sky like normal after that, since the map has no VTFs of its own to override with it will use yours.
But if vide gives you an incomplete read error: [img]https://rapidgrab.net/i/iazuG.png[/img]
You'll have to decompress it, and then extract and destroy all the materials in it.
Open a CMD window and type this:
[code]"C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\bspzip.exe" -repack "full path to your map, just drag the map file onto the window so it auto-types the path for you"[/code]
and hit enter. [img]https://rapidgrab.net/i/w6vpA.png[/img]
It should say 'successfully repacked' when it's done.
Now open bspsrc and hit the 'other' tab. Check 'extract embedded files'
and untick 'smart extracting' (we need cubemaps to be extracted)
[code]NOTE: If you wanna be a little bitch about things you could rebuild the cubemaps, which will make reflections reflect your new skybox instead of the first one. Keep smart extract enabled and don't bother renaming any folders in the extracted materials step. Check cubemaps in compilepal (I think on publish so hdr and ldr are made, make sure no source games are running or it will fail) or type buildcubemaps in console to make new ones once you've replaced the skybox. You'll have to do this for every new sky texture you put in if you really want accurate reflections.[/code]
then go back to the maps tab and drag your map onto it, and hit decompile
Make sure you don't decompile to the tf folder, because we have to use the folders in it later.[img]https://rapidgrab.net/i/nLOir.png[/img] [img]https://rapidgrab.net/i/eaWQ5.png[/img]
Go to your decompiled map's materials and copy everything in the skybox folder to your lawena install/skybox.
Then, in decompiled materials folder, delete every VTF related to the skybox. The map will be re-packed without them. [img]https://rapidgrab.net/i/wQHbq.png[/img]
Now it's time to destroy all the material files in the uncompressed map. We'll be putting all but the skybox VTFs back in a moment.
Open CMD and type
[code]"C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2\bin\bspzip.exe" -deletecubemaps "full path to your map"[/code]
[url=https://developer.valvesoftware.com/wiki/BSPZIP#Handling_cubemaps]I know that sounds stupid but the command is broken and deletes every VTF[/url]
If they ever change -deletecubemaps, I don't know a way to delete the vtf files, so you'd have to rename all the $basetextures in the VMT files to some other sky vtf texture before the next step.
Some maps have different properties on their skyboxes that will misalign any replacement skyboxes that are put in. These are specified in the VMT files. We'd delete them too if we could, but until a way to do this without recompiling is discovered, they're stuck in there. We can only edit them. Not all skyboxes have it, but check all the extracted vmt files in the decompiled materials/skybox folder now for "$basetexturetransform".
You can delete the line, but it's probably safer and faster to //comment it out like this.[img]https://rapidgrab.net/i/8Nz72.png[/img] [img]https://rapidgrab.net/i/tC6s7.png[/img]
Sometimes they also just decide to have opposite VMT $basetexture values. You'll just have to have a careful eye.
[u]Nevermind below paragraph, you probably have demos that already have a specified map name, just hold the edited map files somewhere else and switch them out during recording[/u]
[code]In order to avoid constantly renaming in order to play normally or having broken cubemaps in the final BSP, we're going to have a different name for the map when it's exported, and that means a different name for the cubemap folder is required. Go into your decompiled map's /materials/maps/mapname and rename the folder to something else like mapname_noskyvtf.
There's also another one, don't ask why, materials/maps/mapname/maps/mapname/, rename that one too
[img]https://rapidgrab.net/i/4nkNz.png[/img]
They must match the final BSP name once you pack, so rename yourmap.bsp and yourmap_d.vmf to their new name now.[/code]
Now we need to pack everything but the skybox texture we deleted back into the BSP. Check all the folders that came out of bspsrc and if they exist in /tf, rename them so they won't add redundant embedded default textures to the final repack.
Then drag the folders into /tf. [img]https://rapidgrab.net/i/UlzS9.png[/img]
Now open compilepal and select TF2. If you don't see your TF2 in the selection prompt, go to TF2/bin, open and close hammer.exe once and open compilepal again.
You need your map's BSP in tf/maps for this step.
Add your map's decompiled VMF and select either publish option (or just whatever shows the pack checkbox, or add it manually)
Uncheck everything but pack. [img]https://rapidgrab.net/i/9Eekl.png[/img]
hit 'compile' to automatically embed all the stuff you put in /tf earlier.
This shouldn't take long. [img]https://rapidgrab.net/i/BNWHq.png[/img]
and you're finally done, dispose of the folders you dragged into TF and un-rename the ones you renamed last step.
Select whatever skybox you want from lawena's list and do your thing.
If you want the map to be as small as it was run bspzip on the map with -repack -compress.
POC: Reckoner, no sky vtfs: https://mega.nz/file/WZEBHYwI#0EzfGBEqLPHzrsYT8wJ2lVIlgEZYdx73v1J__RUXkqM
And, extended lawena skybox logic in case it helps anyone: [img]https://rapidgrab.net/i/xWJHE.png[/img]