Raised This Month: $12 Target: $400
 3% 

[CSGO] Auto generate maplist.txt mapcycle.txt


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
busted
Member
Join Date: Jan 2021
Location: Konoha
Old 02-03-2021 , 19:31   [CSGO] Auto generate maplist.txt mapcycle.txt
Reply With Quote #1

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
Attached Files
File Type: zip map.zip (284 Bytes, 149 views)
busted is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-03-2021 , 21:41   Re: [CSGO] Auto generate maplist.txt mapcycle.txt
Reply With Quote #2

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.

Last edited by Bacardi; 02-03-2021 at 21:46.
Bacardi is offline
Sarrus
Member
Join Date: May 2020
Location: France
Old 02-22-2021 , 06:55   Re: [CSGO] Auto generate maplist.txt mapcycle.txt
Reply With Quote #3

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
__________________
Discord Coding Server | Steam Profile | Community Website | Github Profile

Taking paid requests (add me on Discord)
Sarrus is offline
sil_El_mot
Member
Join Date: Jan 2015
Old 01-20-2023 , 12:18   Re: [CSGO] Auto generate maplist.txt mapcycle.txt
Reply With Quote #4

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

Last edited by sil_El_mot; 01-20-2023 at 12:19.
sil_El_mot is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:40.


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