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

[L4D2] Automatic Campaign Switcher (ACS) [v2.0.0 (Nov 16, 2021)] - OVERHAULED!


Post New Thread Reply   
 
Thread Tools Display Modes
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 06-11-2018 , 17:51   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #191

If the ACS could apply the names of the maps + (first and last) automatically would be incredible.

No need to edit .sp anymore .
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie
Mi.Cura is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 06-15-2018 , 09:31   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #192

Quote:
Originally Posted by Crasher_3637 View Post
I know how to access the map list including custom maps inside .VPK files. You'll have to look at the code I used here.

https://github.com/Psykotikism/Anti-...system.sp#L508
thats super useful

thanks a lot w
rikka0w0 is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 06-15-2018 , 09:32   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #193

Quote:
Originally Posted by Mi.Cura View Post
If the ACS could apply the names of the maps + (first and last) automatically would be incredible.

No need to edit .sp anymore .
I want to implement this feature. But I need to figure out how to resolve the relationship between maps (e.g. which one comes after the other one)

Any suggestions?

Last edited by rikka0w0; 06-15-2018 at 09:33.
rikka0w0 is offline
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 06-17-2018 , 13:00   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #194

I think only Crasher_3637 can help you.
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie
Mi.Cura is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 06-19-2018 , 21:24   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #195

I asked Silvers if it's possible and this is what he said:

Quote:
I'm not sure how I've never had to do. One thing I would avoid is using specific map names, because then custom campaigns won't work. I always thought hard coding the names were terrible.

Saying that, I've seen some SDKCalls whcih could be created to find out the data. First map and Finale

I guess it could be triggered by vscripts?
CDirector::IsFirstMapInScenario(void)
CDirector::IsFinale(void)
__________________
Psyk0tik is offline
SilentBr
Veteran Member
Join Date: Jan 2009
Old 06-20-2018 , 10:43   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #196

Hello,

I was testing this plugin and I got confused about one thing:

About to vote to the next campaign, it is NOT an automatic voting, you should type !mapvote, is that right?!

I would like to ask to someone add 2 things:
-Add an automatic voting on last map.
-Add a function to exclude the last X campaign played on the automatic voting.

Edit: I am using the version ASC v1.2.2-1.3e from here https://forums.alliedmods.net/showpo...0&postcount=85

Last edited by SilentBr; 06-20-2018 at 10:45.
SilentBr is offline
Mi.Cura
Veteran Member
Join Date: Dec 2016
Location: Brazil
Old 06-20-2018 , 14:02   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #197

Hi,

The version I am using works perfectly
always on the final map of each campaign automatically opens the vote for the next map.

Remember that you should edit the .SP for additional 3 information. Of all the campaigns you have on your server.

- Name of first map
- Name of final map
- Campaign Name
__________________
Mi.Cura | Modded Servers | L4D2
https://steamcommunity.com/groups/micuramodzombie
Mi.Cura is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 06-26-2018 , 14:15   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #198

Quote:
Originally Posted by Mi.Cura View Post
I think only Crasher_3637 can help you.
I just made some discovery:

After unpacking the VPK files, I found each map VPK has a missions folder which contains a txt file. That file contains a lot of useful information about the campaign, e.g. map name, authors and, the name of maps.

