# The Toolbox

**URL:** https://discourse.cataclysmdda.org/c/game-talk/the-toolbox/21.md?page=23

[Latest](https://discourse.cataclysmdda.org/latest.md) · [Categories](https://discourse.cataclysmdda.org/categories.md) · [Tags](https://discourse.cataclysmdda.org/tags.md)

**Page:** 24

---

## [Loop structure](https://discourse.cataclysmdda.org/t/loop-structure/2556)

<div class="topic-metadata">

**Author:** [@HRose](https://discourse.cataclysmdda.org/u/HRose)\
**Replies:** 6\
**Last updated:** [August 20, 2013, 7:23pm UTC](https://discourse.cataclysmdda.org/t/loop-structure/2556 "2013-08-20T19:23:39Z")

</div>

My question is generic since I’m a totally noob and trying to understand how these games are structured. But I’m curious to know how Cataclysm handles this. My problem is that I have a tendency to create loop branches t…

---

## [Cataclysm Code Guide](https://discourse.cataclysmdda.org/t/cataclysm-code-guide/2721)

<div class="topic-metadata">

**Author:** [@drake1storm](https://discourse.cataclysmdda.org/u/drake1storm)\
**Replies:** 5\
**Last updated:** [August 18, 2013, 2:21am UTC](https://discourse.cataclysmdda.org/t/cataclysm-code-guide/2721 "2013-08-18T02:21:02Z")

</div>

It is becoming abundantly clear that most of us, regardless of our programming abilities, want to mod this game into our personal wonderlands. Basically, this is going to be a “go here to do x” type of guide with each t…

---

## [Healing a friendly dog that follows you](https://discourse.cataclysmdda.org/t/healing-a-friendly-dog-that-follows-you/2722)

<div class="topic-metadata">

**Author:** [@Wayfarer](https://discourse.cataclysmdda.org/u/Wayfarer)\
**Replies:** 1\
**Last updated:** [August 17, 2013, 8:51pm UTC](https://discourse.cataclysmdda.org/t/healing-a-friendly-dog-that-follows-you/2722 "2013-08-17T20:51:35Z")

</div>

A personal alteration of mine for my game has been to edit the code for dog food so that it can restore the hp of a friendly dog. I got the code from the MGS mod originally. I’ve been away from Cata for a while and sin…

---

## [Adding new items and weapons](https://discourse.cataclysmdda.org/t/adding-new-items-and-weapons/1360)

<div class="topic-metadata">

**Author:** [@ClaytonRISING](https://discourse.cataclysmdda.org/u/ClaytonRISING)\
**Replies:** 28\
**Last updated:** [August 16, 2013, 10:13am UTC](https://discourse.cataclysmdda.org/t/adding-new-items-and-weapons/1360 "2013-08-16T10:13:30Z")

</div>

I couldn’t find a thread for simple questions on modding/technical details, so I apologize in advance for this seemingly redundant thread. If there is a better place for it, or if it should be delete, please feel free to…

---

## [About Power Armors](https://discourse.cataclysmdda.org/t/about-power-armors/2436)

<div class="topic-metadata">

**Author:** [@Sidower](https://discourse.cataclysmdda.org/u/Sidower)\
**Replies:** 1\
**Last updated:** [August 10, 2013, 7:44pm UTC](https://discourse.cataclysmdda.org/t/about-power-armors/2436 "2013-08-10T19:44:06Z")

</div>

Hello, I would like to try to make a new power armor, could someone please tell me step by step what I would need to make one or if it’s even possible to make one at moment? I would really appreciate it.

---

## [Objects x, y location](https://discourse.cataclysmdda.org/t/objects-x-y-location/2443)

<div class="topic-metadata">

**Author:** [@naraceaus](https://discourse.cataclysmdda.org/u/naraceaus)\
**Replies:** 2\
**Last updated:** [August 6, 2013, 1:22pm UTC](https://discourse.cataclysmdda.org/t/objects-x-y-location/2443 "2013-08-06T13:22:07Z")

</div>

Hi guys, I’m trying to figure out the location system in the source code. I’ve realized that an objects x, y position is only relevant for about 11 tiles worth in a square. Then I think each 11\*11 square is stored in a …

---

## [Building on Windows with MingW, and dealing with libintl\_gettext errors](https://discourse.cataclysmdda.org/t/building-on-windows-with-mingw-and-dealing-with-libintl-gettext-errors/2521)

<div class="topic-metadata">

**Author:** [@Seth](https://discourse.cataclysmdda.org/u/Seth)\
**Replies:** 0\
**Last updated:** [August 3, 2013, 4:23am UTC](https://discourse.cataclysmdda.org/t/building-on-windows-with-mingw-and-dealing-with-libintl-gettext-errors/2521 "2013-08-03T04:23:45Z")

</div>

It’s a work in progress, but I’m working on an updated makefile for MingW based on the default Makefile, which supports both SDL and non-SDL builds and deals with undefined reference errors related to libintl\_gettext. T…

---

## [Using Code::Blocks on master on Windows](https://discourse.cataclysmdda.org/t/using-code-blocks-on-master-on-windows/2449)

<div class="topic-metadata">

**Author:** [@nathiral](https://discourse.cataclysmdda.org/u/nathiral)\
**Replies:** 2\
**Last updated:** [August 2, 2013, 9:11pm UTC](https://discourse.cataclysmdda.org/t/using-code-blocks-on-master-on-windows/2449 "2013-08-02T21:11:53Z")

</div>

Followed http://www.wiki.cataclysmdda.com/index.php?title=How\_to\_compile for Code::Blocks on Windows, but I’m getting an error: “ld.exe: cannot find -liconv.” No idea what that means. Googling around has shown me I mig…

---

## [Trying to understand bresenhams line algorithm](https://discourse.cataclysmdda.org/t/trying-to-understand-bresenhams-line-algorithm/2338)

<div class="topic-metadata">

**Author:** [@ScrodumGod](https://discourse.cataclysmdda.org/u/ScrodumGod)\
**Replies:** 6\
**Last updated:** [July 29, 2013, 9:24pm UTC](https://discourse.cataclysmdda.org/t/trying-to-understand-bresenhams-line-algorithm/2338 "2013-07-29T21:24:47Z")

</div>

Well, i tried to read the line.h file so i can understand it myself, but to me it looks like unmaintainable code. I have noticed when programming (c++) that everything has some logic, like its not how you would do it in …

---

## [Adding Ammunition Types](https://discourse.cataclysmdda.org/t/adding-ammunition-types/2403)

<div class="topic-metadata">

**Author:** [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Replies:** 2\
**Last updated:** [July 25, 2013, 6:16pm UTC](https://discourse.cataclysmdda.org/t/adding-ammunition-types/2403 "2013-07-25T18:16:43Z")

</div>

As a learning experiment I’m attempting to add a ammunition type and weapons to use it. Both work as intended, but when examined in-game the ‘ammunition type’ is listed as XXX for both. What is required to make the amm…

---

## [Gettext problem (solved)](https://discourse.cataclysmdda.org/t/gettext-problem-solved/2319)

<div class="topic-metadata">

**Author:** [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)\
**Replies:** 1\
**Last updated:** [July 21, 2013, 10:16am UTC](https://discourse.cataclysmdda.org/t/gettext-problem-solved/2319 "2013-07-21T10:16:50Z")

</div>

Strings in header sometimes can’t be translated Because textdomain is called in main(), code outside of main are executed before that so gettext doesn’t know which mo file it should load. An example: facdata.h Possib…

---

## [Thinking about an item placement rewrite](https://discourse.cataclysmdda.org/t/thinking-about-an-item-placement-rewrite/2064)

<div class="topic-metadata">

**Author:** [@placeybordeaux](https://discourse.cataclysmdda.org/u/placeybordeaux)\
**Replies:** 1\
**Last updated:** [July 15, 2013, 4:59pm UTC](https://discourse.cataclysmdda.org/t/thinking-about-an-item-placement-rewrite/2064 "2013-07-15T16:59:42Z")

</div>

Currently add\_item searches over an area to place an item if it doesn’t fit and it doesn’t take into account weight constraints, but it does take into account max item constraints. The search over the area is done recurs…

---

## [How to code in new addictions?](https://discourse.cataclysmdda.org/t/how-to-code-in-new-addictions/2151)

<div class="topic-metadata">

**Author:** [@TheGrifter](https://discourse.cataclysmdda.org/u/TheGrifter)\
**Replies:** 0\
**Last updated:** [July 9, 2013, 4:18am UTC](https://discourse.cataclysmdda.org/t/how-to-code-in-new-addictions/2151 "2013-07-09T04:18:15Z")

</div>

Does anyone know how to code in new addictions? I’m trying to code in new drugs, and with them, their addictions. Slurm so deliciously addictive you could chew your arms off for a gulp. And etcetera. But all that I can …

---

## [Code::Blocks Tooltips](https://discourse.cataclysmdda.org/t/code-blocks-tooltips/1887)

<div class="topic-metadata">

**Author:** [@ejseto](https://discourse.cataclysmdda.org/u/ejseto)\
**Replies:** 1\
**Last updated:** [June 28, 2013, 3:28am UTC](https://discourse.cataclysmdda.org/t/code-blocks-tooltips/1887 "2013-06-28T03:28:54Z")

</div>

Is there a way to turn off these infuriating mouse-over tooltips? Just when I start liking Code::Blocks, I realize these damn things are basically popping up covering what I’m trying to type 90% of the time. Actually, I …

---

## [Coding error](https://discourse.cataclysmdda.org/t/coding-error/1874)

<div class="topic-metadata">

**Author:** [@DeadWeight](https://discourse.cataclysmdda.org/u/DeadWeight)\
**Replies:** 10\
**Last updated:** [June 22, 2013, 5:33pm UTC](https://discourse.cataclysmdda.org/t/coding-error/1874 "2013-06-22T17:33:11Z")

</div>

Hey all, so I’ve been trying to make a custom weapon in my game but everytime I make it it was something that says Item error. I can change specs of any weapon I want, but it seems if I change the name it glitches out. N…

---

## [How to make a new profession?](https://discourse.cataclysmdda.org/t/how-to-make-a-new-profession/1762)

<div class="topic-metadata">

**Author:** [@stone94](https://discourse.cataclysmdda.org/u/stone94)\
**Replies:** 4\
**Last updated:** [June 19, 2013, 5:07pm UTC](https://discourse.cataclysmdda.org/t/how-to-make-a-new-profession/1762 "2013-06-19T17:07:18Z")

</div>

so which file do I edit to create a new profession, i figure that should be within my abilities to code :P? of course I’m completely willing to provide them to the community when i figure it out xD

---

## [Coding in New Drugs Help](https://discourse.cataclysmdda.org/t/coding-in-new-drugs-help/1711)

<div class="topic-metadata">

**Author:** [@TheGrifter](https://discourse.cataclysmdda.org/u/TheGrifter)\
**Replies:** 9\
**Last updated:** [June 16, 2013, 10:56pm UTC](https://discourse.cataclysmdda.org/t/coding-in-new-drugs-help/1711 "2013-06-16T22:56:18Z")

</div>

I’m working on a Fear And Loathing mod, and I’d like to really expand the drugs in this game. Only, there’s a few things confusing me: 1.: What determines the duration of a drug? 2.: What does PKILL1, 2, 3, and 4 corre…

---

## [Dealing with item names and item flags](https://discourse.cataclysmdda.org/t/dealing-with-item-names-and-item-flags/1746)

<div class="topic-metadata">

**Author:** [@Shoes](https://discourse.cataclysmdda.org/u/Shoes)\
**Replies:** 4\
**Last updated:** [June 12, 2013, 10:01pm UTC](https://discourse.cataclysmdda.org/t/dealing-with-item-names-and-item-flags/1746 "2013-06-12T22:01:15Z")

</div>

I am looking into make some clothing “foldable” or “packable”, such as sleeping bags and blankets. I notice that, while sewing, there is this piece of code for adding an item flag : Is there an opposite function that …

---

## [Flavored Mutagen-where'd the reactions go?](https://discourse.cataclysmdda.org/t/flavored-mutagen-whered-the-reactions-go/1708)

<div class="topic-metadata">

**Author:** [@KA101](https://discourse.cataclysmdda.org/u/KA101)\
**Replies:** 8\
**Last updated:** [June 11, 2013, 1:43am UTC](https://discourse.cataclysmdda.org/t/flavored-mutagen-whered-the-reactions-go/1708 "2013-06-11T01:43:25Z")

</div>

I was going to proofread the reaction messages for the various Mutagens uneron created, but now I can’t find them. They used to be in iuse.cpp; I’ve checked there and in comestibles.json. Did the flavor text get delete…

---

## [Something about basecamp.cpp](https://discourse.cataclysmdda.org/t/something-about-basecamp-cpp/1692)

<div class="topic-metadata">

**Author:** [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)\
**Replies:** 2\
**Last updated:** [June 10, 2013, 9:28am UTC](https://discourse.cataclysmdda.org/t/something-about-basecamp-cpp/1692 "2013-06-10T09:28:23Z")

</div>

std::string savename = name; replace(savename.begin(), savename.end(), ' ', '\_'); It doesn’t make sense or I just miss something? What is repalce? Shouldn’t it be savename.repalce instead?

---

## [Coding Help](https://discourse.cataclysmdda.org/t/coding-help/1657)

<div class="topic-metadata">

**Author:** [@PaintBucket](https://discourse.cataclysmdda.org/u/PaintBucket)\
**Replies:** 5\
**Last updated:** [June 9, 2013, 11:10pm UTC](https://discourse.cataclysmdda.org/t/coding-help/1657 "2013-06-09T23:10:55Z")

</div>

I’m attempting to change the recipe of the revolver shotgun to actually include a revolver, so the revolver mechanism doesn’t just appear out of nowhere when you craft it. It isn’t working, can anyone tell me what’s wro…

---

## [Adding a new building](https://discourse.cataclysmdda.org/t/adding-a-new-building/1650)

<div class="topic-metadata">

**Author:** [@system](https://discourse.cataclysmdda.org/u/system)\
**Replies:** 1\
**Last updated:** [June 8, 2013, 8:19am UTC](https://discourse.cataclysmdda.org/t/adding-a-new-building/1650 "2013-06-08T08:19:04Z")

</div>

So I’m not actually a coder, my friends do most of my coding for any mod I might have mentioned. So I want to add a single building, a beebox. Taking 1 honey, 4 boards, 8 nails, and a hammer OR rock. Now I want every 7…

---

## [Mods.json, only one mod](https://discourse.cataclysmdda.org/t/mods-json-only-one-mod/1612)

<div class="topic-metadata">

**Author:** [@ClaytonRISING](https://discourse.cataclysmdda.org/u/ClaytonRISING)\
**Replies:** 3\
**Last updated:** [June 5, 2013, 9:05pm UTC](https://discourse.cataclysmdda.org/t/mods-json-only-one-mod/1612 "2013-06-05T21:05:20Z")

</div>

I was wanting to add some new weapon mods, but I looked in the “mod.json” file and it only had the .45 caliber retool mod. Is this correct as of now or is it a problem on my end?

---

## [Need guides for stickies:](https://discourse.cataclysmdda.org/t/need-guides-for-stickies/1611)

<div class="topic-metadata">

**Author:** [@GlyphGryph](https://discourse.cataclysmdda.org/u/GlyphGryph)\
**Replies:** 2\
**Last updated:** [June 5, 2013, 5:19pm UTC](https://discourse.cataclysmdda.org/t/need-guides-for-stickies/1611 "2013-06-05T17:19:19Z")

</div>

I need the following guides, or how-tos, to get people started: \[ul\]\[li\]Compiling on Linux walkthrough\[/li\] \[li\]Contributions Standards Guide (things like the style guide and how we’re switching over, process for git p…

---

## [Code Help (Currently Solved)](https://discourse.cataclysmdda.org/t/code-help-currently-solved/1394)

<div class="topic-metadata">

**Author:** [@i2amroy](https://discourse.cataclysmdda.org/u/i2amroy)\
**Replies:** 8\
**Last updated:** [June 5, 2013, 6:58am UTC](https://discourse.cataclysmdda.org/t/code-help-currently-solved/1394 "2013-06-05T06:58:28Z")

</div>

So right now I’m working on a small light rework so that flags like LIGHT\_4 actually have an effect without needing to be hacked into the game, but I’ve run into a small problem. Here is the important part of my code ri…

---

## [Compiling mapgen.cpp](https://discourse.cataclysmdda.org/t/compiling-mapgen-cpp/1562)

<div class="topic-metadata">

**Author:** [@utunnels](https://discourse.cataclysmdda.org/u/utunnels)\
**Replies:** 1\
**Last updated:** [June 2, 2013, 11:27am UTC](https://discourse.cataclysmdda.org/t/compiling-mapgen-cpp/1562 "2013-06-02T11:27:33Z")

</div>

Well I don’t know if it is just me. If I enable -O3 or -Os (I’m using gcc 3.x on windows), I always run into out of memory problem. Even if it finishes, it takes ages. Unless I use -O0, in which case it’s compiled in a…

---

## [Why exacly JSON?](https://discourse.cataclysmdda.org/t/why-exacly-json/1433)

<div class="topic-metadata">

**Author:** [@Jahanni](https://discourse.cataclysmdda.org/u/Jahanni)\
**Replies:** 8\
**Last updated:** [May 25, 2013, 9:09am UTC](https://discourse.cataclysmdda.org/t/why-exacly-json/1433 "2013-05-25T09:09:43Z")

</div>

Hey, why exactly JSON? I’m wondering why you chose the JSON over XML. You are already making the first workarounds and wrappers for the picojson code because you are dissatisfied by the interface and need to check the …

---

## [What's the easiest way to modify .json files?](https://discourse.cataclysmdda.org/t/whats-the-easiest-way-to-modify-json-files/1376)

<div class="topic-metadata">

**Author:** [@Shoes](https://discourse.cataclysmdda.org/u/Shoes)\
**Replies:** 11\
**Last updated:** [May 24, 2013, 8:11am UTC](https://discourse.cataclysmdda.org/t/whats-the-easiest-way-to-modify-json-files/1376 "2013-05-24T08:11:38Z")

</div>

Reason I ask is because only about two items fit on the screen at once for editing. If I want to do a mass change, it would take a bit of time to scroll around to add each line. Is there a way to like… export to excel or…

---

## [Moist Nuggets](https://discourse.cataclysmdda.org/t/moist-nuggets/1261)

<div class="topic-metadata">

**Author:** [@Dintin](https://discourse.cataclysmdda.org/u/Dintin)\
**Replies:** 5\
**Last updated:** [May 16, 2013, 8:57pm UTC](https://discourse.cataclysmdda.org/t/moist-nuggets/1261 "2013-05-16T20:57:21Z")

</div>

I’m trying to add GLORIOUS MOSIN-NAGANT RIFLE to the game, and the rifle itself is in. Added it with no problems. What I’m having trouble with is adding 7.62x54mmR ammunition to the game. I get a file factory error each …

---

## [Making a trap](https://discourse.cataclysmdda.org/t/making-a-trap/1149)

<div class="topic-metadata">

**Author:** [@drake1storm](https://discourse.cataclysmdda.org/u/drake1storm)\
**Replies:** 12\
**Last updated:** [May 12, 2013, 11:14pm UTC](https://discourse.cataclysmdda.org/t/making-a-trap/1149 "2013-05-12T23:14:02Z")

</div>

Okay, for the past few days (few hours, really), I’ve been working on getting a mod up and running. Currently I am working on adding a few new traps. I’ve already created them in trapdef, created the effects in trapfunc…

[Previous page](https://discourse.cataclysmdda.org/c/game-talk/the-toolbox/21.md?page=22)

[Next page](https://discourse.cataclysmdda.org/c/game-talk/the-toolbox/21.md?page=24)
