AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] Game Mode Config Loader 1.6 (https://forums.alliedmods.net/showthread.php?t=93212)

xioSlayer 09-04-2011 00:38

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
Quote:

Originally Posted by carlos moschen (Post 1542836)
Help me out, everything I put in the "server.cfg" and I put in coop.cfg versus.cfg? the command to start the versus mode is that ?????? gamemode_config_versus.cfg what happens when you switch modes? the server restarts? map changes? Please help me!

You put the things you want to happen always or default in server.cfg

Then you use the coop.cfg and versus.cfg ETC. to specify things you want to happen whenever those game modes are played. It hooks the change of game mode and executes them.

carlos moschen 09-04-2011 19:31

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
@xioSlayer friend, for example: if I put "in sv_maxplayers (server.cfg) I have also put in versus.cfg? where I put the command to change mode? if I put the command console by the game works ?, because I only have FTP access on my server! thank you!

xioSlayer 09-12-2011 17:43

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
Quote:

Originally Posted by carlos moschen (Post 1548319)
@xioSlayer friend, for example: if I put "in sv_maxplayers (server.cfg) I have also put in versus.cfg? where I put the command to change mode? if I put the command console by the game works ?, because I only have FTP access on my server! thank you!


"in sv_maxplayers (server.cfg) I have also put in versus.cfg?"

If you put it in your server.cfg, it will always be what is set there. If you want it to be different for versus, then put a different value in versus.cfg

Also, game modes are tricky in left 4 dead 2, its not as simple as it should be, and the intended way of playing different modes on a server is to join from lobby. There are ways to change game mode while connected to the server, but I dont have a need for that and haven't looked into it.

You will need the rcon command to execute commands on the server from in game.

Jay Dogg 09-27-2011 14:36

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
So Im having a little problem with this plugin, for some reason when I use this plugin on my server in coop games the difficulty will only be normal. If I set the server to anything else in the lobby when I get to the server its on normal and then if I do a vote and change the difficulty it changes for a second and then back to normal. As soon as I disable the plugin I can change the difficulty again.

Here are my config files that I use with this plugin

coop.cfg
sm plugins load bebop
sm plugins unload SnareSpeak
sm plugins unload l4d2_gascan_pipe_exploitfix
sm plugins unload l4d2_InfectedRespawn
sv_maxplayers "6"
sv_visiblemaxplayers "-1"
sv_removehumanlimit "1"
sv_force_unreserved "1"

versus.cfg
sm plugins unload bebop
sm plugins load SnareSpeak
sm plugins load l4d2_gascan_pipe_exploitfix
sm plugins load l4d2_InfectedRespawn
sv_maxplayers "8"
sv_visiblemaxplayers "-1"
sv_removehumanlimit "1"
sv_force_unreserved "1"

scavenge.cfg
sm plugins unload bebop
sm plugins load SnareSpeak
sm plugins load l4d2_gascan_pipe_exploitfix
sm plugins load l4d2_InfectedRespawn
sv_maxplayers "8"
sv_visiblemaxplayers "-1"
sv_removehumanlimit "1"
sv_force_unreserved "1"

survival.cfg
sm plugins load bebop
sm plugins unload SnareSpeak
sm plugins unload l4d2_gascan_pipe_exploitfix
sm plugins unload l4d2_InfectedRespawn
sv_maxplayers "6"
sv_visiblemaxplayers "-1"
sv_removehumanlimit "1"
sv_force_unreserved "1"

All the config file are being loaded, I can see the plugins being load and unload as the server starts and I dont anything setting the difficulty but as I said if I just disable this one plugin I can change the difficulty just find. Any one else run into this problem or have any thoughts on how to fix it.

Thanks Jay

RavenDan29 12-04-2011 08:33

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
1 Attachment(s)
Quote:

Originally Posted by dirka_dirka (Post 1172073)
wtf? the version i posted is different then what is on my drive - yet also different then what is on my server!?!

its not 1.7.. its 2.0, and i just "patched" it to 2.0.1:
Code:

/*
* Version Notes:
* 2.0: Changed to more generic system based upon gamemode and difficulty settings.
* Idea from AtomicStrykers even more basic code (compared to v1.6).
* 2.0.1: What happened to the _ ?.. fixed it.
*
* Current valid filenames (for reference only):
* GameMode - coop, realism, survival, scavenge, teamscavenge, versus, teamversus,
* mutation3 (Bleed Out), mutation9 (VIP Gnome), mutation12 (Realism Versus), mutation13 (Linear Scavenge)
* + eventually mutationX (1,2,3...)
* Difficulty - Easy, Normal, Hard, Impossible
*
* Combined examples (with String:Temp3 and String:Temp2): coop.cfg, mutation12.cfg, realism_Impossible.cfg
*
* If you don't have the file, it wont change anything.
* Difficulty based filenames are not required, but are checked for first (they override generic configs).
* eg: coop.cfg would run for all coop games, while coop_Easy.cfg would only run for coop games on Easy.
* eg: a versus game with no versus.cfg would use whatever settings are currently active on the server.
*/



This Version works main page version doesnt!!!

jking 02-02-2012 15:36

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
Plugin doesn't work for me either, isn't there any other way to change the difficulty and have it stick like most other cvars in server or autoexec.cfg? Why all this jumping thru hoops? Doesn't matter what I change in either of the two, it always reverts to normal.

Danny_l4d 02-03-2012 13:13

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
make 5 files:
coop.cfg
coop_easy.cfg
coop_normal.cfg
coop_hard.cfg
coop_impossible.cfg

in easy, normal, hard you place this

PHP Code:

sm_cvar z_difficulty impossible 

then it will be always Expert...
and in the coop_impossible.cfg you set the cvars you like

and do this as well

EDIT: Fixed it. I had to disable your "reset convars" convar. Why is that?

this is a bug in this plugin that it wont work properly

tdes 03-19-2012 21:33

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
This plug-in the first map of a map is not effective
May I ask how to deal with?

Manoa 07-23-2012 12:29

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
this plugin crashes my server when I add to the cfg's z_difficulty, or executes several cfg's one after another.
but AtomicStryker's code works perfectly, but it doesn't allow for greater flexibility of the difficulties, if I only knew how to add difficulty settings to that code

I got it going with this code

Code:

#include <sourcemod>
#define CVAR_FLAGS FCVAR_PLUGIN
        new Handle:g_hGameMode;
        new Handle:g_hDifficulty;
        new Handle:g_hConVar_ConfigCoop_Easy;
        new Handle:g_hConVar_ConfigCoop_Normal;
        new Handle:g_hConVar_ConfigCoop_Hard;
        new Handle:g_hConVar_ConfigCoop_Impossible;
new Handle:g_hConVar_ConfigVersus;
//new Handle:g_hConVar_ConfigTeamVersus;
new Handle:g_hConVar_ConfigSurvival;
public OnPluginStart()
{
    decl String:ModName[50];
    GetGameFolderName(ModName, sizeof(ModName));
    if (!StrEqual(ModName, "left4dead", false))
    {
        SetFailState("Use this Left 4 Dead only.");
    }

    g_hGameMode = FindConVar("mp_gamemode");        //coop, versus, survival
    g_hDifficulty = FindConVar("z_difficulty");        //Easy, Normal, Hard, Impossible
   
    g_hConVar_ConfigCoop_Easy = CreateConVar("l4d_autoexec_coop_easy", "coop_easy.cfg", "CFG file to execute when game mode is coop and the difficulty is Easy.", CVAR_FLAGS);
    g_hConVar_ConfigCoop_Normal = CreateConVar("l4d_autoexeccoop_normal", "coop_normal.cfg", "CFG file to execute when game mode is coop and the difficulty is Normal.", CVAR_FLAGS);
    g_hConVar_ConfigCoop_Hard = CreateConVar("l4d_autoexec_coop_hard", "coop_hard.cfg", "CFG file to execute when game mode is coop and the difficulty is Advanced.", CVAR_FLAGS);
    g_hConVar_ConfigCoop_Impossible = CreateConVar("l4d_autoexec_coop_impossible", "coop_impossible.cfg", "CFG file to execute when game mode is coop and the difficulty is Expert.", CVAR_FLAGS);
    g_hConVar_ConfigVersus = CreateConVar("l4d_autoexec_versus", "versus.cfg", "CFG file to execute when game mode is versus.", CVAR_FLAGS);
    g_hConVar_ConfigSurvival = CreateConVar("l4d_autoexec_survival", "survival.cfg", "CFG file to execute when game mode is survival.", CVAR_FLAGS);
   
    HookConVarChange(g_hGameMode, ConVarChange_GameMode);
    HookConVarChange(g_hDifficulty, ConVarChange_Difficulty);
}

public OnMapStart()
{
    AutoexecCFG();
}

public ConVarChange_GameMode(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if (strcmp(oldValue, newValue) != 0)
    {
        AutoexecCFG();
    }
}

public ConVarChange_Difficulty(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if (strcmp(oldValue, newValue) != 0)
    {
        AutoexecCFG();
    }
}

AutoexecCFG()
{
    decl String:sGameMode[32];
    decl String:sGameDifficulty[32];
    decl String:sConfigName[256];
   
    GetConVarString(g_hGameMode, sGameMode, sizeof(sGameMode));
    GetConVarString(g_hDifficulty, sGameDifficulty, sizeof(sGameDifficulty));

    if (StrEqual(sGameMode, "coop", false))
    {
        if (StrEqual(sGameDifficulty, "Easy", false))
        {
            GetConVarString(g_hConVar_ConfigCoop_Easy, sConfigName, sizeof(sConfigName));
            TrimString(sConfigName);
            ServerCommand("exec %s", sConfigName);
        }
        else if (StrEqual(sGameDifficulty, "Normal", false))
        {
            GetConVarString(g_hConVar_ConfigCoop_Normal, sConfigName, sizeof(sConfigName));
            TrimString(sConfigName);
            ServerCommand("exec %s", sConfigName);
        }
        else if (StrEqual(sGameDifficulty, "Hard", false))
        {
            GetConVarString(g_hConVar_ConfigCoop_Hard, sConfigName, sizeof(sConfigName));
            TrimString(sConfigName);
            ServerCommand("exec %s", sConfigName);
        }
        else if (StrEqual(sGameDifficulty, "Impossible", false))
        {
            GetConVarString(g_hConVar_ConfigCoop_Impossible, sConfigName, sizeof(sConfigName));
            TrimString(sConfigName);
            ServerCommand("exec %s", sConfigName);
        }
    }
    else if (StrEqual(sGameMode, "survival", false))
    {
        GetConVarString(g_hConVar_ConfigSurvival, sConfigName, sizeof(sConfigName));
        TrimString(sConfigName);
        ServerCommand("exec %s", sConfigName);
    }
    else if (StrEqual(sGameMode, "versus", false))
    {
        GetConVarString(g_hConVar_ConfigVersus, sConfigName, sizeof(sConfigName));
        TrimString(sConfigName);
        ServerCommand("exec %s", sConfigName);
    }
}

it fixes all of the bugs I had in l4d, thanks Dionys for the code

eric0279 08-03-2012 23:08

Re: [L4D & L4D2] Game Mode Config Loader 1.6
 
Hello,

is it-it will work for example versus, coop and scavenge:

versus.cfg cooop.cfg scavenge.cfg and contains:
Code:

c1m1_hotel
or you have to declare cvars ?

Can you define it versus.cfg at server start?

and how to turn off notifications in game?

FCVAR_NOTIFY not seeing, I do not see how?


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

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