r/Tf2Scripts • u/mrstork89 • Dec 05 '19
Satisfied A Script that Picks a different map at every time it (cfg) is activated
I am changing the main menu background to an actual map in realtime during the launch of tf2 by putting a command (below) in a separate cfg and link it to Autoexec. Now I don't want it to show me the same map every time, so I can provide a list of default/stock maps.
map_background koth_viaduct
Replace "koth_viaduct" with different maps. It would also be nice if there were an option to add new maps with ease, but it's not a necessity. If it's too tedious for you to add all maps, tell me how to do it, I'll add them. Thanks to whoever does this. Ik it's possible as there's a spy disguise script that also picks random disguises. Random maps are fine too.
List of default maps: https://pastebin.com/prw7dm8e
1
u/KatenGaas Dec 06 '19
Not too sure on how map_background works. But assuming it does nothing until you restart the game, we could use this script, which calls mapCycle every time we autoexec. You can extend the cycle indefinitely. To make it more "random" you could add mapCycle to be called in class configs or your reset config, or even wasd
1
u/ArgosOfIthica Dec 06 '19
The Spy scripts I've seen gather entropy from user inputs, so if you're attempting to get a random map at launch, the method used for Spy scripts will not work for this.