Jump to content

Ammunition Mod


Recommended Posts

Posted (edited)

After seeing both Glock9's "Trapped in Higashi" playthrough and a number of Kentucky Ballistics videos, I had an idea for another use for the oodles of brass that come from loot bags: Brass Solid Hunting Rounds.

 

The basic idea would be that they would be a semi-armor-piercing round, with performance between standard bullets and the already in-game AP rounds. The core of them would be a new "Brass Bullet Tips," made with 4 or 5 units of Brass. However, I have not the programming experience to make my idea a reality. I was wondering if anyone could help me with that.

Edited by Warwolf (see edit history)
Link to comment
Share on other sites

Use one of Izayo's weapon mods as an example.  Izayo created new ammo types so you can see how it was done - it should include adding new ammos to items, modifying weapons to load the new ammo types, adding recipes, adding to the loot tables, and adding to the trader tables.

Link to comment
Share on other sites

17 minutes ago, Gamida said:

Am also wondering if Styx Steel Ammo mod could be looked at to see how to do this.

 

Probably a better suggestion since that mod is geared towards just adding a new ammo type while Izayo's work includes new guns.

Link to comment
Share on other sites

  • 1 month later...

Been a while, but the (experimental) release of 1.0 has motivated me to actually work on this mod. One last question, since I think I have most of it down: How do I modify the ammunition icon? I want to visually differentiate these rounds from standard ammo in the inventory by recoloring the bullets.

Link to comment
Share on other sites

  • 2 weeks later...

I need some coding help, since apparently I screwed something up. Posted below is the items.xml file for my mod, which won't open in Edge. Could someone let me know what went wrong and how to fix it?

Quote

<Warwolf>
<append xpath="/items">
<item name="ammo9mmBulletBrassSolid">
<property name="Extends" value="ammo9mmBulletBall"/>
<property name="CustomIcon" value="ammo9mmBulletBrass"/>
<property name="CustomIconTint" value="a0a0ff"/>
<property name="DisplayType" value="ammoBulletBrassSolid"/>
<property name="Material" value="Mbrass"/>
<property name="EconomicValue" value="10"/>
<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
<property name="UnlockedBy" value="perkPistolPeteAPAmmo"/>
<effect_group name="Base Effects" tiered="false">
<passive_effect name="EntityDamage" operation="base_set" value="29"/>
<passive_effect name="BlockDamage" operation="base_set" value="6"/>
<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
<display_value name="dTargetArmor" value="-.75"/>
<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
<display_value name="dTargetPenetration" value="1"/>
<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
<passive_effect name="DamageModifier" operation="perc_add" value="-.8" tags="earth"/>
<passive_effect name="DamageModifier" operation="perc_add" value="2" tags="wood"/>
</effect_group>
</item>
<item name="ammo44MagnumBulletBrassSolid">
<property name="Extends" value="ammo44MagnumBulletBall"/>
<property name="CustomIcon" value="ammo44MagnumBulletBrass"/>
<property name="CustomIconTint" value="a0a0ff"/>
<property name="DisplayType" value="ammoBulletBrassSolid"/>
<property name="Material" value="Mbrass"/>
<property name="EconomicValue" value="11"/>
<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
<property name="UnlockedBy" value="perkEnforcerAPAmmo"/>
<effect_group name="Base Effects" tiered="false">
<passive_effect name="EntityDamage" operation="base_set" value="76"/>
<passive_effect name="BlockDamage" operation="base_set" value="10"/>
<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
<display_value name="dTargetArmor" value="-.75"/>
<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
<display_value name="dTargetPenetration" value="1"/>
<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
</effect_group>
</item>
<item name="ammo762mmBulletBrassSolid">
<property name="Extends" value="ammo762mmBulletBall"/>
<property name="CustomIcon" value="ammo762mmBulletBrass"/>
<property name="CustomIconTint" value="a0a0ff"/>
<property name="DisplayType" value="ammoBulletBrassSolid"/>
<property name="Material" value="Mbrass"/>
<property name="EconomicValue" value="10"/>
<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
<property name="UnlockedBy" value="perkSniperAPAmmo"/>
<effect_group name="Base Effects" tiered="false">
<passive_effect name="EntityDamage" operation="base_set" value="46"/>
<passive_effect name="BlockDamage" operation="base_set" value="7"/>
<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
<display_value name="dTargetArmor" value="-.75"/>
<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
<display_value name="dTargetPenetration" value="1"/>
<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
<passive_effect name="DamageModifier" operation="perc_add" value="-.8" tags="earth"/>
<passive_effect name="DamageModifier" operation="perc_add" value="2" tags="wood"/>
</effect_group>
</item>
</append>
<item name="resourceBulletTipBrass">
<property name="HoldType" value="45"/>
<property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
<property name="Material" value="MresourceScrapBrassSmall"/>
<property name="CustomIcon" value="resourceBrassBulletTip"/>
<property name="Stacknumber" value="1000"/>
<property name="EconomicValue" value="12"/>
<property name="EconomicBundleSize" value="10"/>
<property name="Group" value="Ammo/Weapons,Ammo"/>
<append xpath="/items/item[@name='gunHandgunT0PipePistol']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>
<append xpath="/items/item[@name='gunHandgunT1Pistol']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>
<append xpath="/items/item[@name='gunHandgunT2Magnum44']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo44MagnumBulletBrassSolid</append>
<append xpath="/items/item[@name='gunHandgunT3DesertVulture']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo44MagnumBulletBrassSolid</append>
<append xpath="/items/item[@name='gunHandgunT3SMG5']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>
<append xpath="/items/item[@name='gunRifleT0PipeRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunRifleT1HuntingRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunRifleT2LeverActionRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunRifleT3SniperRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunMGT0PipeMachineGun']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunMGT1AK47']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunMGT2TacticalAR']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
<append xpath="/items/item[@name='gunMGT3M60']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>
</Warwolf>

 

