AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Map configs with prefix support 1.3 (https://forums.alliedmods.net/showthread.php?t=69506)

berni 04-05-2008 17:37

Map configs with prefix support 1.3
 
1 Attachment(s)
https://www.bcserv.eu/images/sourcemod/mapconfigs.png with prefix support


Plugin on Github: https://github.com/bcserv/mapconfigs - Forks & Pull requests are welcome

Allows you to have per map config files. Support for map prefix configs (example: dm_.cfg)
This is a complete rewrite of a map configs plugin I found somewhere.

You can have prefix configs that allow you to easily execute cvars/commands for a group of maps, without having to create a cfg file for each of them.
The executing order is alphabetical, that means configs that have the shortest name will be executed first.

Example:

Your maps name is js_build_puzzle_nine_v10

Your config files are js_build_puzzle_nine_v10.cfg, js_build_.cfg and js_.cfg

The executing order will be:
  1. js_.cfg
  2. js_build_.cfg
  3. js_build_puzzle_nine_v10.cfg
Config structure

cfg/sourcemod/map-cfg/

ConVars

none

Todo

-


Changelog


06-05-2015 Version 1.3
  • Fixed handle leak

26-10-2014 Version 1.2
  • Added support for workshop maps (CS:GO), thanks to tabakhase

23-8-2009 Version 1.1.1
  • Fixed configs getting executed twice OnPluginStart

23-8-2009 Version 1.1
  • Added version Convar mc_version
  • Code cleanup
7-5-2008 Version 1.02
  • The plugin is now using OnAutoConfigsBuffered() instead of OnConfigsExecuted() for more reliable cvar changing.
7-5-2008 Version 1.01
  • Fixed wrong folder structor in attached rar file.
5-4-2008 Version 1.0
  • Initial release
Tested games
  • CS: GO
  • Half Life 2: Deathmatch
  • Counter Strike: Source
  • Team Fortress 2
  • Day of Defeat: Source
  • Should work with any games

Contributors

r3dh3adkid 05-06-2008 22:00

Re: Map configs with prefix support
 
Either your post is incorrect or the code is because your code draws the configs from cfg/sourcemod/map-cfg not cfg/map-cfg

other than that, the plugin has worked so far without a hitch!

bl4nk 05-06-2008 22:21

Re: Map configs with prefix support
 
How is that any different from this plugin?

DontWannaName 05-07-2008 00:14

Re: Map configs with prefix support
 
It works with all mods. :P

bl4nk 05-07-2008 02:10

Re: Map configs with prefix support
 
I use the plugin I linked on CSS, DOD:S, and TF2 just fine.

DontWannaName 05-07-2008 02:40

Re: Map configs with prefix support
 
Well than the difference is this one was released in April for any mod and the other was made in January for CSS it said. :D

berni 05-07-2008 03:59

Re: Map configs with prefix support
 
Quote:

Originally Posted by r3dh3adkid (Post 622502)
Either your post is incorrect or the code is because your code draws the configs from cfg/sourcemod/map-cfg not cfg/map-cfg

other than that, the plugin has worked so far without a hitch!

Thanks for reporting this :) I corrected this.

Well there are some things that are different.
  • My code isn't so bloated like in the other plugin
  • My plugin allows multiple prefix configs for one map, the config executing order is alphabetical, that means configs with shorter file name are getting executed first.
  • My plugin doesn't read every line from the config and executes in the console, it's using the exec command.
  • My plugin isn't limited to CS:S only ;)
  • you don't need to have a _ in the mapname to use prefix configs, it works with anything.

Caught off Guard 05-07-2008 04:03

Re: Map configs with prefix support
 
Quote:

Originally Posted by berni (Post 622582)
Thanks for reporting this :) I corrected this.

Well there are some things that are different.
  • My code isn't so bloated like in the other plugin
  • My plugin allows multiple prefix configs for one map, the config executing order is alphabetical, that means configs with shorter file name are getting executed first.
  • My plugin doesn't read every line from the config and executes in the console, it's using the exec command.
  • My plugin isn't limited to CS:S only ;)

thanks for the summary i will take a look at it later. even though the other plugin says CS:S only, it works fine in insurgency. however if the code is more efficient it would be worth a look see. will come back with any problems I find!

cheers

Caught off Guard 05-10-2008 02:13

Re: Map configs with prefix support
 
appears to work fine in insurgency. thanks. :up:

BAILOPAN 05-20-2008 22:16

Re: Map configs with prefix support
 
Your plugin has a race condition. OnConfigsExecuted() guarantees that all configs have finished executing. But you're issuing an "exec" command inside OnConfigsExecuted(), and the changes won't necessarily be mirrored in plugins which rely on this guarantee (such as reservedslots).

I've added a forward to the 1.1 branch to help mitigate this problem, you can read about it here. This change will make it into 1.0.2 or so. I won't unapprove this plugin until a stable release has the new feature and this plugin has had time to update after that.

Note: "fixing" by using OnMapStart() is not a good idea since it occurs before sourcemod.cfg gets executed.


All times are GMT -4. The time now is 09:32.

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