# Mention about ID choices

**URL:** <https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831>\
**Category:** The Toolbox\
**Created:** [July 6, 2018, 4:23am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831 "2018-07-06T04:23:53Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 6, 2018, 4:23am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/1 "2018-07-06T04:23:53Z")

</div>

–I’m using the wrong computer, and as such don’t have the game’s files to directly reference, but I definitely remember some (seemingly) pretty weird ID choices for various things in the game.  
–For example: I don’t remember exactly what it was (other than weird), but from my point of view, aluminum can should be aluminum\_can or can\_aluminum. If you care to specifically mention it being opened or a container, do something like opened\_aluminum\_can. Same way for tin cans.  
–I tend to make all my ID pretty obvious. All essences work like this: essence\_noob, essence\_bacon, essence\_plutonium. Well, _maybe_ there was an ‘of’ in the middle of each, but something simple like that. The ID for the floating brick is floating\_brick. There is also tickle\_monster.  
–Sometimes it makes perfect sense, since the ID for brick is brick. Other times, I don’t really get it. I don’t expect this to ever change, since at this point it is fairly deeply ingrained and would take a lot of work for such a small thing. I don’t really find it _annoying_, but simple weird.  
–I always tend to standardize IDs in a way, similar to how I do essences. They always have a pattern. Any and all dragons I make will be something like red\_dragon, green\_dragon, blue\_dragon, or the other way around.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [July 6, 2018, 6:40am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/2 "2018-07-06T06:40:03Z")

</div>

It’s really easy for one person to do things like this in a consistent way, you just do it the way that’s comfortable to you. Once you have multiple people involved, you have to put effort into describing what consistent means to you, and you have to expand effort insuring everyone follows the rules. This particular issue has never been important enough to expend that kind of effort on.

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 6, 2018, 8:01am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/3 "2018-07-06T08:01:23Z")

</div>

I agree with Kevin, beyond actual coding all this has little to no effect, and absolutely none for the average player. Making them all consistent would be pretty neat, but isn’t worth the effort. One thing I’d really like is a good way to check item id’s, perhaps a functionality that could be added to Chezzo’s item browser?

---

<div class="post-metadata">

**Author:** ![Narroe](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/narroe/32/2081_2.png) [@Narroe](https://discourse.cataclysmdda.org/u/Narroe)\
**Post date:** [July 7, 2018, 12:22am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/4 "2018-07-07T00:22:47Z")

</div>

> [@darktoes](#):
>
> One thing I’d really like is a good way to check item id’s

you can already do this via the Debug function menu by clicking “wish for an item”, then entering “/” and searching the ingame item name.

 ![wish](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/f/fbf8234b52e6a79ff4e220c075bf05a4f5c10dbb.png)

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 7, 2018, 2:30am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/5 "2018-07-07T02:30:30Z")

</div>

I’m aware of that, but it would be nice if i could check things without starting up the game.

---

<div class="post-metadata">

**Author:** ![Narroe](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/narroe/32/2081_2.png) [@Narroe](https://discourse.cataclysmdda.org/u/Narroe)\
**Post date:** [July 7, 2018, 11:47am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/6 "2018-07-07T11:47:37Z")

</div>

I see. Outside of the game; I personally keep referring to **data/json/item\_groups.json**

since it has a vast list of item ids. It is also pretty easy to guess what the item is via it’s id name.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 7, 2018, 4:53pm UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/7 "2018-07-07T16:53:48Z")

</div>

–I noticed that Debug menu function while I was using it to test out my mod, and it is _incredibly_ useful. Way better than searching through the files to find the IDs.  
–In retrospect (I’m mention a thought I had even before I made this thread), it _does_ actually make lots of sense for aluminum and tin cans to be in containers.json. After all, they _are_ containers.  
–The ID for the aluminum can is “can\_drink”. Since Kevin has graced us with his prossence perhaps he could explain as to why exactly that is the ID. Of course, it may have been far too long ago to remember.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [July 7, 2018, 4:58pm UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/8 "2018-07-07T16:58:28Z")

</div>

Because originally it was the only one, later the others were added, but since most of them would be aluminum, that one was unchanged, and migrating the I’d is more trouble than it’s worth.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 7, 2018, 5:04pm UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/9 "2018-07-07T17:04:55Z")

</div>

–Ah, yes, I get it now. I imagine there is probably lots of similar cases for IDs in the game. I wish there was some sort of convenient “turn all this into this” button to use on all the files, but the time it would take to alter the IDs for everything would be _very_ unconventional for how little impact it would be. It is one of those things you _wish_ could/would change but it doesn’t really matter much in the end.

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [July 7, 2018, 7:11pm UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/10 "2018-07-07T19:11:57Z")

</div>

We have one, but based on the way savegames work, you have to leave the transition data in place for a very long time.

---

<div class="post-metadata">

**Author:** ![redxlaser15](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/redxlaser15/32/1573_2.png) [@redxlaser15](https://discourse.cataclysmdda.org/u/redxlaser15)\
**Post date:** [July 8, 2018, 2:22am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/11 "2018-07-08T02:22:17Z")

</div>

I don’t understand what you are talking about. Transition data?

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 8, 2018, 2:34am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/12 "2018-07-08T02:34:57Z")

</div>

As you know, all items have ID codes. Those ID codes are what is saved in a save file, rather than the name of the item we see. If you change the ID code of an item then when the save file is loaded it looks for an item that doesn’t exist and anytime you go near where that item was it will throw an error. However, you can set up transition code that converts the item with the old ID code to the new ID code (apparently). That way it will convert all the items with the old ID to the new one, so you don’t throw errors with that save.

However, since the game only loads data near where you are, if you try to transition something common, like a drink can, you would have to walk near every single existing drink can in the game for them all to transition, otherwise it will still throw errors when you walk near one that hasn’t once the transition code has been removed.

All that said, could someone give a quick example of what that transition code would be?

---

<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:** [July 8, 2018, 4:20am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/13 "2018-07-08T04:20:47Z")

</div>

see data/json/items/migration.json ([https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/items/migration.json](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/items/migration.json)) for all the item migrations, but they’re generally of the form  
{  
“id”: “arrowhead”,  
“type”: “MIGRATION”,  
“replace”: “steel\_chunk”  
},

the actual c++ code to migrate items looks like it is in item\_factory.cpp in the load\_migration and migrate\_id functions.

---

<div class="post-metadata">

**Author:** ![darktoes](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@darktoes](https://discourse.cataclysmdda.org/u/darktoes)\
**Post date:** [July 8, 2018, 4:37am UTC](https://discourse.cataclysmdda.org/t/mention-about-id-choices/15831/14 "2018-07-08T04:37:47Z")

</div>

Neato. Thanks for that.
