It is currently Wed Apr 30, 2025 10:59 pm

RUNNING WITH RIFLES Multiplayer

test

Game servers 48 List provided by EpocDotFr | Players online 56


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Server Configuration
PostPosted: Sun Jan 11, 2015 2:40 am 
Offline

Joined: Sun Jan 11, 2015 2:22 am
Posts: 2
Hello! I was planning to setup a server and I was wondering if these configuration settings are possible.

*No weapons dropped by AIs and players
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons
*Loot RP value adjustment


Top
 Profile  
 
 Post subject: Re: Server Configuration
PostPosted: Sun Jan 11, 2015 12:20 pm 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
AnonymousFish wrote:
*No weapons dropped by AIs and players
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons
*Loot RP value adjustment

Yes, all of those are possible to configure on server side without requiring client side mods.

While some of the edits could be possibly achieved by editing the resource files directly on the server, it is safer to make the edits in the so called custom map config which gets sent from server to clients; otherwise clients will probably e.g. show the vanilla RP values in inventory but transferring them causes the RP value on server to be used. Most gamemodes create the map config dynamically with a piece of script.

The chosen game mode, Invasion / Classic / Deathmatch / Minimodes / something custom, affects where to make these changes.

I can help you through it if you've already decided the gamemode to be used.


Top
 Profile  
 
 Post subject: Re: Server Configuration
PostPosted: Sun Jan 11, 2015 4:25 pm 
Offline

Joined: Sun Jan 11, 2015 2:22 am
Posts: 2
pasik wrote:
AnonymousFish wrote:
*No weapons dropped by AIs and players
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons
*Loot RP value adjustment

Yes, all of those are possible to configure on server side without requiring client side mods.

While some of the edits could be possibly achieved by editing the resource files directly on the server, it is safer to make the edits in the so called custom map config which gets sent from server to clients; otherwise clients will probably e.g. show the vanilla RP values in inventory but transferring them causes the RP value on server to be used. Most gamemodes create the map config dynamically with a piece of script.

The chosen game mode, Invasion / Classic / Deathmatch / Minimodes / something custom, affects where to make these changes.

I can help you through it if you've already decided the gamemode to be used.


Wow, thanks for the help. I'm very surprised that the developers actually engage the community.

I was planning on hosting an Invasion server similar to the {SAS}Invasion one.


Top
 Profile  
 
 Post subject: Re: Server Configuration
PostPosted: Mon Jan 12, 2015 3:08 am 
Offline
User avatar

Joined: Fri Sep 19, 2014 9:51 pm
Posts: 540
Location: Loca-what...?
AnonymousFish wrote:
Wow, thanks for the help. I'm very surprised that the developers actually engage the community.

I was planning on hosting an Invasion server similar to the {SAS}Invasion one.
Actually, you should not be surprised, since the devs hosting the site and that's the best way to share and exchange ideas and learn everything about the game as well.
Great game - great community, what more you could want......... ;)

_________________
"Ad cogitandum et agendum homo natus es"

I work quickly, cheaply and qualitatively. You can choose only two of the three options.


Top
 Profile  
 
 Post subject: Re: Server Configuration
PostPosted: Mon Jan 12, 2015 10:55 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
AnonymousFish wrote:
pasik wrote:
AnonymousFish wrote:
*No weapons dropped by AIs and players
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons
*Loot RP value adjustment

Yes, all of those are possible to configure on server side without requiring client side mods.

While some of the edits could be possibly achieved by editing the resource files directly on the server, it is safer to make the edits in the so called custom map config which gets sent from server to clients; otherwise clients will probably e.g. show the vanilla RP values in inventory but transferring them causes the RP value on server to be used. Most gamemodes create the map config dynamically with a piece of script.

The chosen game mode, Invasion / Classic / Deathmatch / Minimodes / something custom, affects where to make these changes.

I can help you through it if you've already decided the gamemode to be used.


Wow, thanks for the help. I'm very surprised that the developers actually engage the community.

I was planning on hosting an Invasion server similar to the {SAS}Invasion one.


--------------------------------------------------------------------
Note, I haven't tested this myself yet, so the odds are it won't work straight yet. Consider it work in progress, I'll be back.
--------------------------------------------------------------------

All right, so these for Invasion:
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons
*Loot RP value adjustment
*No weapons dropped by AIs and players

We need to get to manipulating the way the custom map config is created by the Invasion gamemode script. One way to do that is to edit the vanilla script files directly, but I'd generally advice against that as you'll definitely have some challenges with any updates that will change those files too.

Another way to achieve it is by copying media/packages/vanilla/scripts/start_invasion.php to let's say start_my_invasion.php and begin extending there. I'll use this method below.

In start_my_invasion.php, you could change this
Code:
// --------------------------------------------

$metagame = new GameModeInvasion();


to this

Code:
// --------------------------------------------
// inherit from Invasion gamemode and configure overrides
class MyGameModeInvasion() extends GameModeInvasion {
   // --------------------------------------------
   protected function setup_map_rotator() {
      $this->map_rotator = new MyMapRotator($this);
   }
}

// --------------------------------------------
// a custom map rotator extending the vanilla Invasion map rotator used online
class MyMapRotator extends MapRotatorInvasion {
   // --------------------------------------------
   protected function create_stage() {
      // we need to get down to intercepting stage set up to get our custom resources in, in a different way than what vanilla does
      return new MyStage($this->metagame->user_settings);
   }
}

