I've been trying to figure out how to make TF2 display a random map as the menu background, and I want to see if anybody else can help. I know about map_background, but that can't randomize.
Okay, here's the gist of it:
In Team Fortress 2 Content.gcf, there is a file under tf/scripts titled "ChapterBackgrounds.txt." This file controls the background that shows up when you start TF2. [url=http://developer.valvesoftware.com/wiki/Menu_Background_Map]Here's the relevant article on the Valve Developer Community.[/url]
Here's the file itself:
[code]
"chapters"
{
1 "title_red"
2 "title_red"
3 "title_blue"
4 "title_blue"
}
"BackgroundMaps"
{
1 "background01"
2 "background01"
3 "background01"
4 "background01"
}
[/code]
In theory, I should simply be able to replace the "title_red"s and "title_blue"s with map names. However, this results in the initial loading screen being replaced with the map loading screen (background01.vtf in materials/console) and the menu background becoming the purple-checkerboard of missing textures. Presumably, this is because the game expects a .vtf instead of a map, but I don't know how to change this. The VDC suggests that this has something to do with the valve.rc file in tf/cfg, but this doesn't seem to be the case; TF2's valve.rc is effectively identical to Portal's (which uses a map background). The only difference is that TF2 has "sv_unlockedchapters 99" at the end, which makes the backgrounds randomize.
I also tried copying a map and renaming it title_blue and title_red. It didn't work.
EDIT: I just took a look at the valve.rc for CSS (which doesn't use a map background). It doesn't have the startupmenu command that the VDC mentions, but that's it.
I'm pretty much out of leads at this point. Any ideas?
damn, I would really like this. Hope you get it to work.
you could just run the "map_backround" command in the autoexec
I don't normally like doing this, but the timing of the original post was kind of poor, so... bump.
Isn't there a random chance command? Maybe you could use that in autoexec along with map_background to make it random
[QUOTE=Murkrow;16979323]Isn't there a random chance command? Maybe you could use that in autoexec along with map_background to make it random[/QUOTE]
I did a search on the VDC, and I'm pretty sure there's no such command.
I'd like this too!
[url]http://www.fpsbanana.com/guis/15378[/url]
[QUOTE=Wootman;16983417][url]http://www.fpsbanana.com/guis/15378[/url][/QUOTE]
Already took a look at that. It just adds a map_background command to valve.rc and a customized version of Dustbowl's last point. Perfect if you only want one background, but it doesn't help here.
Sorry, you need to Log In to post a reply to this thread.