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

Enabling Locked Weapons in Quick Match Games in Custom Conf
http://runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2397
Page 1 of 1

Author:  paploo [ Sun Jun 28, 2015 8:15 am ]
Post subject:  Enabling Locked Weapons in Quick Match Games in Custom Conf

I was wondering if anyone knows how to add special/unlockable weapons to the armory via a custom_matches XML file.

I've been playing quick games configured via an XML file.

I know I can add non-special weapons via the faction_resources command; for example, the green faction can get access to the AK-47 in the Armory with:
Code:
<command class="faction_resources" faction_id="0">
    <weapon key="ak47.weapon" />
</command>

But this does not work with unlock able weapons like the barret_m107 and p90 with:
Code:
<command class="faction_resources" faction_id="0">
    <!-- Doesn't do anything -->
    <weapon key="p90.weapon" />
</command>


I've spent a few hours trying all the clever things I can think of as a result of poking all the configuration files in in the vanilla package, but I am at a loss to figure this one out. Any help would be appreciated. Thanks!

Author:  warbrand2 [ Sun Jun 28, 2015 10:33 am ]
Post subject:  Re: Enabling Locked Weapons in Quick Match Games in Custom C

take a close look at the ak-47s file and compare to the rare weapons.

there is a line like this

Code:
<commonness value="0.2" can_respawn_with="1" in_stock="1"/>



the following part

in_stock="1" is not on rare weapons or is changed to in_stock="0" you need to add it or change it to 1 for them to appear in the armory.

Author:  paploo [ Sun Jun 28, 2015 7:51 pm ]
Post subject:  Re: Enabling Locked Weapons in Quick Match Games in Custom C

Thanks for the advice. I had noticed this too, and tried overriding the value in my XML file with (among other variations):
Code:
<command class="faction_resources" faction_id="0">
    <weapon key="barrett_m107.weapon">
        <commonness in_stock="1" />
    </weapon>
</command>

Unfortunately, I was unsuccessful in getting the override to occur.

Now while I can edit the weapons file directly to get the weapon into the armory, this becomes a global change, rather than one that is local to my vanilla/custom_matches/paploo_server.xml file. I was hoping for a way to cause the override to occur only when I create use the given configuration file when creating a quick match.

Author:  warbrand2 [ Sun Jun 28, 2015 8:38 pm ]
Post subject:  Re: Enabling Locked Weapons in Quick Match Games in Custom C

that is cause you remove the commoness value the end result should have both the commoness value and the instock 1

Author:  paploo [ Sun Jun 28, 2015 9:47 pm ]
Post subject:  Re: Enabling Locked Weapons in Quick Match Games in Custom C

Thanks for the tip again. I have tried several combinations of supplying commonness attribute keys, several different values for those keys, and with several different out-of-stock weapons (e.g. the p90 and m107)—all with no success.

For example:

Code:
  <command class="faction_resources" faction_id="0">
    <!-- This doesn't work -->
    <weapon key="barrett_m107.weapon">
      <commonness value="0.0001" in_stock="1"/>
    </weapon>
  </command>


and copy/pasting the original commonness line in the definition file, changing only the in_stock value:

Code:
  <command class="faction_resources" faction_id="0">
    <!-- This doesn't work either -->
    <weapon key="barrett_m107.weapon">
      <commonness value="0.0001" can_respawn_with="0" in_stock="1"/>
    </weapon>
  </command>


I'm starting to suspect this isn't the right way to go about this. If you have an example that you have tested and know for sure works, I'd be interested in getting a copy of your functioning custom_matches xml file so that I can deduce where my error is.

Thanks for your help and patience. :)

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