Raised This Month: $ Target: $400
 0% 

Solved [CSGO] Can't have gamemodes_server.txt working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlackFart
Junior Member
Join Date: Feb 2021
Old 02-07-2021 , 05:30   [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #1

Hello,

Using LinuxGSM, I wanted to have multiple servers running with different configurations, in example :
  • An FFA server, you can buy everything, you have armor
  • A pistols only server, only pistols and no armor

Yesterday I spent my day trying to setup my server...
This is my GameModes_Server.txt file :
Spoiler


And I changed the gametype and gamemode to 3/0 (3/1 for the pistols only server).

But it doesn't work... And I don't know why... (my customs _server.cfg are in serverfiles/csgo/cfg/) It looks like it just loads the default .cfg for the gametype/mode 3/0 or 3/1.

So I tried to edit this file : serverfiles/csgo/cfg/csgoserver.cfg, but it looks like the default gamemode_deathmatch.cfg override it

What am i doing wrong ? :/
Thank for you help

Last edited by BlackFart; 02-10-2021 at 09:17.
BlackFart is offline
TomL.
Veteran Member
Join Date: Oct 2017
Location: Germany
Old 02-08-2021 , 09:56   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #2

Read here about how to run multiple servers with lgsm.
Now start with a fresh installation and use the lgsm config file to set the game mode (I wouldn't use custom but casual) and server.cfg or when using lgsm csgoserver(-X).cfg.

Quote:
Originally Posted by TomL. View Post
For CS:GO you basically want to work with these 3 configs.

The autoexec.cfg which will be only executed on server start. It should only contain cvar/commands that have to be set only one time such as sv_downloadurl.

The server.cfg which will be executed after every map change. It should contain basic cvar/commands you want to set which will not be changed by game mode or other configs.

The gamemode_X_server.cfg (X is the gamemode name such as casual) which will be executed every map change after the server.cfg. This file should contain all cvar/commands based on the game mode you want to run like mp_roundtime, mp_maxrounds etc..
TomL. is offline
BlackFart
Junior Member
Join Date: Feb 2021
Old 02-08-2021 , 13:46   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #3

Hello, thank you for your answer
Yes, I setupped my server with one installation and multiple instances. (I really don't want to waste 30GB per server (and I don't even count the time for setupping new servers if I always have to download all the files for a new server)...)

Now, I got 2 pairs of files :
  • serverfiles/csgo/cfg/csgoserver(-x).cfg
  • lgsm/config-lgsm/csgoserver/csgoserver(-x).cfg
But, I'm stuck... I already tried to modified cfg files in serverfiles, but it's overrided by gamemode_xxx.cfg and for lgsm files, I can't add commands on it (command not found)

That's why I tried to configure a custom gamemode_X_server.cfg (ffa and ffa_pistols), but they don't seem to be read :/

If this GameModes_Server.txt exists, it should work by a way or another ? :/

And, most of it, even if I had 1 server per instance, I couldn't modify default files as they could be overridden at any time, so I still would have to use GameModes_Server.txt...

Last edited by BlackFart; 02-08-2021 at 13:51.
BlackFart is offline
TomL.
Veteran Member
Join Date: Oct 2017
Location: Germany
Old 02-08-2021 , 14:28   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #4

Can you provide an example for the cvars and values you want to use for each server?
TomL. is offline
BlackFart
Junior Member
Join Date: Feb 2021
Old 02-08-2021 , 15:42   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #5

Yes of course
In example, I'd like for both instances 'mp_teammates_are_ennemies 1'.
For now for the default FFA, nothing more (but it might change).
And for the pistol only, in example, I'd like to have 'mp_free_armor 0', 'mp_buy_allow_funs 1'
BlackFart is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-08-2021 , 18:31   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #6

There is slight thing...
If you create new game modes (or types) from server side, so it increase game_mode or game_type value, players start get lot of error messages in console
Code:
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
GamesTypes: game_mode is set to an invalid value (1). Range [0,0].
That's because players don't have that same gamemodes structure like in server.
- Otherwise it works, but players get error messages.

----------------------------------------------
*update
- Turns out, in this specific game mode (custom/custom), game not execute any gamemodes "exec" files.
- On other game modes again, it works... god dam.

Spoiler
__________________
Do not Private Message @me

Last edited by Bacardi; 02-09-2021 at 14:10. Reason: dam csgo game...
Bacardi is offline
BlackFart
Junior Member
Join Date: Feb 2021
Old 02-09-2021 , 07:55   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #7

Thank you for your advice, this is a great idea

So, following your instructions, this is what I've done :
I created a file serverfiles/csgo/gamemodes_ffa.txt with your gamemodes_server.txt, I just changed the exec part.
Then, I created 2 files called serverfiles/csgo/cfg/gamemodes_ffa(_server).cfg with the default deathmatch gamemode, and "mp_teammates_are_enemies 1".
Finally, in lgsm/config-lgsm/csgoserver/csgoserver.cfg I added (as in the _default.cfg) I copied/pasted the fn_params() {} and add `-gamemodes_serverfile \"gamemodes_ffa_server.txt\"` and changed gametype/gamemodes to 3/0

Now, I restart my server.
When I do ./csgoserver details (lgsm command), I can see in the command-line paramters the `-gamemodes_serverfile "gamemodes_ffa_server.txt"`

When I'm using grep on the logs to find this file or "gamemodes_serverfile" I get no match at all
In game, it's just a casual server (I imagine with the default settings of a gametype/mode 3/0

Could you tell me what I'm doing wrong ? :/
Thank you for your time

Last edited by BlackFart; 02-09-2021 at 08:03.
BlackFart is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 02-09-2021 , 08:42   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #8

What you get when you use this on server console
sv_game_mode_convars

*edit something wrong ?
You create:
csgo/gamemodes_ffa.txt

You set in launch:
-gamemodes_serverfile \"gamemodes_ffa.txt\"

You add in cfg/server.cfg or cfg/autoexec.cfg: game_type 3; game_mode 0

ok ?

Quote:
Originally Posted by BlackFart View Post
Thank you for your advice, this is a great idea

So, following your instructions, this is what I've done :
I created a file serverfiles/csgo/gamemodes_ffa.txt with your gamemodes_server.txt, I just changed the exec part.
Then, I created 2 files called serverfiles/csgo/cfg/gamemodes_ffa(_server).cfg with the default deathmatch gamemode, and "mp_teammates_are_enemies 1".
Finally, in lgsm/config-lgsm/csgoserver/csgoserver.cfg I added (as in the _default.cfg) I copied/pasted the fn_params() {} and add `-gamemodes_serverfile \"gamemodes_ffa_server.txt\"` and changed gametype/gamemodes to 3/0

Now, I restart my server.
When I do ./csgoserver details (lgsm command), I can see in the command-line paramters the `-gamemodes_serverfile "gamemodes_ffa_server.txt"`

When I'm using grep on the logs to find this file or "gamemodes_serverfile" I get no match at all
In game, it's just a casual server (I imagine with the default settings of a gametype/mode 3/0

Could you tell me what I'm doing wrong ? :/
Thank you for your time
*edit
What other parameters you find in that :
lgsm/config-lgsm/csgoserver/csgoserver.cfg

Last edited by Bacardi; 02-09-2021 at 10:55.
Bacardi is offline
vijayar
Senior Member
Join Date: Sep 2020
Old 02-09-2021 , 12:18   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #9

If i understand correctly you are trying to create two completely different game modes using a single server instance in LGSM. If you have used ./linuxgsm.sh install to create another instance, this only creates a clone of the existing server in terms of having separate csgoserver-x.cfg file under config-lgsm and a separate server launch executable. No other directory or files or mods is cloned. All remain the same for both server instances. Using the newly created csgoserver-x.cfg you can change the game mode type - DM, Competitive, Casual - and further edit the cvars in appropriate gamemode_xxx.cfg file ; copy the file, make change and rename as gamemode_xx_server.txt for it get effected.

Do note that you cannot have diff mods working in this method for e.g one server using DM plugin and another Retake plugin.

Last edited by vijayar; 02-09-2021 at 12:21.
vijayar is offline
BlackFart
Junior Member
Join Date: Feb 2021
Old 02-09-2021 , 13:21   Re: [CSGO] Can't have gamemodes_server.txt working
Reply With Quote #10

This is the output :

Code:
sv_game_mode_convars  
exec {
}
GameTypes: dumping convars for bot difficulty (none:0):convars {
  bot_difficulty int( 0 = 0x0 )
  bot_dont_shoot int( 1 = 0x1 )
  bot_quota int( 0 = 0x0 )
}
You are right for my mistake, but I recreate the file gamemodes_ffa_server.txt, same issue.
Then, yes I did what you said, the only difference is that I changed the gamemode and gametype in lgsm/config-lgsm/csgoserver/csgoserver.cfg, which works.

For your last point :

Code:
##################################
####### Instance Settings ########
##################################
# PLACE INSTANCE SETTINGS HERE
## These settings will apply to a specific instance.
 
gslt="XXX"
 
maxplayers="32"
gametype="3"
gamemode="0"
mapgroup="mp_ffa"
defaultmap="de_dust2"
 
fn_parms(){
parms="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection -gamemodes_serverfile "gamemodes_ffa_server.txt" $
}
And I get this when doing ./csgoserver details (from lgsm)
Code:
Command-line Parameters
=================================
./srcds_run -game csgo -usercon -strictportbind -ip 0.0.0.0 -port 27015 +clientport 27005 +tv_port 27020 +sv_setsteamaccount XXX -tickrate 128 +map de_dust2 +servercfgfile csgoserver.cfg -maxplayers_override 32 +mapgroup mp_ffa +game_type 3 +game_mode 0 +host_workshop_collection -gamemodes_serverfile "gamemodes_ffa_server.txt" $
(I already tried without the double quotes)

Hello vijayar,
Yes, I was aware that I can't have different mods, that is not an issue for now.
And, if it becomes one, I'll add check when loading the plugins. And that is what I'm going to do with the settings, loading different config file according to the gamemode/type or a regex with the name of the server of idk what if I can't make it work.

Last edited by BlackFart; 02-09-2021 at 13:23.
BlackFart is offline
Reply



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 22:56.


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