View Single Post
Author Message
Milo|
Member
Join Date: Jan 2009
Location: Netherlands
Old 02-12-2009 , 13:07   Extended Map configs
Reply With Quote #1

Summary

This plugin is an improved version of valve's map-specific configuration files. It allows you have configfiles which only get loaded on all CTF maps, configs for 1 specific map, etc.


Supported games

The game should work on nearly every game using the source or orangebox engine, which would include:
  • Team Fortress 2
  • Counter-strike : Source
  • Day of Defeat : Source
  • Left 4 Dead
  • Insurgency
  • Garry's Mod

Commands and CVars:
  • extendedmapconfig_version - Shows the version of this plugin.

Installation:
  1. Copy extendedmapconfig.smx to the Sourcemod plugins directory (default: <gamedir>/addons/sourcemod/plugins/)
  2. Change the map on your server (or restart it) to force the plugin to load.
  3. Empty configfiles for each installed map and gametype will automaticly be created (if possible and if they didn't already exist), you might want to add map- or gametype-specific cvars in here just as you would in the server.cfg

Usage (directory structure):


Inside your mod's cfg/ directory, a new directory called mapconfig/ will be created. This directory holds 3 subdirectories:

mapconfig/general/
This directory contains 1 file, named all.cfg which will be executed for any map.
mapconfig/gametype/
This directory holds a configfile for each gametype. For Team Fortress 2 and Counter-strike:source, a few will be automaticly created. A gametype is usually the "prefix" of the map. In CS:S the map de_dust2 has the de prefix, meaning it is a defusemap. In TF2 the map ctf_2fort has the ctf prefix meaning it is a capture the flag map.

The file ctf.cfg will thus be executed for every map starting with ctf_.
mapconfig/maps/
This directory holds a configfile for every map you have. They should have been automaticly created for every installed map. This is very similar to valve's build-in mapconfig system. The file de_dust.cfg will be executed for the map called de_dust.
You can safely create additional configfiles for new maps and/or gametypes, the plugin will automaticly try to load the appropriate ones after every mapchange.


Notes:
  • The configfiles are loaded on every mapchange, similar to the server.cfg file.
  • The configfiles are loaded after the game is done loading the usual configfiles (such as server.cfg). Because of this, any setting you put in these files, will overrule the settings preset in server.cfg
  • The configfiles are loaded in this order: first the all.cfg file, then the file for the appropriate gametype (if any), then the map's own configfile.
  • I am aware that part of this plugin dublicates the mapconfig system by valve. It is my personal opinion that mine is slightly more superior because it puts the configfiles in an organised directorystructure.
  • This plugin will not stop the "normal" mapconfigs from working, you could safely use both (although there is hardly ever a reason to).
  • The plugin automaticly creates gametype entries for TF2 and CS:S but not for other mods. If you like this plugin and want your mod to have automaticly created gametypes too, contact me and send me a list of which that should be. In the meantime you can obviously just create the files yourself.

Version history
  • Version 1.0 (initial release)
    • Initial version
    • Tested in Team Fortress 2
Attached Files
File Type: sp Get Plugin or Get Source (extendedmapconfig.sp - 4119 views - 5.9 KB)
File Type: smx extendedmapconfig.smx (3.8 KB, 2734 views)
Milo| is offline