Random background maps

Mess

Newbie
Joined
Oct 11, 2004
Messages
405
Reaction score
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!
 
I would really like to know this to ! please help "Mess" !!
 
I have been searching for the correct file to alter in my mod's directories but none seem to be what I am after.
 
what kind of mod are you working on ?
 
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?
 
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.
 
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.
 
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".
 
Back
Top