Raised This Month: $32 Target: $400
 8% 

MapConf - Map specific config manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 12-02-2006 , 14:16   MapConf - Map specific config manager
Reply With Quote #1

MapConf is a serverside MetaMod:S plugin that allows you to have map specific configs. Why is it different from all the others, you will ask? Well, it can be configured easily in greater detail, and is able to configure a large set of maps with just a single section, while in other mods you need to set one config file per map.

To install the plugin, just download the binary, copy it to <gamedir>/addons/mapconf_mm/bin/ and add the following line to your metaplugins.ini:
Code:
addons/mapconf_mm/bin/mapconf_mm
That's it

The Config is very simple.
There's a CVar which defines where the config file is located named mcfg_config. It defaults to &quot;cfg/mapconfig.ini&quot; if not set.

You just have to edit your configfile which holds the commands you want executed. If it doesn't exist, create it. It is structured the following way:

Code:
// this is a comment

[de_
echo You are running a de map!

[de_]
echo You are running a map named de_.bsp!

[de_dust2]
#server
echo you are running de_dust2!
#client
echo you are playing on a server running de_dust2!

[fy_fortress]
echo you are running fy_fortress!

[fy_
echo you are running a funmap!

[surf_
echo you are running a surf map!

[surf_machine]
echo you are running surf_machine!

[surf_japan
echo you are running any version of surf_japan!
As you can see, the map names are proceeded with [. If you want commands to be executed on de_dust only, write:
Code:
[de_dust]
(seen the closing bracket?) Commands after this line will only be executed on de_dust.

If you want commands to be executed on de_dust2 as well, don't set the ] - like this:
Code:
[de_dust
- this will exec the commands on any map whose name starts with de_dust.

Now if you want, for example, timelimit on each funmap set to 30 except for fy_fortress bcuz you like that one better and want timelimit there to be 45, then use the following config:
Code:
[fy_
mp_timelimit 30

[fy_fortress]
mp_timelimit 45
My plugin will then read the config file, find that you're playing a fy_ map, and set mp_timelimit 30. Then, it will read on, see that we're playing fy_fortress, and set mp_timelimit to 45.

Lines consisting of #all, #server and #client will switch between the recipients of the commands.
If you put #client in a line, all commands after this line will only be sent to the clients but NOT to the server. If you put #server, it's the other way round, and after #all everyone - clients and server - receive the command.
If you don't set anything after a map name line, #server is assumed.

IMPORTANT
The config file is only parsed when you exec the command mapconfig in server console. If you want the mapconfig to be loaded automatically, just put that command at the very end of your server.cfg.

Greetz
Attached Files
File Type: so mapconf_mm_i486.so (387.8 KB, 546 views)
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble

Last edited by MistaGee; 05-22-2009 at 04:44.
MistaGee is offline
Send a message via ICQ to MistaGee
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 12-03-2006 , 02:01   Re: MapConf - Map specific config manager
Reply With Quote #2

Nice, simple solution.

I like it.
sslice is offline
Formologic23
Junior Member
Join Date: Sep 2006
Old 12-03-2006 , 12:10   Re: MapConf - Map specific config manager
Reply With Quote #3

I think that we are going to try this out on both our CSS and DoD server. We have a different style of gameplay, so we have some longer round times for certain maps. This should be great. I will post any bugs if I find any. Thanks!
Formologic23 is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 12-03-2006 , 18:58   Re: MapConf - Map specific config manager
Reply With Quote #4

Nice job. The Valve way of doing map specific config files can be confusing.

Also, there's no way to have settings for de_, fy_, etc. like this plugin provides.
L. Duke is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 12-04-2006 , 15:09   Re: MapConf - Map specific config manager
Reply With Quote #5

I've made an update: Now the location of the map config file can be set in the CVar mcfg_config. It defaults to cfg/mapconfig.ini, so if you update and forget to set the CVar, the plugin will still work.

Enjoy!
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
Rebell
Veteran Member
Join Date: Nov 2004
Location: GERMANY
Old 12-05-2006 , 09:36   Re: MapConf - Map specific config manager
Reply With Quote #6

good one !
__________________
Rebell is offline
basbakker
Member
Join Date: Jul 2005
Old 12-05-2006 , 12:58   Re: MapConf - Map specific config manager
Reply With Quote #7

this is what I read in the console:

[MCFG] Currently running map: "surf_metal_prison"
" on line 3d open map name "cs_
" on line 10 open map name "de_
" on line 17 open map name "fy_
" on line 24 open map name "surf_
" on line 32 open map name "surf_machine]
" on line 35 open map name "surf_japan
[MCFG] No more data read, quitting the force.

this is my mapconfig.ini
--code---

// this is a comment

[cs_
#server
bot_quota 6
sv_airaccelerate 10
sv_gravity 800
mp_startmoney 800

[de_
#server
bot_quota 6
sv_airaccelerate 10
sv_gravity 800
mp_startmoney 800

[fy_
#server
bot_quota 6
sv_airaccelerate 10
sv_gravity 800
mp_startmoney 6500

[surf_
#server
bot_quota 0
mp_limitteams 0
sv_airaccelerate 500
sv_gravity 800
mp_startmoney 6500

[surf_machine]
echo surf_machine

[surf_japan
echo you are running any version of surf_japan!

-----endcode--

its not working for me. Still got bots with surfmaps etc. Did I do something wrong ?

regards.
basbakker is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 12-05-2006 , 14:34   Re: MapConf - Map specific config manager
Reply With Quote #8

This is totally strange, since your version of mapconf seems to produce output in a format I've never seen before. Especially "found command on line 3d" shouldn't be possible, since the line numbers are in decimal format, not hex.

I've pasted your config file into mine, started a surf map and run mapconfig. This is what I got:

Code:
mapconfig
[MCFG] Reading config file from:
[MCFG] "/home/mistagee/srcds/cstrike/cfg/mapconfig.ini"
[MCFG] Currently running map: "surf_rebel_resistance_final11"
[MCFG] Found open map name "cs_" on line 3
[MCFG] Found open map name "de_" on line 10
[MCFG] Found open map name "fy_" on line 17
[MCFG] Found open map name "surf_" on line 24
[MCFG] Found map command "bot_quota 0" on line 26
[MCFG] Found map command "mp_limitteams 0" on line 27
[MCFG] Found map command "sv_airaccelerate 500" on line 28
[MCFG] Found map command "sv_gravity 800" on line 29
[MCFG] Found map command "mp_startmoney 6500" on line 30
[MCFG] Found closed map name "surf_machine" on line 32
[MCFG] Found open map name "surf_japan" on line 35
[MCFG] No more data read, quitting the force.
sv_airaccelerate
"sv_airaccelerate" = "500" ( def. "10" )
 game notify replicated
mp_startmoney
"mp_startmoney" = "6500" ( def. "800" ) min. 800.000000 max. 16000.000000
 game replicated
 - amount of money each player gets when they reset
You see, your config file works fine for me...

Download mapconf_mm again and try then, should really work then...

btw, there's no need to add #server after the map name. if no target modifier is given, #server is assumed.

Greetz
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble

Last edited by MistaGee; 12-05-2006 at 14:45.
MistaGee is offline
Send a message via ICQ to MistaGee
basbakker
Member
Join Date: Jul 2005
Old 12-06-2006 , 10:06   Re: MapConf - Map specific config manager
Reply With Quote #9

I did put the mapconf_mm on my server. but same result unfortunaly..
im puzzeled
basbakker is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 12-07-2006 , 08:59   Re: MapConf - Map specific config manager
Reply With Quote #10

So am I, as your output doesn't apply to the format I hardcoded into the plugin :s

There seems to be something incredibly wrong, but as I can't reproduce the error, I can't figure out what :/

Have you installed the STL lib? On debian, apt-get install libstdc++6... if not, bad things(tm) might happen

Greetz
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble

Last edited by MistaGee; 12-07-2006 at 09:27.
MistaGee is offline
Send a message via ICQ to MistaGee
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 16:31.


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