• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Need help adding unlock requirement to custom ammo

kryzzk

New member
I have added a custom ammo for a rifle mod I created, I am trying to make it so that the ammo is locked until you read ether Sniper Volume 7 or 150 of the rifle magazines (preferred).

The mod already raises the max number of rifle magazines to 150 for the rifle I added, and while the rifle follows the unlock requirements I set, no matter what I do I can't get the ammo to lock until the required book or magazines are read.

In the Items.xml for the ammo I have added the line:

      <property name="UnlockedBy" value="perkSniperHPAmmo"/> ("craftingRifles" while trying to unlock with magazines)

In progression.xml I have :

    <append xpath="progression/perks/book[@name='perkSniperHPAmmo']">
        <effect_group>
           <passive_effect name="RecipeTagUnlocked" operation="base_set" level="1" value="1" tags="5.56mm ammo"/>
        </effect_group>
    </append>

When I tried setting it for the magazines I used:

    <append xpath="progression/crafting_skills/crafting_skill[@name='craftingRifles']">

        <display_entry item="5.56mm ammo" unlock_level="150" />
        <effect_group>
           <passive_effect name="RecipeTagUnlocked" operation="base_set" level="150" value="1" tags="5.56mm ammo"/>
        </effect_group>
    </append>

I'm hoping someone can tell me what I'm doing wrong so that I can get the unlock requirement set on the ammo.  

Thanks.

 
Last edited by a moderator:
For your crafting magazines unlock, you need the level to have two numbers - level that it unlocked at and the last magazine level

so it would be level="150,150". 

In addition, in the recipes file, you need to set the recipe for this ammo as learnable.  It would be a tag that you add.  Check the other recipes (for example HP ammo) as an example of how they got it setup.  I am at work so I can't pull up the file to copy and paste it here.

 
For your crafting magazines unlock, you need the level to have two numbers - level that it unlocked at and the last magazine level

so it would be level="150,150". 

In addition, in the recipes file, you need to set the recipe for this ammo as learnable.  It would be a tag that you add.  Check the other recipes (for example HP ammo) as an example of how they got it setup.  I am at work so I can't pull up the file to copy and paste it here.
Ah, I forgot about the tags in the recipes folder... Kindda feel dumb now as I added that tag to the rifle, but didn't even think about it with the ammo.  I didn't know that the level required 2 numbers, adding both fixed it.

Thanks.

 
Last edited by a moderator:
Back
Top