# Help finding code for rags/leather patches (never mind, done)

**URL:** <https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747>\
**Category:** The Toolbox\
**Created:** [November 3, 2014, 4:30pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747 "2014-11-03T16:30:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 3, 2014, 4:30pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/1 "2014-11-03T16:30:16Z")

</div>

I’m trying to make wool items cuttable into wool patches. These can be disassembled into wool thread, which can be used as thread or with knitting needles to make other wool clothing. I want to find the code for leather patches or rags, so I can copy it and learn from it. However, I can’t find it. Where is it in the code, and what would I need to do to do all this?

---

<div class="post-metadata">

**Author:** ![desrik](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/desrik/32/1050_2.png) [@desrik](https://discourse.cataclysmdda.org/u/desrik)\
**Post date:** [November 3, 2014, 7:27pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/2 "2014-11-03T19:27:58Z")

</div>

[https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/iuse.cpp#L6673-L6802](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/iuse.cpp#L6673-L6802)

Should just be able to add an entry to material\_id\_white\_list for ‘wool’. There may be more that needs to be done, but I havn’t looked further into it.

EDIT:: You will also have to create the ‘wool\_patch’ item and add it as the “salvage\_id” of wool in materials.json

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 7:33pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/3 "2014-11-04T19:33:47Z")

</div>

> [@TheFlame52](#):
>
> I’m trying to make wool items cuttable into wool patches. These can be disassembled into wool thread, which can be used as thread or with knitting needles to make other wool clothing. I want to find the code for leather patches or rags, so I can copy it and learn from it. However, I can’t find it. Where is it in the code, and what would I need to do to do all this?

I think it’s in items\>melee .json

When I did a search for “flesh” it was the first thing that came up

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 4, 2014, 8:15pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/4 "2014-11-04T20:15:22Z")

</div>

I think I got it all, but you can check [here](https://github.com/TheFlame52/Cataclysm-DDA/compare/wool-recipe). Now all I need to do is make recipes for wool items.

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 5, 2014, 1:18pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/5 "2014-11-05T13:18:19Z")

</div>

How does time in the code relate to time in game?

---

<div class="post-metadata">

**Author:** ![Shoes](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@Shoes](https://discourse.cataclysmdda.org/u/Shoes)\
**Post date:** [November 5, 2014, 2:58pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/6 "2014-11-05T14:58:21Z")

</div>

1 turn is 6 seconds, 10 turns is a minute. That’s what you’re looking for, right?

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 5, 2014, 3:44pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/7 "2014-11-05T15:44:03Z")

</div>

I think so. How long does it take to craft a rag?

---

<div class="post-metadata">

**Author:** ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Post date:** [November 6, 2014, 3:54am UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/8 "2014-11-06T03:54:10Z")

</div>

> [@TheFlame52](#):
>
> I think so. How long does it take to craft a rag?

Crafting times are generally in turns, IIRC, so a minute in crafting-duration would be 10. Hoping that helps.

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 6, 2014, 12:46pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/9 "2014-11-06T12:46:25Z")

</div>

Yeah, I figured that out on my own.

---

<div class="post-metadata">

**Author:** ![i2amroy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/i2amroy/32/909_2.png) [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Post date:** [November 6, 2014, 8:54pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/10 "2014-11-06T20:54:33Z")

</div>

> [@KA101](#):
>
> [quote=“TheFlame52, post:7, topic:7747”]I think so. How long does it take to craft a rag?

Crafting times are generally in turns, IIRC, so a minute in crafting-duration would be 10. Hoping that helps.[/quote]  
Actually that’s false. Crafting recipe times are given in “ticks”, so a 1 minute crafting duration (for an average player) would be 1000. This is to ensure that faster players can craft things faster (since most things you would craft depend on how fast you can accurately move in the real world, whereas only a few things [like cooking] actually depend on a certain amount of time passing).

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 6, 2014, 8:57pm UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/11 "2014-11-06T20:57:48Z")

</div>

> [@i2amroy](#):
>
> [quote=“KA101, post:8, topic:7747”]Crafting times are generally in turns, IIRC, so a minute in crafting-duration would be 10. Hoping that helps.

Actually that’s false. Crafting recipe times are given in “ticks”, so a 1 minute crafting duration (for an average player) would be 1000. This is to ensure that faster players can craft things faster (since most things you would craft depend on how fast you can accurately move in the real world, whereas only a few things [like cooking] actually depend on a certain amount of time passing).[/quote]  
Yep, can confirm.

---

<div class="post-metadata">

**Author:** ![KA101](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Post date:** [November 7, 2014, 12:41am UTC](https://discourse.cataclysmdda.org/t/help-finding-code-for-rags-leather-patches-never-mind-done/7747/12 "2014-11-07T00:41:37Z")

</div>

Hence the IIRC. 😉