// --------------------------------------------
class MyStage extends Stage {
   // --------------------------------------------
   public function get_change_map_command() {
      $map_config = "<map_config>\n";

      $map_config .=
         "   <include_layer name='bases.default' />\n" .
         "   <include_layer name='layer1.default' />\n" .
         "   <include_layer name='layer2.default' />\n" .
         "   <include_layer name='layer3.default' />\n";

      foreach ($this->factions as $key => $f) {
         if ($key == 0) {
            // friendly faction always uses basic faction form
            $map_config = $map_config .
               "  <faction file='" . $f->config->file . "' />\n";
         } else {
            // enemies use different faction settings between regular and final battles
            $map_config = $map_config .
               "  <faction file='" . ($this->is_final_battle() ? $f->config->final_battle_file : $f->config->file) . "' />\n";
         }
      }

      $map_config = $map_config .
         "<weapon file='invasion_all_weapons.xml' />\n" .
         "<projectile file='invasion_all_throwables.xml' />\n" .
         "<carry_item file='invasion_all_carry_items.xml' />\n" .
         "<call file='invasion_all_calls.xml' />\n" .
         "<vehicle file='invasion_all_vehicles.xml' />\n" .
         "<achievement file='achievements.xml' />\n" .
         "</map_config>\n";

      $overlays = "";
      
      foreach ($this->user_settings->overlay_paths as $key => $path) {
         _log("adding overlay " . $path);
         $overlays .=
            "<overlay path='" . $path . "' />\n";
      }

      $change_map_command =
         "<command class='change_map'" .
         // helps with loading time by avoiding creating most of the stuff before we input the wanted match settings - we aren't using the default ones in invasion
         "   suppress_default_match='1'" .
         "   map='" . $this->map_info->path . "'>" .
         $overlays .
         $map_config .
         "</command>";

      return $change_map_command;
   }
}

// --------------------------------------------

$metagame = new MyGameModeInvasion();


Most of that is based on start_overlay_invasion.example.php (which might be a bit outdated by now, actually), and yes, it goes fairly deep in to get to the part where we will want to make changes. Anyway, we're there now.

This is the part we want to modify
Code:
      $map_config = $map_config .
         "<weapon file='invasion_all_weapons.xml' />\n" .
         "<projectile file='invasion_all_throwables.xml' />\n" .
         "<carry_item file='invasion_all_carry_items.xml' />\n" .
         "<call file='invasion_all_calls.xml' />\n" .
         "<vehicle file='invasion_all_vehicles.xml' />\n" .
         "<achievement file='achievements.xml' />\n" .
         "</map_config>\n";


As none of the locally edited files on the server get transferred to clients, we need to extract some of those xml files right into the map config so that client used resources stay in sync.

There are several ways here we could make this happen. We could copy paste media/packages/vanilla/weapons/invasion_all_weapons.xml directly in the script and edit all the specs in place to meet the requirements you had, or we could read in the stuff from another file and have the stuff output into the map config via a variable. Let's try the latter way, there's a helper for that too.

You'd copy media/packages/vanilla/weapons/invasion_all_weapons.xml to media/packages/vanilla/scripts/my_invasion_all_weapons.xml. To get that stuff read into the map config, you'd do
Code:
      $all_weapons = read_xml("my_invasion_all_weapons.xml");

      $map_config = $map_config .
         $all_weapons .
         "<projectile file='invasion_all_throwables.xml' />\n" .
         "<carry_item file='invasion_all_carry_items.xml' />\n" .
         "<call file='invasion_all_calls.xml' />\n" .
         "<vehicle file='invasion_all_vehicles.xml' />\n" .
         "<achievement file='achievements.xml' />\n" .
         "</map_config>\n";


Ok, now we've got something custom going in the map config. Next let's tweak the weapon parameters:

If you open my_invasion_all_weapons.xml, you'll see stuff like this:
Code:
...
  <weapon file="ak47.weapon">
    <capacity source="rank" source_value="0.0" value="1" />
  </weapon>
  <weapon file="apc_hmg.weapon">
  </weapon>
  <weapon file="g36.weapon">
    <capacity source="rank" source_value="0.0" value="1" />
  </weapon>
  <weapon file="m24_a2.weapon">
    <capacity source="rank" source_value="0.0" value="0" />
    <capacity source="rank" source_value="0.15" value="1" />
  </weapon>
...


The mod requirements affecting weapons were these:
*No weapons dropped by AIs and players
*All weapons unlocked including rares by default
*All weapons require certain EXP to be used
*Adjust RP value for weapons

Rares in that list are the ones with <commonness value="xxx" in_stock="0" />. For those you'll want to change in_stock to 1 to make them possible to exist in armory. ..and actually you also need to add these resources into the default soldier group for them to be accessible to players - I'll take a look at that later.

The XP requirements for each weapon usage are handled with these <capacity source="rank" source_value="0.0" value="1" />, with source_value being the XP requirement. The mapping is e.g. 0.15 means 1500 XP, 1.0 means 10000 XP.

The weapon RP value is controlled with a line such as <inventory price="100.0" />. The mapping is linear, that makes 100 RP. You'll need to get that in <weapon>...</weapon>. Check out some XML editing tutorial if you're not familiar with the syntax.

To make the characters not drop weapons on death, you can possibly use this drop_count_factor_on_death="0.0", it goes into weapon tag like <weapon drop_count_factor_on_death="0.0">. It's not used by vanilla anywhere currently, so I can't really say if it works reliably. Better try it first.

*Loot RP value adjustment
For loot items the drill is pretty much the same. You'll need to copy/rearrange media/packages/vanilla/carry_items/invasion_all_carry_items.xml, edit the inventory price for each and read the stuff into the map config, replacing the direct loading of the file "<carry_item file='invasion_all_carry_items.xml' />" with the contents read in from your own file.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 8 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:  
Powered by phpBB® Forum Software © phpBB Group