RUNNING WITH RIFLES
http://www.runningwithrifles.com/phpBB3/

Custom campaigns
http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2203
Page 2 of 2

Author:  monoolho [ Thu Oct 22, 2015 5:52 am ]
Post subject:  Re: Custom campaigns

Hey, guise, can you clear some stuff up?

I managed to mod some easy stuff: essentially made most weapons available at the armory, allowed them on respawn (and vests) and gave vest1 to AI soldiers, so there's tons of wounded soldiers, which is really fun.

I tried adding the relevant files to an overlay folder called "mono"; added the overlay file.
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay user_selectable="1">
<overlay campaign_entry_script="start_campaign.php">
</overlay>


Then added the script and did what I thought would be enough:
Code:
<?php

chdir(dirname(__FILE__));

// start scripts located elsewhere than vanilla/scripts should include
// vanilla/scripts in include path with a relative path
set_include_path("../../../packages/vanilla/scripts");

// all vanilla includes are defined in relation to vanilla/scripts OR the local folder
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;
   $s->overlay_paths = array("media/overlays/mono");
}

$metagame->init();
// execution blocks here at run until comms from server is lost
$metagame->run();
$metagame->uninit();

_log("ending execution");

?>

What I did was to change the overlay path to my folder.

Clearly it was not enough, as there is no effect at all when I start a custom campaign. What else should I do? What other xml or scripts (or else) is lacking for my custom campaign to be modded so I don't have to switch between two RWR folders when I want to play online?
Am I lacking tons of other campaign/gamemode scripts or something? Or in some file I should specify all paths/files to be overwritten by my mod? (If so, how can one best achieve this?)


Thank you very much.

Author:  pasik [ Thu Oct 22, 2015 9:39 am ]
Post subject:  Re: Custom campaigns

monoolho wrote:
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay user_selectable="1">
<overlay campaign_entry_script="start_campaign.php">
</overlay>



overlay_config.xml expects campaign_entry_script field to be defined in the root element, so try this one:
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay campaign_entry_script="start_campaign.php">
</overlay>

The user_selectable field isn't strictly needed, the overlay will be user selectable if campaign_entry_script is defined.

Some bit of seeing what is happening if things aren't working as expected can be done at the logs, on Windows at %appdata%\Running with rifles\rwr_game.log and metagame.log. There's lots of noise there surely, but sometimes it can help detecting if the expected files and paths are being used by the game. In your case it defaulted to run start_invasion.php instead of start_campaign.php.

Author:  monoolho [ Fri Oct 23, 2015 5:13 pm ]
Post subject:  Re: Custom campaigns

pasik wrote:
monoolho wrote:
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay user_selectable="1">
<overlay campaign_entry_script="start_campaign.php">
</overlay>



overlay_config.xml expects campaign_entry_script field to be defined in the root element, so try this one:
Code:
<?xml version="1.0" encoding="utf-8"?>
<overlay campaign_entry_script="start_campaign.php">
</overlay>

The user_selectable field isn't strictly needed, the overlay will be user selectable if campaign_entry_script is defined.

Some bit of seeing what is happening if things aren't working as expected can be done at the logs, on Windows at %appdata%\Running with rifles\rwr_game.log and metagame.log. There's lots of noise there surely, but sometimes it can help detecting if the expected files and paths are being used by the game. In your case it defaulted to run start_invasion.php instead of start_campaign.php.


Wow, you're a genius, man.

Who would dare say a single line of unnecessary coding would render all my work fruitless... Well, you and countless mods before, but, I did not expect the simple overlay xml would do that.

IT LIVES! IT LIVES! It's working now. Corrected some flaws and, well, it looks almost as if a modder had done it. The log also proved far too useful to fixing stuff. Damn it feels good. Aission Mccomplished.

Thank you very much, master pasik.

Just one last questions: can one mod to make the rare weapons available at the armory just like enemy weapons?
Thank you very much for your hard work

Author:  RedHawk7 [ Sat Apr 15, 2017 3:19 am ]
Post subject:  Re: Custom campaigns

I need help, i helping my friend for his campaign,
so i got to get it working with all the faction playable (there are 9 factions)
but only 3 factions spawns the user with a weapon.

Please help what can we do?
Thanks a lot!

Page 2 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/