Link to comment
Share on other sites

It looks like <item name="resourceBulletTipBrass"> and it's properties are not enclosed in an append statement. You end the first append right before this line.

Link to comment
Share on other sites

3 minutes ago, seven said:

It looks like <item name="resourceBulletTipBrass"> and it's properties are not enclosed in an append statement. You end the first append right before this line.

 

So, for a complete ignoramus at coding, what would be the wording and placement for the fix?

Link to comment
Share on other sites

I've only kinda skimmed through it so don't know all that you're doing, but I'd say you need to move that </append> to come after the resoueceBulletTipBrass item. You also don't have an ending </item> tag for that item. I don't know if there are other missing lines. The way it is right now, you are appending several items to the items list, then there some text that the game won't know what to do with, and then some more appends. Are you using Edge for editing? Didn't know that worked for that. An editor like notepad++ will display formatting which might make things easier.

Link to comment
Share on other sites

I edited your xml with indents and stuff to make it easier to read, and added a comment in the middle about what I think is the problem. That inserting code on the forum worked better than expected.

 

<Warwolf>

<append xpath="/items">
	<item name="ammo9mmBulletBrassSolid">
		<property name="Extends" value="ammo9mmBulletBall"/>
		<property name="CustomIcon" value="ammo9mmBulletBrass"/>
		<property name="CustomIconTint" value="a0a0ff"/>
		<property name="DisplayType" value="ammoBulletBrassSolid"/>
		<property name="Material" value="Mbrass"/>
		<property name="EconomicValue" value="10"/>
		<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
		<property name="UnlockedBy" value="perkPistolPeteAPAmmo"/>

		<effect_group name="Base Effects" tiered="false">
			<passive_effect name="EntityDamage" operation="base_set" value="29"/>
			<passive_effect name="BlockDamage" operation="base_set" value="6"/>
			<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
			<display_value name="dTargetArmor" value="-.75"/>
			<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
			<display_value name="dTargetPenetration" value="1"/>
			<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
			<passive_effect name="DamageModifier" operation="perc_add" value="-.8" tags="earth"/>
			<passive_effect name="DamageModifier" operation="perc_add" value="2" tags="wood"/>
		</effect_group>
	</item>

	<item name="ammo44MagnumBulletBrassSolid">
		<property name="Extends" value="ammo44MagnumBulletBall"/>
		<property name="CustomIcon" value="ammo44MagnumBulletBrass"/>
		<property name="CustomIconTint" value="a0a0ff"/>
		<property name="DisplayType" value="ammoBulletBrassSolid"/>
		<property name="Material" value="Mbrass"/>
		<property name="EconomicValue" value="11"/>
		<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
		<property name="UnlockedBy" value="perkEnforcerAPAmmo"/>

		<effect_group name="Base Effects" tiered="false">
			<passive_effect name="EntityDamage" operation="base_set" value="76"/>
			<passive_effect name="BlockDamage" operation="base_set" value="10"/>
			<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
			<display_value name="dTargetArmor" value="-.75"/>
			<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
			<display_value name="dTargetPenetration" value="1"/>
			<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
		</effect_group>
	</item>

	<item name="ammo762mmBulletBrassSolid">
		<property name="Extends" value="ammo762mmBulletBall"/>
		<property name="CustomIcon" value="ammo762mmBulletBrass"/>
		<property name="CustomIconTint" value="a0a0ff"/>
		<property name="DisplayType" value="ammoBulletBrassSolid"/>
		<property name="Material" value="Mbrass"/>
		<property name="EconomicValue" value="10"/>
		<property name="DescriptionKey" value="ammoBrassSolidGroupDesc"/>
		<property name="UnlockedBy" value="perkSniperAPAmmo"/>

		<effect_group name="Base Effects" tiered="false">
			<passive_effect name="EntityDamage" operation="base_set" value="46"/>
			<passive_effect name="BlockDamage" operation="base_set" value="7"/>
			<passive_effect name="TargetArmor" operation="perc_add" value="-.75" tags="perkDeadEye,perkMachineGunner"/>
			<display_value name="dTargetArmor" value="-.75"/>
			<passive_effect name="EntityPenetrationCount" operation="base_set" value="1"/>
			<display_value name="dTargetPenetration" value="1"/>
			<passive_effect name="DegradationPerUse" operation="perc_add" value="1"/>
			<passive_effect name="DamageModifier" operation="perc_add" value="-.8" tags="earth"/>
			<passive_effect name="DamageModifier" operation="perc_add" value="2" tags="wood"/>
		</effect_group>
	</item>

