Raised This Month: $51 Target: $400
 12% 

[L4D2] Server Commands reset after map change


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellnecrotom
Junior Member
Join Date: Feb 2021
Old 05-10-2022 , 07:17   [L4D2] Server Commands reset after map change
Reply With Quote #1

Hey there, I have a quick question that I can't seem to figure out and I can't find a solution to anywhere on Google.

So, I create a Campaign server and add 2 more bots in so there's 6 of us (using Superversus and L4DToolz). All is well, because the bots remain as constants. BUT, as soon as we complete a map (Chapter 1 of No Mercy, for example), after the next map loads (Chapter 2), all commands reset and the two extra bots disappear. I have to use all commands again to respawn them. This is bad for a number of reasons, but balance is the worst. If they had, say, 60 HP left, now they will have 100 after the respawn. I don't want to keep re-inputting all my commands upon campaign map changes.

NOTE: Also, since I am playing with multiple combinations of bot numbers, editing the listenserver.cfg and sourcemod.cfg each time to automatically implement commands upon map change is a tedium.

This did not use to be a problem in L4D1 where I had a similar setup. Once I added the commands for everything in the first Chapter (bot numbers/max players too), they would last until the end of the campaign.

So why do commands reset like this? What am I missing?

Thanks, everyone, for chiming in!

Last edited by hellnecrotom; 05-10-2022 at 07:51.
hellnecrotom is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-10-2022 , 08:27   Re: [L4D2] Server Commands reset after map change
Reply With Quote #2

Commands or cvars?

Cvar values not sticking then you need Command and ConVar - Buffer Overflow Fixer

Not sure why you would be using commands to add bots, those plugins have cvars to define how many you want, if you are using commands to add bots that won't persist over map changes, use the cvars instead.

As for the health, I believe there are various plugins (some recent too) addressing issues of health etc to keep what they previously had. You would have to search for those.
__________________
Silvers is offline
hellnecrotom
Junior Member
Join Date: Feb 2021
Old 05-10-2022 , 08:44   Re: [L4D2] Server Commands reset after map change
Reply With Quote #3

Alright, sorry for being vague. Here's a detailed example.

1. I load up No Mercy - Chapter 1 - Campaign

2. I use "sm_cvar l4d_static_minimum_survivor 6" and "sm_cvar l4d_survivor_limit 6" (from SuperVersus) to keep a static number of 5 Survivor bots at all time (plus me = 6).

3. In order for actual bots to fill the extra 2 slots, I simply have a key bound to "say /createplayer" (from SuperVersus). When a single bot is either spawned or kicked, the STATIC MINIMUM number of bots updates and spawns as many extra ones as necessary to reach that number 6 of Survivors. For example: I have 3 bots from the start and kick 1 ---> the game will quickly add 3 to the remaining 2. That along with me will make 6. Everything works as intended here.

4. As soon as we reach Chapter 2 of the campaign, everything is reset. The "l4d_static_minimum_survivor" and the "l4d_survivor_limit" as well (both back to 4). Of course, accordingly, since the static number of Survivors is now the default 4, I will be missing 2 bots.

PS: I tried your recommended plugin just now - unfortunately it did not solve the problem.

Thanks for the help

Last edited by hellnecrotom; 05-10-2022 at 08:45.
hellnecrotom is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-10-2022 , 09:07   Re: [L4D2] Server Commands reset after map change
Reply With Quote #4

Well for the cvars "l4d_static_minimum_survivor" and "l4d_survivor_limit" you should edit the cvar config they're saved to, that's why they reset. With super versus you can set number of bots in it's cvars config that should spawn them without having to use the command as far as I know. But someone who runs a 4+/8+ server would be able to clarify.
__________________
Silvers is offline
hellnecrotom
Junior Member
Join Date: Feb 2021
Old 05-10-2022 , 09:22   Re: [L4D2] Server Commands reset after map change
Reply With Quote #5

I know about that, but that would mean that I'd have to edit that file based on how I play each time.

In L4D1, these settings used to stay the same after the completion of a chapter. Is there another way to keep changes from chapter to chapter or the CFG is the only option?

EDIT: or, for example, if the game could overwrite the CFG each time I input a command (to keep that as default) - that would theoretically do the job. Is that doable?

Last edited by hellnecrotom; 05-10-2022 at 09:23.
hellnecrotom is offline
Toranks
Senior Member
Join Date: Dec 2021
Location: Spain
Old 05-10-2022 , 10:15   Re: [L4D2] Server Commands reset after map change
Reply With Quote #6

Maybe this plugins can help for you, if you use differents cvars depending on the map, mode, difficulty...

https://forums.alliedmods.net/showthread.php?t=85551
https://forums.alliedmods.net/showthread.php?t=93212
Toranks is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-10-2022 , 10:18   Re: [L4D2] Server Commands reset after map change
Reply With Quote #7

What Toranks, or delete the plugins generated cvar config (and the code within the plugin(s) to autoexec their cvar config) then the values will persist over map changes, but I don't recommend that. Instead use what Toranks suggested.
__________________
Silvers is offline
hellnecrotom
Junior Member
Join Date: Feb 2021
Old 05-10-2022 , 11:10   Re: [L4D2] Server Commands reset after map change
Reply With Quote #8

Thanks for the help, both of you.

It seems like there is no simple solution to this problem, as I don't change settings based on maps/gamemodes (Toranks method). I simply set up how I'm going to play after loading in with the aforementioned cvars. Deleting the CFG each time it still a tedium though.

I wonder why L4D1 kept all server settings across all maps of a campaign. I am missing something.
hellnecrotom is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 05-10-2022 , 11:33   Re: [L4D2] Server Commands reset after map change
Reply With Quote #9

Maybe the cvar config was never generated so its not being loaded each map. You could edit the plugin to remove AutoExecConfig and delete the config setting the values you want by default in the plugin itself, then when you change the cvar values they should remain over map changes, since its no longer loading the config and overwriting the values.
__________________
Silvers is offline
hellnecrotom
Junior Member
Join Date: Feb 2021
Old 05-10-2022 , 17:38   Re: [L4D2] Server Commands reset after map change
Reply With Quote #10

Yes, you've actually given me an idea.

I went in and simply added \\ before the two commands resetting. Now it remains as it should on each map change.

Now all I have to figure out is how to save the 5th and 6th bot's weapons and health between maps. For some reason the mod "[l4d2] Save Weapon (Co-op)" does not work with SuperVersus - or I haven't figured out how yet. The 5th and 6th bots are created from scratch at each map change.

But that's a story for a different day.

Thank you for everything, brothers!
hellnecrotom is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:51.


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