*************
Creating a custom campaignTo make an overlay mod loadable as a custom campaign, you'll need to have overlay_config.xml in the mod folder with e.g. the following contents.
Code:
<overlay campaign_entry_script="start_campaign.php">
</overlay>
Also, you'll need an entry script that will define which all overlays will be loaded for the custom campaign. You can place it e.g. at scripts subfolder in your mod folder. It'll look something like this:
Code:
<?php
chdir(dirname(__FILE__));
set_include_path("../../../packages/vanilla/scripts");
include_once("gamemodes/invasion/gamemode_invasion.php");
include_once(get_include_with_fallback("server_settings_invasion.php", "server_settings_invasion.example.php"));
$metagame = new GameModeInvasion();
$s = &$metagame->user_settings;
// add your overlay here, and possibly other overlays too if the custom campaign is designed that way
$s->overlay_paths = array("media/overlays/my_custom_campaign");
$metagame->init();
$metagame->run();
$metagame->uninit();
?>
Here's a simple working example:
http://www.runningwithrifles.com/wp/my_ ... mpaign.zip. It changes Greenbelts name to Greenbelts2 and removes all primary weapons from Greenbelts by overriding green.xml. Unzip the package in media/overlays.
*************
Changing resources in vanilla campaign for a custom campaignVanilla campaign uses files such as invasion_all_weapons.xml, invasion_all_vehicles.xml, etc, to define which resources are loaded and to set certain parameters that make the resources different from quickmatch.
For example, aks74u.weapon is included in invasion_all_weapons.xml like this
Code:
<weapon file="aks74u.weapon">
<commonness value="0.0005" in_stock="0" />
<capacity source="rank" source_value="0.0" value="0" />
<capacity source="rank" source_value="0.2" value="1" />
</weapon>
If you wish to make AKS-74U appear in armory, it won't help to change in_stock inside aks74u.weapon file, because invasion_all_weapons.xml definitions are loaded after it. You'll want to change these parameters in invasion_all_weapons.xml, or, remove the definitions from invasion_all_weapons.xml and set the value in aks74u.weapon.