# Help with new ammo types

**URL:** <https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711>\
**Category:** The Toolbox\
**Created:** [February 7, 2020, 10:39pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711 "2020-02-07T22:39:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jninja](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/jninja/32/7800_2.png) [@Jninja](https://discourse.cataclysmdda.org/u/Jninja)\
**Post date:** [February 7, 2020, 10:39pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/1 "2020-02-07T22:39:48Z")

</div>

So I have been at adding new ammo for a mod for a while now to no success, does anyone have any ideas of any good guides to follow or a mod I can look at? I’ve looked at the code and replicated from there but it doesn’t work. It just spits out this error message.  
[const T& string\_id::obj() const [with T = ammunition\_type]] Tried to get invalid ammunition: 939  
Again if anyone knows how or of any resources that can help please share away!

---

<div class="post-metadata">

**Author:** ![Genn\_Faol](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/genn_faol/32/8018_2.png) [@Genn\_Faol](https://discourse.cataclysmdda.org/u/Genn_Faol)\
**Post date:** [February 7, 2020, 10:41pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/2 "2020-02-07T22:41:40Z")

</div>

I mean, it would help if you showed us the code you are using.

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [February 8, 2020, 5:26pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/3 "2020-02-08T17:26:09Z")

</div>

Well, there’s the [guide for first time contributors](https://github.com/CleverRaven/Cataclysm-DDA/wiki/Guide-to-adding-new-content-to-CDDA-for-first-time-contributors) which discusses adding new guns in the section on new items.

---

<div class="post-metadata">

**Author:** ![Jninja](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/jninja/32/7800_2.png) [@Jninja](https://discourse.cataclysmdda.org/u/Jninja)\
**Post date:** [February 9, 2020, 3:40pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/4 "2020-02-09T15:40:41Z")

</div>

Ya sorry forgot to post the code… here it is  
[  
{  
“id”: “9x39\_SP5”,  
“type”: “AMMO”,  
“name”: “9x39mm SP-5”,  
“description”: “A Soviet designed shell using the 7.62 case with a sligtly longer neck. Developed by Nikolai Zabelin it is a conventional lead core FMJ bullet, developed for accuracy.”,  
“weight”: “17 g”,  
“volume”: “150 ml”,  
“price”: 20000,  
“material”: [“brass”, “powder”],  
“symbol”: “+”,  
“color”: “white”,  
“count”: 30,  
“stack\_size”: 10,  
“ammo\_type”: “939”,  
“casing”: “762\_casing”,  
“range”: 14,  
“damage”: 31,  
“pierce”: 5,  
“dispersion”: 50,  
“recoil”: 750  
},  
{  
“id”: “9x39\_SP6”,  
“copy-from”: “9x39\_SP5”,  
“type”: “AMMO”,  
“name”: “9x39 SP-6”,  
“description”: “A soviet desogned shell using the 7.62 case with a slightly longer neck. It was Developed by Yuri Frolov it has a hardened metal armor-piercing core. It can penetrate 2 mm (0.079 in) of steel at 500 meters.”,  
“price”: 20000,  
“relative”: { “damage”: 40, “pierce”: 8 }  
}  
]

---

<div class="post-metadata">

**Author:** ![mlangsdorf](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/mlangsdorf/32/2462_2.png) [@mlangsdorf](https://discourse.cataclysmdda.org/u/mlangsdorf)\
**Post date:** [February 9, 2020, 6:19pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/5 "2020-02-09T18:19:49Z")

</div>

Where’s your definition for the “939” `ammo_type`? It’s not defined in the game or any of the mods from the CleverRaven repo.

---

<div class="post-metadata">

**Author:** ![Jninja](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/jninja/32/7800_2.png) [@Jninja](https://discourse.cataclysmdda.org/u/Jninja)\
**Post date:** [February 9, 2020, 8:40pm UTC](https://discourse.cataclysmdda.org/t/help-with-new-ammo-types/22711/6 "2020-02-09T20:40:15Z")

</div>

Ah that would be problem, I thought I had to make it like that. There’s no mod for it out there
