AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Extended Map configs (https://forums.alliedmods.net/showthread.php?t=85551)

Milo| 02-12-2009 13:07

Extended Map configs
 
2 Attachment(s)
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

Chris-_- 02-12-2009 13:35

Re: Extended Map configs
 
You scare me, i was looking for this 1 day ago >.>

danielsumi 02-13-2009 12:05

Re: Extended Map configs
 
Works very nice indeed!

I'm just having a single issue... whenever my server enters in hibernation mode (left 4 dead, it does when everyone leaves the server) all the settings seems to be reverted to defaults... the only workaround is to either: manually reboot the server, manually change the map... or wait the current map to finish, so the next one will be loaded with my custom settings again... if you could fix it i would be very VERY greatful :)

Milo| 02-13-2009 21:31

Re: Extended Map configs
 
I don't play L4D myself, so i'm not sure how exactly that hibernation stuff works.

I do have access to a L4D server, but without the game itself it's hard to test plugins in it. I'll have a look at it tomorrow and see if i can fix it.

I noticed the game is 50% off this weekend in the Steam Store btw, might even buy the game.

Either way, expect an update here in a day orso or find me on #sourcemod irc if you want progress updates.

Milo| 02-15-2009 16:08

Re: Extended Map configs
 
2 Attachment(s)
Alright, i made an attempt at supporting left4dead's hibernation feature.

Try this (alpha)version danielsumi, and let me know if it works out.

It detects wether or not you are using the L4D mod, and ifso attempts to hook the server_spawn event which seems to be firing after coming out of hibernation. If this event fires, the plugin will load all appropriate config files, just as if it does after each mapchange on other mods.

danielsumi 02-15-2009 23:22

Re: Extended Map configs
 
allright, i will give it a try and feedback u asap :)

danielsumi 02-15-2009 23:30

Re: Extended Map configs
 
hmmm not quite yet, still reseting the settings.

but hey, its not such a big deal, i can live with that, overall, great job anyway :)

Milo| 02-16-2009 00:11

Re: Extended Map configs
 
Hmmm ok, i'll have to play around with it a bit more then.

Maybe you could tell me though, how exactly is it resetting the settings?
- are these the settings you have in the extended mapconfigs?
- are they being reset to the default value, or to whatever you had in server.cfg or something ?

Anyway, i have the game itself now too, so i'll probably be playing around with it a bit, maybe i can find a solution.

danielsumi 02-16-2009 03:35

Re: Extended Map configs
 
From what i observed:

It turns all cheat-flagged cvars to default values after someone joins the server trough console or server browser and them leave it.

When the server see that no one is in-game anymore, the hibernation mode takes over and it revert the map to the beginning, and also set the cvars to default values.

As i said, its not such a big deal because it seems that whenever players join trough lobby system (the main system to join a game in l4d), the server is forced to change the map before players join the game, so all the settings are... uh... set to whatever values are listed on your /mapconfig/ folder.

dagan69 02-16-2009 07:31

Re: Extended Map configs
 
Nice job, but i have a problem with plugin ... No error, pluging starting without problem, the subdirectories were creating, and the 'map'.cfg were creating in cfg/mapconfig/maps.
But when i modify the file,nothing has changed. I tested by stopping the plugin and it's the same thing.
I'm on the play DoD: S with sourcemod v1.1.0

Do I have missed a step I can modify files 'map'.cfg ?
The aim is to restrict weapons by maps.

Thx ^^


All times are GMT -4. The time now is 13:17.

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