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)

AlfredSpain 02-23-2013 16:36

Re: Map configs with prefix support
 
Quote:

Originally Posted by bobis (Post 1899806)
Hello!!!

psychonic edited this plugin and here is the edited version for it , working with csgo workshop maps!!! :D

INFO: you only need to use the following structure at naming the cfg file for workshop maps :

workshop-id-mapname.cfg

and then , place it at the folder where the other map cfgs are located too (cfg/sourcemod/map-cfg/)

For example , de_dust2_se from workshop , will have a cfg named exactly like :

workshop-125488374-de_dust2_se.cfg

thanks mate!
I find it very uncomfortable this update: S

My map configs is:

de_

CS_

With this method would have to create a config for each map.

Thanks for taking the time to fix this;)

addam 02-24-2013 04:17

Re: Map configs with prefix support
 
Quote:

Originally Posted by AlfredSpain (Post 1900397)
thanks mate!
I find it very uncomfortable this update: S

My map configs is:

de_

CS_

With this method would have to create a config for each map.

Thanks for taking the time to fix this;)

Try to change this:
Code:

public ExecuteMapSpecificConfigs() {
     
        decl String:currentMap[PLATFORM_MAX_PATH];
        GetCurrentMap(currentMap, sizeof(currentMap));
        ReplaceString(currentMap, sizeof(currentMap), "/", "-");
        ReplaceString(currentMap, sizeof(currentMap), "\\", "-");

To:
Code:

public ExecuteMapSpecificConfigs() {
     
        decl String:currentMap[PLATFORM_MAX_PATH];
        decl String:cmap[3][PLATFORM_MAX_PATH];
        GetCurrentMap(currentMap, sizeof(currentMap));
        ReplaceString(currentMap, sizeof(currentMap), "/", "#");
        ReplaceString(currentMap, sizeof(currentMap), "\\", "#");
        ExplodeString(currentMap, "#", cmap, 3, sizeof(cmap[]));
        currentMap = cmap[2];

I made a quick test, and it works, but im not a programmer, so maybe its a big crap :)

AlfredSpain 02-26-2013 00:37

Re: Map configs with prefix support
 
Quote:

Originally Posted by addam (Post 1900689)
Try to change this:
Code:

public ExecuteMapSpecificConfigs() {
     
        decl String:currentMap[PLATFORM_MAX_PATH];
        GetCurrentMap(currentMap, sizeof(currentMap));
        ReplaceString(currentMap, sizeof(currentMap), "/", "-");
        ReplaceString(currentMap, sizeof(currentMap), "\\", "-");

To:
Code:

public ExecuteMapSpecificConfigs() {
     
        decl String:currentMap[PLATFORM_MAX_PATH];
        decl String:cmap[3][PLATFORM_MAX_PATH];
        GetCurrentMap(currentMap, sizeof(currentMap));
        ReplaceString(currentMap, sizeof(currentMap), "/", "#");
        ReplaceString(currentMap, sizeof(currentMap), "\\", "#");
        ExplodeString(currentMap, "#", cmap, 3, sizeof(cmap[]));
        currentMap = cmap[2];

I made a quick test, and it works, but im not a programmer, so maybe its a big crap :)


Yea ! :) works! fine fine! THX!



Shameless THX!!

staywarde 05-17-2013 08:31

Re: Map configs with prefix support
 
How can i get this plugin to work with Valve workshop maps? with /<number>/<mapname>?

altex 05-30-2013 19:58

Release 1.1.1.otstrel.1
 
1 Attachment(s)
Release 1.1.1.otstrel.1
* Added support for workshop maps (thanks to psychonic, altex - http://forums.alliedmods.net/showpos...7&postcount=85)

11530 07-02-2013 04:46

Re: Release 1.1.1.otstrel.1
 
Quote:

Originally Posted by altex (Post 1961467)
Release 1.1.1.otstrel.1
* Added support for workshop maps (thanks to psychonic, altex)

Did you really add your clan-name to the version number? That's rather shameful. I assume this is to advertise your servers.

I recommend you change this version number to something more appropriate or remove it completely.

Root_ 07-02-2013 06:02

Re: Map configs with prefix support
 
TBH I'd use another method to detect and set workshop string
Code:
/* OnMapStart()  *  * When the map starts.  * ------------------------------------------------------------------------------------------ */ public OnMapStart() {     decl String:file[PLATFORM_MAX_PATH], String:curmap[PLATFORM_MAX_PATH];     GetCurrentMap(curmap, sizeof(curmap));     // Does current map string is contains a "workshop" word ?     if (StrContains(curmap, "workshop", false) != -1)     {         // Skip the first 19 characters to avoid comparing the "workshop/12345678" prefix         BuildPath(Path_SM, file, sizeof(file), "configs/skins/%s.cfg", curmap[19]);     }     else     {         BuildPath(Path_SM, file, sizeof(file), "configs/skins/%s.cfg", curmap);     }     if (!FileExists(file))     {         BuildPath(Path_SM, file, sizeof(file), "configs/skins/any.cfg");         if (!FileExists(file)) SetFailState("Fatal error: Unable to open generic configuration file \"%s\"!", file);     }     PrepareMenus();     PrepareConfig(file); }

11530 07-02-2013 16:10

Re: Map configs with prefix support
 
I prefer the method to get the map name from the character after the last forward slash, but I like the idea of using an any.cfg which would execute on any map. Admittedly using a file called ".cfg" would probably work with this plugin, but that'd be undesirable.

Powerlord 07-03-2013 00:59

Re: Map configs with prefix support
 
Quote:

Originally Posted by 11530 (Post 1982126)
I prefer the method to get the map name from the character after the last forward slash, but I like the idea of using an any.cfg which would execute on any map. Admittedly using a file called ".cfg" would probably work with this plugin, but that'd be undesirable.

Wouldn't that be pointless since the servercfgfile (default: server.cfg) already executes on every map change?

11530 07-03-2013 01:45

Re: Map configs with prefix support
 
Quote:

Originally Posted by Powerlord (Post 1982330)
Wouldn't that be pointless since the servercfgfile (default: server.cfg) already executes on every map change?

Not if you run forked servers. I have a very specific set of settings that'd run every map change and if I were to change a setting in one server.cfg then I'd have to remember to make the same edit in server2.cfg, server3.cfg etc. With one single any.cfg file I can put everything in one file and any edits to this single file will permeate through all my servers.

I've already written this helpful feature into the plugin, and will post it soon. It's quite handy as it also works with map config files in SteamPipe's new custom directory too (as well as workshop maps).

Powerlord 07-03-2013 11:14

Re: Map configs with prefix support
 
Quote:

Originally Posted by 11530 (Post 1982349)
Not if you run forked servers. I have a very specific set of settings that'd run every map change and if I were to change a setting in one server.cfg then I'd have to remember to make the same edit in server2.cfg, server3.cfg etc. With one single any.cfg file I can put everything in one file and any edits to this single file will permeate through all my servers.

I've already written this helpful feature into the plugin, and will post it soon. It's quite handy as it also works with map config files in SteamPipe's new custom directory too (as well as workshop maps).

You can run exec from within server.cfg and make, say, server-common.cfg and add exec server-common.cfg to server.cfg, server2.cfg, etc...

11530 07-03-2013 13:02

Re: Map configs with prefix support
 
Quote:

Originally Posted by Powerlord (Post 1982565)
You can run exec from within server.cfg and make, say, server-common.cfg and add exec server-common.cfg to server.cfg, server2.cfg, etc...

Yes, but that's a slightly more messy method. Given that I already use this plugin for the map-specific configs, it's pretty darn easy now placing an any.cfg in whichever cfg directory I want, and will run exactly as intended.

artembeboutov 08-04-2013 22:30

Re: Map configs with prefix support
 
Hi I have been have issues with this plugin. I have a server, and the game I am running HL2DM. The issue is I am able to achieve commands like sv_gravity on certain maps with no issues, but the main issue is I cannot achieve the commands mp_ teamplay 1 on TDM maps, or another example is coop maps like puzzle, coop maps. I would really love to have this issue resolved. Any suggestions or ideas to get coop mod working and mp_teamplay working would be amazing. Thanks.

berni 08-05-2013 03:12

Re: Map configs with prefix support
 
Hi artembeboutov,

Read the posts nr. #30 and #31 in this thread.

artembeboutov 08-05-2013 18:38

Re: Map configs with prefix support
 
Thanks for the tip Berni, did my research for a few days. Have everything figured out, server is working great. Great work.

alencore 11-26-2013 10:05

Re: Map configs with prefix support
 
Tnx muchos! this map config works much better than default one.
mp cvars, loading and unloading plugins and their respective cvar works flawlessly.

Inaryu 01-08-2014 11:19

Re: Map configs with prefix support
 
Amazing plugin!
Allows me to run Weapon Blocker 1.3 on surf skill maps!

Only thing I find is it doesn't unload plugins when maps are changed unless the map it's has it's own cfg file.
Can easily be fixed by adding sm plugins unload PLUGIN.NAME in your server.cfg, for example;

Quote:

//Unload Plugins From SKILL SURF
sm plugins unload disabled/nofalldamage
sm plugins unload disabled/respawn
sm plugins unload disabled/wpnblock-nospam

11530 01-08-2014 16:28

Re: Map configs with prefix support
 
Quote:

Originally Posted by Inaryu (Post 2082992)
Amazing plugin!
Allows me to run Weapon Blocker 1.3 on surf skill maps!

Only thing I find is it doesn't unload plugins when maps are changed unless the map it's has it's own cfg file.
Can easily be fixed by adding sm plugins unload PLUGIN.NAME in your server.cfg, for example;

I just disable all non-critical plugins in any.cfg (via its sm_*_enabled cvar) then re-enable them again in whichever map.cfgs I want them in.

Powerlord 01-08-2014 16:31

Re: Map configs with prefix support
 
Quote:

Originally Posted by 11530 (Post 2083132)
I just disable all non-critical plugins in any.cfg (via its sm_*_enabled cvar) then re-enable them again in whichever map.cfgs I want them in.

That's assuming the enabled cvar actually works *coughff2coughvshcough*

eudesafp 04-03-2014 14:03

Re: Map configs with prefix support
 
Somehow I have this plugin user to change the type of game in csgo?

For example, to put a ar_.cfg to maps arms race.

As well as other types such as demolition, competition etc.

That would be great

Searcher64 04-14-2014 10:36

Re: Map configs with prefix support
 
I have a small question pertaining to the plugin's function in L4D2: do the plugin configuration files(or server.cfg) execute before, or after the map config files? Because if the plugin configs/server.cfg execute after the map config, then I can't do anything with the map configs because everything I put in there would be overrided by the plugin config/server.cfg.

I tried this with Left 4 Downtown 2 configs. By default, I put the l4d_maxplayers 5 in server.cfg, and I put in one of the map configs l4d_maxplayers 6 on, say, c1m1_hotel. I then loaded the map c1m1_hotel onto the server, and checked the l4d_maxplayers cvar value, which turned out to be "5," meaning that the map config failed to do its job.

Am I doing something wrong, or...?

bebe9b 06-03-2014 00:27

Re: Map configs with prefix support
 
plugin working CS:GO ??

Leo_Gomez 06-04-2014 10:44

Re: Map configs with prefix support
 
Quote:

Originally Posted by bebe9b (Post 2146061)
plugin working CS:GO ??

Well, it doesn't work on CSS anymore, so I doubt it would work on GO.

winniethepooh 08-12-2014 23:08

Re: Map configs with prefix support
 
Quote:

Originally Posted by Leo_Gomez (Post 2146668)
Well, it doesn't work on CSS anymore, so I doubt it would work on GO.

It does work both on CS:S and CS:GO. It probably won't work with CS:GO workshop maps without modification but it works fine with regular maps.

mythoss 08-15-2014 05:56

Re: Map configs with prefix support
 
Really wish someone would update this to work with workshop. Currently I have no idea how to go about setting up low gravity for scoutznknivez or no freeze time for aim maps.

Ms. Trooper 08-23-2014 20:04

Re: Map configs with prefix support
 
It all works fine for me. However, I cant change the round time with this in CS:GO... Please help!

eXplode82 08-29-2014 11:09

Re: Map configs with prefix support
 
Fix for workshop maps?

natrios 09-06-2014 09:45

Re: Map configs with prefix support
 
hmmm..works on csgo ? I'll be able to test on Monday, To cfg map add only plugins cvars? Do add all the commands to maps (time round, buytime etc.) and plugins cvars ?

Dabosman 09-17-2014 19:15

Re: Map configs with prefix support
 
Well ... this plugin was working great on CSGO up until the last update (major Linux client updates).

Does anyone know why this would not be working? It seems to execute fine since it's showing loaded .. but none of the configs are executed any more? Going to have to look for another temporary plugin that can execute configs based on a prefix (de_.cfg ... he_.cfg ... surf_.cfg ... fun_.cfg ).

tabakhase 10-26-2014 03:24

Re: Map configs with prefix support
 
1 Attachment(s)
Its working just fine for me on CS:GO (linux)...

And I added workshop support!
(or any other arbitrary folders in maps/)

@berni - I send you a PullRequest hope you are okay with the "v1.2", feel free to merge & update OP :P

-------

Find below: v1.2
Normalizes mapnames so that
  • workshop/1337/de_map
  • topmaps/de_map
  • de_map
ends up as de_map

berni 10-26-2014 12:48

Re: Map configs with prefix support 1.2
 
HI tabakhase, thanks for your contribution.

I just released a new version 1.2 with your change.

Greetings, ~Berni

12345 10-26-2014 13:39

Re: Map configs with prefix support
 
Quote:

Originally Posted by tabakhase (Post 2215794)
Its working just fine for me on CS:GO (linux)...

And I added workshop support!
(or any other arbitrary folders in maps/)

@berni - I send you a PullRequest hope you are okay with the "v1.2", feel free to merge & update OP :P

-------

Find below: v1.2
Normalizes mapnames so that
  • workshop/1337/de_map
  • topmaps/de_map
  • de_map
ends up as de_map

Really appreciate for sharing.

Tank Missile 10-26-2014 18:03

Re: Map configs with prefix support 1.2
 
It would be great if this had partial name/suffix support. I'd love to be able to use a config for _event maps.

MIKEE 10-31-2014 11:33

Re: Map configs with prefix support 1.2
 
Most important is the SM for example when I add sm_cpsaver_enable 0 in the file, it doesn't disable the plugin.

I works or not?

Powerlord 10-31-2014 16:26

Re: Map configs with prefix support 1.2
 
The map normalization code works fine... if the game always uses / for the path separator.

Here's some code I'm using in a rewrite for the mapchooser plugin, which among other things takes user input via mapcycle files:

Code:

/**
 * Remove the path from the map name
 * This was intended to remove workshop paths.
 * Used internally by MapEqual and FindMapStringInArray.
 *
 * @param map                        Map name
 * @param destination        String to copy map name to
 * @param maxlen                Length of destination string
 *
 * @return                                True if path was removed, false if map and destination are the same
 */
stock bool:RemoveMapPath(const char[] map, char[] destination, int maxlen)
{
        if (strlen(map) < 1)
        {
                ThrowError("Bad map name: %s", map);
        }
       
        // UNIX paths
        int pos = FindCharInString(map, '/', true);
        if (pos == -1)
        {
                // Windows paths
                pos = FindCharInString(map, '\\', true);
                if (pos == -1)
                {
                        // Copy the path out unchanged, but return false
                        strcopy(destination, maxlen, map);
                        return false;
                }
        }

        // strlen is the null terminator position, which is fine as strcopy wants +1 for the null terminator
        int len = strlen(map) - pos;

        // pos + 1 is because pos is the last / or \ location and we want to start one char further
        strcopy(destination, (len < maxlen ? len : maxlen), map[pos+1]);
       
        return true;
}

Note: This uses SM 1.7 syntax as it's actually from the 1.7 version of mapchooser.inc. Assuming it gets accepted into SM 1.7.

Edit: WTF is with the text for that ThrowError? Not sure what I was thinking there.

yuppicide 11-14-2014 23:38

Re: Map configs with prefix support 1.2
 
Question.. I've been putting off installing this, but I really need it for only two custom settings. Will my server still load server.cfg and gamemode_casual.cfg and then your cfg override only the settings I need?

I have a map limit of 25 minutes and round times of 5 minutes each. I need to set for only a few maps one long round of 25 minutes. It's a BHOP map you take no fall damage.. you just keep playing.

I don't see repeating ALL the settings in ALL the cfg's.. only the settings I need to be different, correct?

csa.lt 12-01-2014 07:20

Re: Map configs with prefix support 1.2
 
This plugin crash server in gameplay after ~20min. without errors on csgo logs. Have using with plugin below, because in another way it is not changing default weapons on awp maps like india.

PHP Code:

#include <sdkhooks>
#include <sdktools>

public OnEntityCreated(entity, const String:classname[])
{
    if(
StrEqual(classname"game_player_equip"))
    {
        
AcceptEntityInput(entity"Kill");
    }



berni 12-02-2014 16:11

Re: Map configs with prefix support 1.2
 
I doubt that this plugin is directly involved in your crash. It only loads configs during map load.

alencore 12-02-2014 19:56

Re: Map configs with prefix support 1.2
 
Quote:

Originally Posted by yuppicide (Post 2224312)
Question.. I've been putting off installing this, but I really need it for only two custom settings. Will my server still load server.cfg and gamemode_casual.cfg and then your cfg override only the settings I need?

I have a map limit of 25 minutes and round times of 5 minutes each. I need to set for only a few maps one long round of 25 minutes. It's a BHOP map you take no fall damage.. you just keep playing.

I don't see repeating ALL the settings in ALL the cfg's.. only the settings I need to be different, correct?

you just make map configs and put the settings you need on certain maps you want that on or off and just named the map config accordingly to make sure that's what the engine reads during loading time, it's that's simple hopefully for you hehe.

csa.lt 12-05-2014 16:52

Re: Map configs with prefix support 1.2
 
Quote:

Originally Posted by berni (Post 2230536)
I doubt that this plugin is directly involved in your crash. It only loads configs during map load.

Yes problem was in my plugin!


All times are GMT -4. The time now is 18:58.

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