AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Source Servers (SRCDS) (https://forums.alliedmods.net/forumdisplay.php?f=130)
-   -   [CSGO] Auto generate maplist.txt mapcycle.txt (https://forums.alliedmods.net/showthread.php?t=330430)

busted 02-03-2021 19:31

[CSGO] Auto generate maplist.txt mapcycle.txt
 
1 Attachment(s)
I am tired of copying every name of my maps into the maplist and mapcycle files. When you have +100 maps it's very long and very boring.
So I looked for a plugins but I did not find.

So I made a linux script to automatically generate these files.


Features
  • delete the old maplist and mapcycle.txt files
  • searches all maps, including in the workshop folder
  • Rewrites maplist and mapcycle files and places them in the correct folder

Requirements

  • dos2unix package
Code:

apt-get install dos2unix

Installation

  • create a file and paste the code below or download the file.
  • Replace "YOURPATH" by yours
  • type this before run
Code:

dos2unix map
  • run it !

CODE
Code:

rm /home/YOURPATH/csgo/maplist.txt;
rm /home/YOURPATH/csgo/mapcycle.txt;
cd /home/YOURPATH/csgo &&
find maps/ -type f -name "*.bsp*" > /home/YOURPATH/csgo/maplist.txt &&
find maps/ -type f -name "*.bsp*" > /home/YOURPATH/csgo/mapcycle.txt &&
sed -i 's/.bsp//g' /home/YOURPATH/csgo/maplist.txt &&
sed -i 's/.bsp//g' /home/YOURPATH/csgo/mapcycle.txt &&
sed -i 's/^maps//' /home/YOURPATH/csgo/maplist.txt &&
sed -i 's/^maps//' /home/YOURPATH/csgo/mapcycle.txt &&
sed -i 's/^.//' /home/YOURPATH/csgo/maplist.txt &&
sed -i 's/^.//' /home/YOURPATH/csgo/mapcycle.txt




and that's all

Bacardi 02-03-2021 21:41

Re: [CSGO] Auto generate maplist.txt mapcycle.txt
 
In SourceMod plugins, like basecommands, if you set invalid map file (by default, it is already), plugin list all maps automatically from maps folder.

When you want use map file instead, you need make changes in ...addons/sourcemod/configs/maplists.cfg

*edit
Because we are talking about CSGO, you need keep in mind, there are two kind map cycle system.
- CSGO game own map cycle by gamemodes.txt
- SourceMod map cycle by hidden cvar mapcyclefile, mapcycle.txt is default.

Sarrus 02-22-2021 06:55

Re: [CSGO] Auto generate maplist.txt mapcycle.txt
 
Looks very nice!

One suggestion: add a "blacklist.txt" file to ignore some maps, would be cool to avoid stock maps such as blacksite, dust2 etc

sil_El_mot 01-20-2023 12:18

Re: [CSGO] Auto generate maplist.txt mapcycle.txt
 
here is a one liner i use without any additional software needed:

Code:

find maps/ -type f -name "*.bsp*" | sed 's!.*/!!' | sed 's!.bsp!!' | tee maplist.txt mapcycle.txt


All times are GMT -4. The time now is 14:00.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.