RUNNING WITH RIFLES http://www.runningwithrifles.com/phpBB3/ |
|
Custom campaigns http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2203 |
Page 1 of 2 |
Author: | pasik [ Mon Apr 06, 2015 4:07 pm ] |
Post subject: | Custom campaigns |
************* Creating a custom campaign To 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 campaign Vanilla 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. |
Author: | Tremozl [ Mon Apr 06, 2015 4:21 pm ] |
Post subject: | Re: Custom campaigns |
Cool stuff ![]() |
Author: | Avoh [ Tue Apr 07, 2015 6:01 pm ] |
Post subject: | Re: Custom campaigns |
So, in theory... download the example, change "$s->overlay_paths = array("media/overlays/my_custom_campaign"); to the name of my mod and it should appear under custom campaigns, and the overlay_config.xml goes in the main section of my mods folder? |
Author: | The Soldier [ Sun Apr 12, 2015 1:38 am ] |
Post subject: | Re: Custom campaigns |
I can't actually get the modded campaign to fully work. First off - if you factions are not explicitly named "green", "grey", and "brown", then the factions will not be made with the mod's assets. Next, when I've renamed the factions to the original game's factions, they spawn with no weapons. |
Author: | Avoh [ Sun Apr 12, 2015 3:16 am ] |
Post subject: | Re: Custom campaigns |
Least it's not just me.... guess my mod will be quick-match only for awhile... |
Author: | The Soldier [ Sun Apr 12, 2015 3:26 am ] |
Post subject: | Re: Custom campaigns |
Avoh wrote: Least it's not just me.... guess my mod will be quick-match only for awhile... Every mod has been quick-match only that has ever existed in the game, unless it directly overwrote the factions. So don't feel bad. ![]() |
Author: | Tzuridis [ Fri Apr 17, 2015 1:55 am ] |
Post subject: | Re: Custom campaigns |
I was wondering if anyone could help me out, I copied the code above for my overlay config and in scripts. My campaign crashes at 15% at: 22:11:55: : loading names in media/packages/vanilla/names/german_lastnames.txt, german_lastnames.txt 22:11:55: : map config weapons loaded 22:11:55: : loading stats counter config in media/packages/vanilla//achievements.xml 22:11:56: : CHECK: unset loading failed 22:11:56: : execution halted 22:11:56: : uninit comms Any idea what I should be looking for? |
Author: | pasik [ Fri Apr 17, 2015 8:57 am ] |
Post subject: | Re: Custom campaigns |
The Soldier wrote: I can't actually get the modded campaign to fully work. First off - if you factions are not explicitly named "green", "grey", and "brown", then the factions will not be made with the mod's assets. Next, when I've renamed the factions to the original game's factions, they spawn with no weapons. Take a look at this: viewtopic.php?f=7&t=2177&start=10#p13525 |
Author: | pasik [ Fri Apr 17, 2015 8:59 am ] |
Post subject: | Re: Custom campaigns |
Tzuridis wrote: I was wondering if anyone could help me out, I copied the code above for my overlay config and in scripts. My campaign crashes at 15% at: 22:11:55: : loading names in media/packages/vanilla/names/german_lastnames.txt, german_lastnames.txt 22:11:55: : map config weapons loaded 22:11:55: : loading stats counter config in media/packages/vanilla//achievements.xml 22:11:56: : CHECK: unset loading failed 22:11:56: : execution halted 22:11:56: : uninit comms Any idea what I should be looking for? Are your resources to load declared in invasion_all_*.xml files? |
Author: | Tzuridis [ Fri Apr 17, 2015 5:25 pm ] |
Post subject: | Re: Custom campaigns |
I believe so, the only thing I added to the game are 2 calls and both of those are declared in invasion_all_calls. I also added the all_vehicle & all_weapons to the invasion._all_weapons.xml & invasion_all_vehicle.xml. Edit: Nevermind I accidentally placed a , rather than a . Just in case anyone else has this typo problem reoccur the program sublime text is really good. |
Page 1 of 2 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |