Random backgrounds


example pack here http://gamebanana.com/css/guis/27896


https://developer.valvesoftware.com/wiki/Menu_Background_Map
If you're wondering how to get a different background-wallpaper (and/or background map)
for (almost) each game start. Like in HL2 game.

Cvar

The game has a cvar that remembers where you left off the last chapter.

"sv_unlockedchapters" = "1"
 archive
 - Highest unlocked game chapter.
This cvar will not change in any phase of the (Cs:s) game.
  • So, you can open the game with the console and write this, sv_unlockedchapters 99.
  • Then exit the game.
  • This is now stored in your ...cstrike/cfg/config.cfg

    Chapters

  • You need to create the file ChapterBackgrounds.txt in ...cstrike/scripts/ (If it does not exist)
    "chapters"
    {
        "1" "background01"
        "2" "background02"
        "3" "background03"
        "4" "byanyothername"
    }
    
    The first parameter is the chapter number. The second parameter is the name of the background.
  • You can add more "chapters" as much as you want.
  • And have whole different background names instead backgroundxx
  • It's important that the background name match with background texture (*.vmt).
    Or you end up in this, missing texture

    Background texture

    The game is loading the background texture from here, ...cstrike/materials/console/

  • For each "chapter" have to do two *.vmt files. Example
    background01.vmt
    background01_widescreen.vmt
    background02.vmt
    background02_widescreen.vmt
    background03.vmt
    background03_widescreen.vmt
    byanyothername.vmt
    byanyothername_widescreen.vmt
  • Which contains the path of your desired *.vtf picture.
    (Which may be located somewhere else other than here in the same folder)
    "UnlitGeneric"
    {
        // Original shader: BaseTimesVertexColorAlphaBlendNoOverbright
    // Uncomment this if you add an alpha channel to the base texture
    //  "$translucent" 1
        "$basetexture" "dev/dev_signflammable01a" // Example
        "$vertexcolor" 1
        "$no_fullbright" 1
        "$ignorez" 1
    }
    


    This far, different background images should be in action.

    Background maps

  • Edit the file ...cstrike/cfg/valve.rc
  • and add command startupmenu
  • // load the base configuration
    //exec default.cfg
    r_decal_cullsize 1
    // Setup custom controller exec joystick.cfg
    // run a user script file if present exec autoexec.cfg
    // // stuff command line statements // stuffcmds
    // display the startup level startupmenu

    There are a few things that prevent the background maps working.

  • You have -console or -dev in game launch options
  • You don't have map named by "chapter" background name (obviously)
  • Also, some background maps will not work as desired when the game starts in multiplayer mode.
    Adding this cvar in launch options change the game in singleplayer mode.
    +maxplayers 1

    Finally, what I have already mentioned a moment ago. You need the background maps that is named after the "chapters".
    The maps must be located at this path ...cstrike/maps/
    example maps to above "chapters"
    background01.bsp
    background02.bsp
    background03.bsp
    byanyothername.bsp

    Oh noes! You're not a Member!

    Want access to cool stuff? As a member you can:

    • Post. Give the submitter your thoughts on this Tutorial.
    • Say Thanks. Show your appreciation by sending the submitter points.
    • Stamp Posts. Let other posters know what you think of their posts.
    • Rate. Give this Tutorial a rating out of 10.
    • Flag. Alert moderators and warn members of a problem with this Tutorial.
    • Vote. Vote the submitter for the Monthly Awards.
    • Subscribe. Get notified when this submitter submits again.

    Interested? Register or Login

    Comments

    None found

    Credits

    Submitter
    |Bacardi|'s Levels
    • P1: Beggar
      Points: 410
    • C1: Member
    • A4: Graduate
      Account Age: 2 years
    |Bacardi| (Creator/Co-creator)
    Key Authors
    |Bacardi|
    Original Authors
    Valve
    Source Wiki Dev

    Rating

    ?/10
    Not yet rated.

    Additional Info

    Genre
    Coding/Scripting, Other/Misc
    Difficulty Level
    Advanced

    Stats

    Post Count
    0
    ViewCount
    274
    Date Added
    15 days ago
    Date Modified
    15 days ago

    Share

    Embed Code
    Code to use:

    More embeddable images

    SubFeed