Test map between campaign ???


(Doum88) #1

I want to put test map on my server between campaign.

My config look like that right now:

set d1 “campaign cmpgn_complete ; set nextcampaign vstr d2”
set d2 “campaign cmpgn_complete ; set nextcampaign vstr d1”

set d_initial “set g_gametype 4 ; map battery ; set nextcampaign vstr d2”
vstr d_initial

Thanks for all incoming sugestion because I can’t find this info anywhere on the net !!!


(Rippin Kitten) #2

A campaign is just a series of maps strung together. The maps in the rotation are defined in the .campaign files within the /scripts directory of pak0.pk3 . If you want to add a map into the campaign cycle, you need to edit the .campaign file, or create an entirely new one, and generate a new pk3 file.

Suppose I have a map called starrydelight and I want to add it to the end of the Central Europe campaign. First we need to get the format of the .campaign file, so we’ll grab one from the pak0.pk3 .

Pk3 files are just zip archives with different extensions. Change the extension of pak0.pk3 to .zip, and open it with WinZip or a similar utility. Go to the scripts directory and look for centraleurope_campaign.campaign . Open this file up in a text editor (notepad works fine).

Our campaign file will look like this:

{
	name			"Central Europe"
	shortname		"cmpgn_centraleurope"
	description		"1943. The Axis High Command has ordered a strategic withdrawal from the 'remote and ultimately insignificant' North African theatre and their forces are busy fortifying the Atlantic coastline in expectation of Allied raids and an eventual invasion.**The Allies have much work to do before they can hope to mount a successful invasion attempt and must gain expertise in both beach and parachute landings. Clearly, the next phase of conflict will be critical."
	maps			"radar;railgun;fueldump"
	mapTC			374 185
	type			"wolfmp"
}

What we’re looking for is that maps entry. To add starrydelight to the end of that campaign, we’d change the maps line to this:

maps "radar;railgun;fueldump;starrydelight"

You’ll probably want to be able to play a standard europe campaign, so we’ll need to change the first two lines as well, which define the name of our campaign.

name "Central Europe with Starry Delight"
shortname "cmpgn_starrydelight"

Save this text file to your etmain directory. Call it starrydelight_campaign.campaign .

Now, make a folder in your etmain directory called scripts, and place this campaign file in it. Since we want to run this on a public server, we’ll need to make a pk3 file that will be sent to the clients that join up. Create a new zip archive, name it something unique like starrydelightcampaign.pk3 and add the scripts directory (which includes our new campaign file) to it. Change its extension to pk3 and put it in your etmain directory.

Also, if you haven’t done it by now, rename your pak0.zip file back to pak0.pk3.

Restart your server so it can parse the new pk3 files. You can now call this custom campaign using either the ingame interface (or ref interface if you’re connected remotely) or using the campaign command (/campaign cmpgn_starrydelight).

A few things to note here.

Any pk3 file that is housed on your server in the etmain directory will be sent to any client that connects if you’re running a pure server, even if the pk3 file isn’t being used by the current session. Our small custom campaign file shouldn’t be a problem, but putting a bunch of custom maps or graphic replacements can hose your server’s bandwidth when it sends all this stuff to new clients. Using the http redirect can help save on bandwidth if you have another server (like a web server) on a different connection. You can also turn off auto-downloads (sv_allowdownloads 0) and make your clients get the files ahead of time. But this could kill your traffic if they don’t know where to get the files. Finally, you could turn off sv_pure, but once the new map comes up or the campaign is called these players will be disconnected anyway.

Also, the order of maps in the .campaign file is important. Some maps can’t be the first ones in the campaign, and others seem to screw up the rotation if they’re in a certain spot. Its best to experiment running a local server and make sure everything works properly before you unleash it on your public one.

Finally, if you want to make this new campaign part of your standard rotation, you need to edit the campaigncycle.cfg file on your server’s etmain directory. By default, it looks like this:

set d1 "campaign cmpgn_northafrica ; set nextcampaign vstr d2"
set d2 "campaign cmpgn_centraleurope ; set nextcampaign vstr d1"

// server doesn't recognise the campaign command when the gamecode isn't running yet.
set d_initial "set g_gametype 4 ; map oasis ; set nextcampaign vstr d2"
vstr d_initial

Notice its just defining variables (set d1, set d2…) and using the special nextcampaign variable to call them in a looping sequence. At the end of a campaign, the server runs whatever’s in nextcampaign. You could add the custom campaign into the rotation by defining a d3 and altering d2 to add it to the sequence, like this:

set d1 "campaign cmpgn_northafrica ; set nextcampaign vstr d2"
set d2 "campaign cmpgn_centraleurope ; set nextcampaign vstr d3"
set d3 "campaign cmpgn_starrydelight; set nextcampaign vstr d1"

// server doesn't recognise the campaign command when the gamecode isn't running yet.
set d_initial "set g_gametype 4 ; map oasis ; set nextcampaign vstr d2"
vstr d_initial

Or you could make the custom campaign the only thing running on the server by rewriting the cfg as follows:

set d1 "campaign cmpgn_starrydelight; set nextcampaign vstr d1"
set d_initial "set g_gametype 4;map radar;set next campaign vstr d1"
vstr d_initial

Notice I changed the starting map of oasis to radar, since the custom campaign is set in europe and radar is the first map.

RK