It is currently Thu Mar 28, 2024 3:13 pm

RUNNING WITH RIFLES Multiplayer

test

Game servers 53 List provided by EpocDotFr | Players online 156


All times are UTC




Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Custom campaigns
PostPosted: Mon Apr 06, 2015 4:07 pm 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
*************
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.


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Mon Apr 06, 2015 4:21 pm 
Offline

Joined: Fri Jan 23, 2015 6:25 am
Posts: 230
Cool stuff :) I think I'll update Trench Foot with campaign compatibility. Thanks!


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Tue Apr 07, 2015 6:01 pm 
Offline

Joined: Sun Apr 05, 2015 8:33 pm
Posts: 26
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?


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Sun Apr 12, 2015 1:38 am 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
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.


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Sun Apr 12, 2015 3:16 am 
Offline

Joined: Sun Apr 05, 2015 8:33 pm
Posts: 26
Least it's not just me.... guess my mod will be quick-match only for awhile...


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Sun Apr 12, 2015 3:26 am 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
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. :P


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Fri Apr 17, 2015 1:55 am 
Offline

Joined: Wed Apr 08, 2015 4:44 pm
Posts: 6
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?


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Fri Apr 17, 2015 8:57 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
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


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Fri Apr 17, 2015 8:59 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
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?


Top
 Profile  
 
 Post subject: Re: Custom campaigns
PostPosted: Fri Apr 17, 2015 5:25 pm 
Offline

Joined: Wed Apr 08, 2015 4:44 pm
Posts: 6
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group