Jump to content

Putting together a custom stack & bundle mod, have a few minor questions.


FramFramson

Recommended Posts

There's a million stack & bundle mods out there, I know, but some of us want some specific tweaks for our own servers - in my case I barely change anything from vanilla. So far so good; it's all working (after all this is a very well-trodden modding path). Just two minor things I want to twiddle with, with the second actually being two questions.

 

The first issue was I wanted to increase the stack size for ONLY cat & dog food cans among canned items, so I have these lines which worked for most items:

 

<set xpath="/items/item[@name='foodCanCatfood']/property[@name='Stacknumber']/@value">20</set> <!-- Default 10 -->
<set xpath="/items/item[@name='foodCanDogfood']/property[@name='Stacknumber']/@value">20</set> <!-- Default 10 -->

 

I understand that even in the vanilla item system, most canned goods are actually written as an extension of the beef can rather than being fully listed separately, so I assume that's overriding these lines? Is there a way I can change the stack size of just these two cans and leave the rest alone?

 

The second issue is a bit more complicated. I added a few more resources bundles - clay, brass, etc. I also wanted to make ammunition resources (shells, tips, & buckshot) boxable (and loose ammo re-boxable, but there are mods for that I can just use directly).

 

in both cases I did this as an extension of the rock bundle (so they're unlocked by the mining perk book). It seems okay that those would be unlocked by the same perk book in lieu of some sort of universal ammunition boxing threshold. There are also ammo boxing mods which unlock as you unlock the relevant ammo type bulk craft via book set bonus (so when you learn to make shells in stacks, those mods also add the ability to box up loose shells), but IMO it makes no sense to have ammo components key off the same thing because shells/tips/shot are more universal (even more so with added ammunition type mods), so it makes no sense for say, the 9mm bulk crafting unlock to also unlock shell boxing or something.

 

Anyway, here's the simple code I use for the component bundles,

 

<item name="resourceBulletCasingBundle">
            <property name="Extends" value="resourceRockSmallBundle"/>
            <property name="CustomIcon" value="resourceBulletCasing"/>
            <property class="Action0">
            <property name="Create_item" value="resourceBulletCasing"/>
            <property name="Create_item_count" value="1000"/>
            </property>
</item>

=================

<recipe name="resourceBulletCasingBundle" count="1" craft_time="3" craft_exp_gain="0">
			<ingredient name="resourceBulletCasing" count="1000"/>
</recipe>

 

(first part in items.xml, second part in recipes.xml, which is probably obvious)

 

So a small question is, if I want the bundle mini-icon (the small one, in the top left of the larger item inventory icon) changed so that it's a box (like ammunition boxes have) and not the open chest like you get on resource bundles, how do I do that for the three bundle items? Would I have to add in whole code and not just have them as an extension of the rock bundle?

 

Which comes to the larger question, which is if I have to use some other bundle as the basis for an extension, which should I use? Explosives perk level (similarly to gunpowder?) or something else? Or should I use some alternate entirely new condition?

 

I mean, I'm fine with ammo component stacking being granted by the mining perk book. It's not perfect but I don't mind. But I at least want to use a non-mining mini-icon. And I'm open to alternatives which might fit better, but in that case I'll need to know how to code that up?

Link to comment
Share on other sites

9 hours ago, FramFramson said:

The first issue was I wanted to increase the stack size for ONLY cat & dog food cans among canned items, so I have these lines which worked for most items:

 

<set xpath="/items/item[@name='foodCanCatfood']/property[@name='Stacknumber']/@value">20</set> <!-- Default 10 -->
<set xpath="/items/item[@name='foodCanDogfood']/property[@name='Stacknumber']/@value">20</set> <!-- Default 10 -->

 

I understand that even in the vanilla item system, most canned goods are actually written as an extension of the beef can rather than being fully listed separately, so I assume that's overriding these lines? Is there a way I can change the stack size of just these two cans and leave the rest alone?

 

Since those don't have those properties (they pull it from foodCanBeef), you need to add them to the item, not set.  So do something like:

<insertAfter xpath="//item[@name='foodCanCatfood']/property[@name='Extends']">

<property name="Stacknumber"  value="20"/>

</insertAfter>

 

9 hours ago, FramFramson said:

 

<item name="resourceBulletCasingBundle">
            <property name="Extends" value="resourceRockSmallBundle"/>
            <property name="CustomIcon" value="resourceBulletCasing"/>
            <property class="Action0">
            <property name="Create_item" value="resourceBulletCasing"/>
            <property name="Create_item_count" value="1000"/>
            </property>
</item>

=================

<recipe name="resourceBulletCasingBundle" count="1" craft_time="3" craft_exp_gain="0">
			<ingredient name="resourceBulletCasing" count="1000"/>
</recipe>

 

(first part in items.xml, second part in recipes.xml, which is probably obvious)

 

So a small question is, if I want the bundle mini-icon (the small one, in the top left of the larger item inventory icon) changed so that it's a box (like ammunition boxes have) and not the open chest like you get on resource bundles, how do I do that for the three bundle items? Would I have to add in whole code and not just have them as an extension of the rock bundle?

 

Which comes to the larger question, which is if I have to use some other bundle as the basis for an extension, which should I use? Explosives perk level (similarly to gunpowder?) or something else? Or should I use some alternate entirely new condition?

 

Use ammoBundleMaster for your extends rather than resourceRockSmallBundle.  That should give you the boxes instead.

 

Then if you want to add custom unlocks for them, you just need to add that to the individual items.  In my crafting mod, I removed the ammo bundle crafting unlocks from the perk books and put them in the crafting trees (so now you have to find the magazines to unlock bulk 9mm ball crafting for example).

 

Here is how I setup my new handgun crafting in progression (note I removed the old one and inserted a new one since I made a lot of changes to crafting - Q6 crafting and tied in ammo / mods unlocks to the various crafting skill trees):


  

      <!-- *** HANDGUN_SKILLS -->
    <crafting_skill name="craftingHandguns" max_level="118" parent="attCrafting" name_key="craftingHandgunsName" desc_key="craftingHandgunsDesc" long_desc_key="craftingHandgunsLongDesc" icon="ui_game_symbol_pistol">

        <display_entry icon="gunHandgunT0PipePistol" name_key="harvestToolsStone" has_quality="true" unlock_level="1,4,7,10,13,16" >
            <unlock_entry item="gunHandgunT0PipePistol" unlock_tier="1" />
        </display_entry>
        <display_entry icon="gunHandgunT1Pistol" name_key="BFTHandgunsT1" has_quality="true" unlock_level="19,23,27,31,35,39" >
            <unlock_entry item="gunHandgunT1Pistol" unlock_tier="1" />
            <unlock_entry item="modGunFlashlight,ammo9mmBulletBall" unlock_tier="2" />
            <unlock_entry item="modGunMagazineExtender" unlock_tier="3" />
            <unlock_entry item="modGunLaserSight,ammo9mmBulletHP,ammoBundle9mmBulletBall" unlock_tier="4" />
            <unlock_entry item="modGunTriggerGroupBurst3" unlock_tier="5" />
            <unlock_entry item="ammoBundle9mmBulletHP" unlock_tier="6" />                    
        </display_entry>
        <display_entry icon="gunHandgunT2Magnum44" name_key="BFTHandgunsT2" has_quality="true" unlock_level="42,47,52,57,62,67" >
            <unlock_entry item="gunHandgunT2Magnum44" unlock_tier="1" />
            <unlock_entry item="ammo44MagnumBulletBall" unlock_tier="2" />
            <unlock_entry item="ammo44MagnumBulletHP,ammoBundle44MagnumBulletBall" unlock_tier="4" />
            <unlock_entry item="ammoBundle44MagnumBulletHP" unlock_tier="6" />    
        </display_entry>
        <display_entry icon="gunHandgunT3SMG5" name_key="BFTHandgunsT3" has_quality="true" unlock_level="70,76,82,88,94,100" >
            <unlock_entry item="gunHandgunT3SMG5" unlock_tier="1" />
            <unlock_entry item="ammo9mmBulletAP" unlock_tier="2" />
            <unlock_entry item="modGunTriggerGroupAutomatic" unlock_tier="3" />
            <unlock_entry item="modGunReflexSight" unlock_tier="5" />
            <unlock_entry item="ammoBundle9mmBulletAP,modGunSoundSuppressorSilencer" unlock_tier="6" />
        </display_entry>
        <display_entry icon="gunHandgunT3DesertVulture" name_key="BFTHandgunsT4" has_quality="true" unlock_level="88,94,100,106,112,118" >
            <unlock_entry item="gunHandgunT3DesertVulture" unlock_tier="1" />
            <unlock_entry item="ammo44MagnumBulletAP" unlock_tier="2" />
            <unlock_entry item="ammoBundle44MagnumBulletAP" unlock_tier="6" />
        </display_entry>

        <effect_group>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="1,118" value="1" tags="gunHandgunT0PipePistol"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="19,118" value="1" tags="gunHandgunT1Pistol"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="23,118" value="1" tags="modGunFlashlight,ammo9mmBulletBall"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="27,118" value="1" tags="modGunMagazineExtender"/>    
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="31,118" value="1" tags="modGunLaserSight,ammo9mmBulletHP,ammoBundle9mmBulletBall"/>    
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="35,118" value="1" tags="modGunTriggerGroupBurst3"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="39,118" value="1" tags="ammoBundle9mmBulletHP"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="42,118" value="1" tags="gunHandgunT2Magnum44"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="47,118" value="1" tags="ammo44MagnumBulletBall"/>        
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="57,118" value="1" tags="ammo44MagnumBulletHP,ammoBundle44MagnumBulletBall"/>        
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="67,118" value="1" tags="ammoBundle44MagnumBulletHP"/>        
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="70,118" value="1" tags="gunHandgunT3SMG5"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="76,118" value="1" tags="ammo9mmBulletAP"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="82,118" value="1" tags="modGunTriggerGroupAutomatic"/>    
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="88,118" value="1" tags="gunHandgunT3DesertVulture"/>                
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="94,118" value="1" tags="modGunReflexSight,ammo44MagnumBulletAP"/>
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="100,118" value="1" tags="ammoBundle9mmBulletAP,modGunSoundSuppressorSilencer"/>                    
            <passive_effect name="RecipeTagUnlocked" operation="base_set" level="118,118" value="1" tags="ammoBundle44MagnumBulletAP"/>    
            
            <passive_effect name="CraftingTier" operation="base_add" level="4,7,10,13,16,118" value="1,2,3,4,5,5" tags="gunHandgunT0PipePistol"/>
            <passive_effect name="CraftingTier" operation="base_add" level="23,27,31,35,39,118" value="1,2,3,4,5,5" tags="gunHandgunT1Pistol"/>
            <passive_effect name="CraftingTier" operation="base_add" level="47,52,57,62,67,118" value="1,2,3,4,5,5" tags="gunHandgunT2Magnum44"/>            
            <passive_effect name="CraftingTier" operation="base_add" level="76,82,88,94,100,118" value="1,2,3,4,5,5" tags="gunHandgunT3SMG5"/>
            <passive_effect name="CraftingTier" operation="base_add" level="94,100,106,112,118" value="1,2,3,4,5" tags="gunHandgunT3DesertVulture"/>            
        </effect_group>
    </crafting_skill>

 

I am still working on it which is why you see some errors in the locationalization parts

Edited by BFT2020
Added handguns example (see edit history)
Link to comment
Share on other sites

6 hours ago, BFT2020 said:

 

Since those don't have those properties (they pull it from foodCanBeef), you need to add them to the item, not set.  So do something like:

<insertAfter xpath="//item[@name='foodCanCatfood']/property[@name='Extends']">

<property name="Stacknumber"  value="20"/>

</insertAfter>

 

 

So I would just replace the lines I listed above entirely with these (rather than keeping them and adding your code) , correct?

 

Quote

Use ammoBundleMaster

 

Wait there's a general ammo bundle in the game?

 

EDIT: Oh it's a creative mode object. So if I put in extensions of ammoBundleMaster which would add recipes in regular (non-creative) play, I would still need to add a condition to unlock that set of recipes, I imagine? What's the default behaviour here - if I don't put an unlocking condition in, does it default to being unlocked from the start of the game or is the recipe unobtainable?

 

I am thinking of other situations where I might want to use particular mini-icons. Is there any way to edit them for added items done as extensions, or do I simply need to create the item in its entirety? (which is not super-difficult, just takes a bit more space of course).

Link to comment
Share on other sites

4 hours ago, FramFramson said:

 

So I would just replace the lines I listed above entirely with these (rather than keeping them and adding your code) , correct?

 

Yes that should work, just need to change the item name for each item you want to do

 

4 hours ago, FramFramson said:

Wait there's a general ammo bundle in the game?

 

EDIT: Oh it's a creative mode object.

 

It's not really a creative mode object.  What it is is a master template that others can reference that bestows certain properties.  For example, I made some quick code to do a bullet casing box bundle:

    <append xpath="/items">

<item name="ammoBundleBulletCasing">
    <property name="Extends" value="ammoBundleMaster"/>
    <property name="CustomIcon" value="resourceBulletCasing"/>
    <property name="Stacknumber" value="10"/> <!-- STK ammobundle high -->
    <property name="EconomicValue" value="900"/>
    <property name="TraderStageTemplate" value="ammoTier1"/>
    <property class="Action0">
        <property name="Create_item" value="resourceBulletCasing"/>
    </property>
</item>

    </append>

 

Now in game, I got this:

 

image.thumb.jpeg.6364081ba13c4c8e283712820affb354.jpeg

 

image.thumb.jpeg.fe5397df67f4e7933a666d062d51b433.jpeg

4 hours ago, FramFramson said:

So if I put in extensions of ammoBundleMaster which would add recipes in regular (non-creative) play, I would still need to add a condition to unlock that set of recipes, I imagine? What's the default behaviour here - if I don't put an unlocking condition in, does it default to being unlocked from the start of the game or is the recipe unobtainable?

 

It depends on how you setup your recipe file.   If you have learnable in the tags, then you have to unlock the recipe (either through crafting skill, perk, book, or schematic).  If learnable is not in the tags, then you know it at the start of the game:

 

Know at the start of the game

<recipe name="ammo9mmBulletBall" count="1" craft_area="workbench" tags="workbenchCrafting">

 

Have to unlock

<recipe name="ammoBundle9mmBulletAP" count="1" craft_time="360" craft_area="workbench" tags="learnable,workbenchCrafting">

 

This is how I made 9mm ball ammo something you have to unlock to craft - see how I added learnable to the tags

<append xpath="//recipe[@name='ammo9mmBulletBall']/@tags">,learnable</append>

 

4 hours ago, FramFramson said:

I am thinking of other situations where I might want to use particular mini-icons. Is there any way to edit them for added items done as extensions, or do I simply need to create the item in its entirety? (which is not super-difficult, just takes a bit more space of course).

 

Look to see if there is already a master template for what you want to do.  For example, in A20, I made it so I had to gather engine parts to make an engine, so I used the master parts bundle template for engine parts and used the engine as the custom icon.  Then when I wrenched down cars in game, it game me parts which had the same mini icon as the rest of the parts in game.

Edited by BFT2020
Formatting code and adding pictures - new security changes didn't allow me to do this until I submitted my post (see edit history)
Link to comment
Share on other sites

Incidentally, I did end up finding the keyword property to select a different corner icon. It's ItemTypeIcon, so if you're doing any sort of item as an extension all you have to do is add

 

<property name="ItemTypeIcon" value="bundle"/>

 

Where the value is the type icon. "Bundle" is the box icon, but there's also campfire, forge, explosion, gunsmithing, book (and book_read), and computer (the stereo-looking thing that dev items have in the creative menu). Not sure if any of the other mini-icons from menus or other locations (like the gears on mod items) can be used, though your comment here seems to indicate yes?

  

On 12/30/2023 at 8:31 PM, BFT2020 said:

Look to see if there is already a master template for what you want to do.  For example, in A20, I made it so I had to gather engine parts to make an engine, so I used the master parts bundle template for engine parts and used the engine as the custom icon.  Then when I wrenched down cars in game, it game me parts which had the same mini icon as the rest of the parts in game.

 

Do you have this mod BTW, this sounds legitimately good. I always thought engines should be a craftable item from parts harvested from vehicles and only very rarely found whole. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...