</append>

<!-- #### this is the problem area, it should be within an append, also needs and end </item> tag, may be missing lines you intended to add

<item name="resourceBulletTipBrass">
	<property name="HoldType" value="45"/>
	<property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
	<property name="Material" value="MresourceScrapBrassSmall"/>
	<property name="CustomIcon" value="resourceBrassBulletTip"/>
	<property name="Stacknumber" value="1000"/>
	<property name="EconomicValue" value="12"/>
	<property name="EconomicBundleSize" value="10"/>
	<property name="Group" value="Ammo/Weapons,Ammo"/>

-->


<append xpath="/items/item[@name='gunHandgunT0PipePistol']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>

<append xpath="/items/item[@name='gunHandgunT1Pistol']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>

<append xpath="/items/item[@name='gunHandgunT2Magnum44']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo44MagnumBulletBrassSolid</append>

<append xpath="/items/item[@name='gunHandgunT3DesertVulture']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo44MagnumBulletBrassSolid</append>

<append xpath="/items/item[@name='gunHandgunT3SMG5']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo9mmBulletBrassSolid</append>

<append xpath="/items/item[@name='gunRifleT0PipeRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunRifleT1HuntingRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunRifleT2LeverActionRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunRifleT3SniperRifle']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunMGT0PipeMachineGun']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunMGT1AK47']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunMGT2TacticalAR']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

<append xpath="/items/item[@name='gunMGT3M60']/property[@class='Action0']/property[@name='Magazine_items']/@value">,ammo762mmBulletBulletBrassSolid</append>

</Warwolf> 

 

Link to comment
Share on other sites

No, I'd add an </item> closing tag after the bullet tip item section, and then move that </append> after that so that you have one long append, and then all the short appends after that, and remove the comment tags of course, so like below. You have the first append that is adding 4 new items, so you can put them all together, and then the other appends are modifying individual things already in the game so need to be separate like you have them.

 

	<item name="resourceBulletTipBrass">
		<property name="HoldType" value="45"/>
		<property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
		<property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
		<property name="Material" value="MresourceScrapBrassSmall"/>
		<property name="CustomIcon" value="resourceBrassBulletTip"/>
		<property name="Stacknumber" value="1000"/>
		<property name="EconomicValue" value="12"/>
		<property name="EconomicBundleSize" value="10"/>
		<property name="Group" value="Ammo/Weapons,Ammo"/>
	</item>

</append>

 

Link to comment
Share on other sites

So, a new bug has popped up in my testing: The 7.62 ammo doesn't function. I can make the rounds just fine, but they don't appear as an option to load into various 7.62 weapons. As far as I can see, the coding reads the same as for the 9mm and .44 rounds, which do work. What is going wrong? 

Link to comment
Share on other sites

In the item file, your ammo name needs to be listed for each weapon

 

Specifically, you are looking for this:

 

    <property class="Action0">
        <property name="Class" value="Ranged"/>
        <property name="Magazine_items" value="ammo9mmBulletBall,ammo9mmBulletHP,ammo9mmBulletAP"/>

 

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

Double-checking, I found the error: I accidentally duplicated "bullet" in the 7.62 entries, so it was looking for "BulletBulletBrassSolid" instead of "BulletBrassSolid." Fixed and will be republishing the mod for (hopefully) the final time... unless a major item update breaks it.

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...