Jump to content

Custom Ammo


dragonslayer770

Recommended Posts

high all, I'm trying to add in some custom ammo like exploding 9mm. and trying to change the hunting rifle's magazine size to 3

 

I have the ammo in but cant get it to load in the gun this is what im using. does these need to go at the top of the xml?

 

 

<set xpath="/items/item[@name='gunHuntingRifle']/property[@class='Action1']/passive_effect[@name='MagazineSize'][@value='1']/@value">3</set>

 

<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items'][@value='ammo9mmBullet,ammo9mmBulletSteel']/@value">ammo9mmBullet,ammo9mmBulletSteel,ammo9mmBulletExp</set>

got the ammo to load but when I spawned in a zombie I couldn't move, I died and I could move again but my fire Butten was reload and no ammo was being loaded. here is my ammo code.

 

and the ammo

<item name="ammo9mmBulletExp">
<property name="DisplayType" value="ammoBullet"/>
<property name="HoldType" value="45"/>
<property name="Meshfile" value="Items/Misc/sackPrefab"/>
<property name="DropMeshfile" value="Items/Misc/sack_droppedPrefab"/>
<property name="Material" value="Mbrass"/>
<property name="Stacknumber" value="500"/> <!-- STK ammo -->
<property name="CraftingSkillGroup" value="craftSkillGuns"/>
<property name="EconomicValue" value="14"/>
<property name="Group" value="Ammo/Weapons"/>
<property class="Action1">
	<property name="Class" value="Projectile"/>
	<property name="Gravity" value="-7"/>
	<property name="Explosion.ParticleIndex" value="4"/> <!-- which Prefab/particle is used -->
	<property name="Explosion.RadiusBlocks" value="2"/> <!-- damage radius for blocks -->
	<property name="Explosion.BlockDamage" value="75"/> <!-- damage for blocks in the center of the explosion -->
	<property name="Explosion.RadiusEntities" value="2"/> <!-- damage radius for entities -->
	<property name="Explosion.EntityDamage" value="50"/> <!-- damage for entities in the center of the explosion. Zombies take 2x this damage. -->
       <property name="Explosion.DamageBonus.stone" value="15"/>
	<property name="Explosion.DamageBonus.metal" value="7"/>
	<property name="Explosion.DamageBonus.earth" value="25"/> <!-- should work? -->
	<property name="Explosion.DamageBonus.wood" value="35"/>
	<property name="Explosion.DamageBonus.water" value="0"/>
</property>
<property name="CraftingSkillGroup" value="craftSkillScience"/>
<property name="Group" value="Ammo/Weapons"/>
<effect_group name="Base Effects" tiered="false">
	<passive_effect name="EntityDamage" operation="base_set" value="25"/>
	<passive_effect name="BlockDamage" operation="base_set" value="7"/>
	<passive_effect name="ProjectileVelocity" operation="base_set" value="60"/>
	<display_value name="ExRadius" value="5" />
</effect_group>
</item>

 

thanks for any help.

Link to comment
Share on other sites

Untested but you might try

 

 

<set xpath="/items/item[@name='gunHuntingRifle']/effect_group/passive_effect[@name='MagazineSize']/@value">3</set>

 

<set xpath="/items/item/property[@class='Action0']/property[@name='Magazine_items' and @value='ammo9mmBullet,ammo9mmBulletSteel']/@value">ammo9mmBullet,ammo9mmBulletSteel,ammo9mmBulletExp</set>

Link to comment
Share on other sites

Are you trying to remove the current ammo or add to it lol. you havent detailed which weapon also you want to modify. and have unfinished and unstarted comments.

 

Try

 

<set xpath="/items/item[@name=gunPistol]/property[@name=Magazine_items='ammo9mmBullet,ammo9mmBulletSteel,ammo9mmBulletExp']</append>

Link to comment
Share on other sites

sry, trying to add exploding ammo in, and any gun that uses ammo9mmBullet, I'm going to do this to all the ammo. would I have to do that for each gun or each ammo?

for the ammo test I used a pistol, I got the ammo load fired 3 to 5 stots that didn't explode and then my fire Butten was reload but it didn't reload, I died and fire butten was back.

Link to comment
Share on other sites

sry, trying to add exploding ammo in, and any gun that uses ammo9mmBullet, I'm going to do this to all the ammo. would I have to do that for each gun or each ammo?

for the ammo test I used a pistol, I got the ammo load fired 3 to 5 stots that didn't explode and then my fire Butten was reload but it didn't reload, I died and fire butten was back.

 

I am new to xpath lol but have learnt a bit in the last weeks.

 

Have you xpathed the ammo into items.xml as well or placed or

 

I am also unsure as to how to get every gun that uses 9mm to use that but I will link to your thread to people that will and maybe they can help better

Link to comment
Share on other sites

If you look at the XPATH tutorial thread one of the main examples explains how to add an ammo type to guns that use something similar.

 

Take a look at them and you should be able to easily modify that and add it to the other guns.

 

Oh the answer was right in front of me lol der ofc the xpath explanations thread. Thanks CyrusBlaze.

 

Here is the link -

 

https://7daystodie.com/forums/showthread.php?93816-XPath-Modding-Explanation-Thread

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...