There is a "mode" field in the txt file, in side it, there is a "coop" field. Map data are there in order:
Code:
// The modes section lists each of your campaign maps and each mode
	// they support.  Depending on how you set up your campaign maps,
	// you can reuse the same bsp for different modes as is the case with 
        // coop and versus in this example. This requires setting up entities
        // that show up or operate differently for different modes.
        //
	// The following modes are supported: "coop", "versus", "survival"
	//
	// Number each map section starting with "1"
	//
	// "Map" is the name of the bsp of the starting map. (do not include
        // an extension)
	// "DisplayName" is the name to use for the chapter of the map.
	// "Image" is the image used for the chapter in the lobby and
	// settings.

	"modes"
	{
		"coop"
		{
			"1"
			{
				"Map" "l4d2_CrashBandicootvs1"
				"DisplayName" "N. Sanity Beach"
				"Image" "maps/l4d2_CrashBandicootvspic1"
			}
			
			"2"
			{
				"Map" "l4d2_CrashBandicootvs2"
				"DisplayName" "Technical Plant Doctors"
				"Image" "maps/l4d2_CrashBandicootvspic2"
			}
 
			"3"
			{
				"Map" "l4d2_CrashBandicootvs3"
				"DisplayName" "Global Warming"
				"Image" "maps/l4d2_CrashBandicootvspic3"
			}

			"4"
			{
				"Map" "l4d2_CrashBandicootvs4"
				"DisplayName" "Tikimon Twinsanity"
				"Image" "maps/l4d2_CrashBandicootvspic4"
			}
		}
Note that the left4dead2 directory doesn't have a mission directory, so it must be some kind of "virtual" directory that is created on runtime. I'm still not sure if smx plugins are allowed to read the content of these "virtual directories". If it can, then things will be much easier, the plugin can automatically add new installed VPKs to the maplist.txt, or we can completely remove the dependence of maplist.txt! If there's no maplist.txt, we can have a set of txt files in the translation folder, and each file corresponds to a language, and each contains the map(in terms of programming) between the campaign name (the file name of the txt file in mission folder, without extension, I assume that file is unique) and its localized name.

To make the above happen, I still need to find out how to:
1. Can SMX access "virtual directories" and "virtual contents" that are mapped to VPK files?
2. Does sourcemod has some kind of configuration parser? If so how to use it (any example code could be helpful)

Thanks in advance!
rikka0w0 is offline
rikka0w0
Member
Join Date: May 2018
Location: Sydney, Australia / Beij
Old 06-27-2018 , 09:01   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #199

After a few hours of coding i finally made it! Now the maplist.txt is automatically managed by the plugin. Maplist.txt only controls the order of mapcycle, localization text files are moved to the translation folder.

New Feature:
1. If theres no maplist.txt existed, the plugin will generate one with default configuration, it will scan for both official maps and 3rd maps.
2. If one or more map are added to the server, the plugin will automatically append it to the end of maplist.txt
3. If one or more map are removed from the server, the plugin will show their name in the server console.
4. Provides better localization, localized map voting system, supports multi language.

Code:
sm plugins load acs
MapCycle=addons\sourcemod\configs\maplist.txt
Num of Campaign=13, 17
0=Dead Center (L4D2C1)
1=Dark Carnival (L4D2C2)
2=Swamp Fever (L4D2C3)
3=Hard Rain (L4D2C4)
4=The Parish (L4D2C5)
5=The Passing (L4D2C6)
6=The Sacrifice (L4D2C7)
7=No Mercy (L4D2C8)
8=Crash Course (L4D2C9)
9=Death Toll (L4D2C10)
10=Dead Air (L4D2C11)
11=Blood Harvest (L4D2C12)
12=Cold Stream (L4D2C13)
13=CrashBandicoot (CrashBandicootTheReturn)
14=CrashBandicoot2 (l4d2CrashBandicoot2)
15=Questionable Ethics 2 (QuestionableEthicsAlphaTest)
16=Questionable Ethics 1 (QuestionableEthics)
[SM] Loaded plugin acs.smx successfully.
Num of Campaign=13, 17 :
13 maps are in cycle, 17 maps available. The after finishing any of the first 13 maps, the server will change to next map. After finishing the 13th map it will jump to the first map. The last 4 maps are 3rd maps, finishing any of them will jump to the first map.


Up to now, the Scavenge mode map list is still hard coded. The coop mode map list is managed by the plugin. The plugin looks for translated texts in the client's language first, if failed then attempt using English, if such English text does not exists, use the map name itself.
Attached Files
File Type: txt maps.phrases.txt (804 Bytes, 209 views)
File Type: txt acs.phrases.txt (465 Bytes, 235 views)
File Type: sp Get Plugin or Get Source (acs.sp - 473 views - 70.0 KB)

Last edited by rikka0w0; 06-28-2018 at 14:06.
rikka0w0 is offline
Mr. Man
Veteran Member
Join Date: Mar 2011
Location: Huh?
Old 06-27-2018 , 13:49   Re: [L4D2] Automatic Campaign Switcher (ACS) [v1.2.2 (May 21, 2011)]
Reply With Quote #200

Nice breakthrough - was always a pain having to recompile to add that one additional map. Good luck!
Mr. Man 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 05:44.


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