Random background maps

Discussion in 'Game Modifications' started by Mess, Mar 17, 2005.

  1. Mess

    Mess Newbie

    Joined:
    Oct 11, 2004
    Messages:
    405
    Likes Received:
    0
    Hi there,

    Can anyone point me in the direction of the code that randomly selects a background map? Like after you've completed HL2. I would like to implement this feature from the off-set in my mod.

    Any help much appreciated!
     
  2. Dodo

    Dodo Tank

    Joined:
    Aug 30, 2004
    Messages:
    2,142
    Likes Received:
    0
    I would really like to know this to ! please help "Mess" !!
     
  3. Mess

    Mess Newbie

    Joined:
    Oct 11, 2004
    Messages:
    405
    Likes Received:
    0
    I have been searching for the correct file to alter in my mod's directories but none seem to be what I am after.
     
  4. Dodo

    Dodo Tank

    Joined:
    Aug 30, 2004
    Messages:
    2,142
    Likes Received:
    0
    what kind of mod are you working on ?
     
  5. Mess

    Mess Newbie

    Joined:
    Oct 11, 2004
    Messages:
    405
    Likes Received:
    0
    A small single-player mod, but I don't want to use the chapter-style background maps, I want them to rotate randomly from the start.

    Any ideas?
     
  6. XxEtheralxX

    XxEtheralxX Guest

    Would it be possible to use the srand function? I remember back in HL1 coding, where the creatures would make a random sound. The code was in there. Check the HL2 SDK to see if the command is there for the monster sounds, and maybe you can use that with backgrounds.
     
  7. Mess

    Mess Newbie

    Joined:
    Oct 11, 2004
    Messages:
    405
    Likes Received:
    0
    After lots of searching I think I have found the answer.

    In SourceMods/YourMod/cfg/Config.cfg make sure that you have the value

    sv_unlocked chapters "1"

    I haven't tested this yet but it seems to be the only solution.
     
  8. Mess

    Mess Newbie

    Joined:
    Oct 11, 2004
    Messages:
    405
    Likes Received:
    0
    Upon further testing the value you give "sv_unlockedchapters" will be the number of chapters unlocked. So if you give it the value "3", the background map for the 3rd chapter will be your background map.

    Will test further the value needed to create randomly spawning background maps. Let's hope its something nice and simple like "0".
     

Share This Page