My CDDA mods and activities

Hello, been a while since I was last about and I’ve learned a little bit more. This first page is intended to be my current (small) mods and activities for CDDA, as they are all relatively small items it didn’t make sense to flood the forum with them.

Mods:
-Food Preservation by Irradiation is one of my larger mods where I’ve added in an item which functions as a tool and a bunch of recipes to enable turning various food items into their irradiated and bagged counterparts. Keep your fruits and veggies ‘fresh’ for decades…
-Rechargable small and medium batteries simply makes storage batteries recharge in ‘UPS-compatible recharging station’ or if using ‘Bright Nights’ mod, the ‘battery charger’ compartment. Great for if you’ve installed a ‘battery compartment mod’ on any of your battery operated tools. The alternative to get those charged is to weld and unweld the batteries into vehicles… Be careful what you mod as those storage batteries are heavy.
-Wilderness Overhaul originally by MormonPartyboat and then Malkeus from this thread. This is technically my first real foray into modding cdda and is very rough around the edges, when I’ve found something that wasn’t working I’ve tried to fix it, not at all balanced in some ways. Much of the guts of this mod have either been merged into CDDA or no longer function due to parts of CDDA they relied on having been changed. In one case I’ve split off a piece that doesn’t work anymore into a new branch of CDDA.

BTW: You may see a fair bit of copy code in the above mods as I tend to start from a base from ‘somewhere’ and then tweak to fit. I’ve also made an attempt more recently to use “copy-from” property and abstracts. I haven’t yet found in the code or data the defaults for various properties so I’m still defining some properties that I “shouldn’t” be as they’d be handled by default values. I have figured out where in the code various properties (json strings) are defined, just not their default values.

My Branches of CDDA, these are items I’d like to eventually PR into CDDA:
-Tree Harvesting also known as tree cutting. I’ve added additional code to support cutting tries and the rest is basically from Wilderness Overhaul.
–The code change is pretty minimal but might not be the right approach as what I’d like to do with that code is to enable transforming a target terrain/furniture while dropping stuff specified by the recipe. The current code is very specific to terrain however it is pretty small.
–I tried another approach where the stuff to drop was stored in the terrain, the current approach only modifies one cpp file and one header. That other approach modified 3 or 4 cpp files.
-Add Item Desirability Marker adds in a new column to the Advanced Inventory which uses symbols from 1 to 9 to signify desirability of the item. For example if I’ve found a tool and I don’t want any more I give it a 9 flag signifying do not pickup. I do most of my item pickups while holding onto a basket and so almost exclusively use Advanced Inventory while scouting the world. If an article of clothing or a tool hasn’t been flagged there is a good chance I’ve not seen it before.
–Originally started with the intent to add a small highlight to items much like if an item has an auto-pickup rule (default letter p in advanced inventory) but I need to learn more so I went with the symbols first. This was my first foray into adding new code to CDDA rather than a simple bug fix. Once I understand how to do what I’d really prefer I’ll look at expanding this to other inventory windows as apt since I don’t want to add a new column there.

BTW: In order to play with the above branches I periodically rebase each branch to current code and then merge followed by recompile.

You are maintaining branches of the whole game?! That is impressive!

The Food preservation my is going on my mods list too!

[quote=“Profound_Darkness, post:1, topic:13903”]An open question:
I’ve happened on a handful of bugs not mentioned on github, some of which are exceedingly squirly, and I’d like to fix them but in order to track down the problem code I need to figure out how to attach a debugger to CDDA. I was never very good at debugging using printf. Also I’m accustomed to learning about unfamiliar code by stepping through it. I have both VS2017 which I’ve been unable to get the project loaded/built there[/quote]

Why not install and use VS 2015 if you already know how to use 2017?

The solution/project would need to be updated to 2017 if you want to run it with that VS version. Which I didn’t managed to update correctly too. Found easier to just use 2015.

Well that answers some questions… thanks.

As for why not VS2015: While I started out coding in Windows/VS (VS wasn’t cheap), the vast majority of my experience coding has been in Linux, usually with Eclipse or just good old vim. I’m not really all that great with VS, never was, I only installed it again recently for C# and the projects started making use of some syntax that 2015 can’t handle, I might add I didn’t know C# until mid February and had been using the (IMO superior) SharpDevelop IDE. Also I don’t currently have the space on my Windows partition to install VS2015 with 2017 already there. I don’t have the bandwidth to just swap between them.

Now that I know 2015 is an answer to the problem… It will take some doing but there is a way I can get 2015 installed along side 2017. Raw backup of OS HD, remove a rarely used OS partition, rearrange partitions & resize Windows partition, cross fingers and hope remaining OSes boot/fix them.

I’d love to know if you do have both 2015 and 2017 installed as I’ve found some worrying reading that 2015 projects don’t compile properly in VS2015 after VS2017 is installed.

I’d also still love to hear from someone running Eclipse and working on CDDA… I’m feeling far less concerned though now that there is apparently a path forward. I’ll probably take one more shot at Eclipse before doing the partition shuffle either way.

Given that I only learned C++ to mod cata, I only have VS 2015. I uninstalled 2017 as I don’t have a reason to use it and it frees up HD space.

Heh… that’s why I learned C#: to mod a game. A good way to learn too IMO, by doing. In my case I figured fixing a mod that wasn’t doing well was a good way to learn.

[edit]

[quote=“Profound_Darkness, post:1, topic:13903”]An open question:
I’ve happened on a handful of bugs not mentioned on github, some of which are exceedingly squirly, and I’d like to fix them but in order to track down the problem code I need to figure out how to attach a debugger to CDDA. I was never very good at debugging using printf. Also I’m accustomed to learning about unfamiliar code by stepping through it. I have both VS2017 which I’ve been unable to get the project loaded/built there, Eclipse (Linux) which I’ve been unable to get the project loaded/built in, as well as Code::Blocks which I find unsatisfying relative to Eclipse and while I’ve gotten the project to load I still use the compiler from the terminal and haven’t been able to get breakpoints to trip.

If you know something about this I would appreciate being pointed to something apt or even an explanation to get going with debugging, ideally with Eclipse as that is what I’m most comfortable working on/debugging C/C++ with. (Also debugging PHP and Java). Failing Eclipse, VS is a distant second choice as I’ve done some C# coding/debugging there, followed by Code::Blocks. All the C/C++ projects I’ve worked on in the past were created with Eclipse hence my lack of knowledge here and my searches haven’t proved useful. My last attempt to get one of those to work was about 2 weeks ago.[/quote]

So I made some progress on this for Eclipse in Linux. Still not building with Eclipse (which is OK) but using an external shell script. I’m using the following settings for the build 'DEBUG_SYMBOLS=1 RELEASE= LUA=1 CLANG=1 CCACHE=1 TILES=1 SOUND=1’
Then I set Eclipse to not autobuild and the debug to launch the binary and breakpoints work (also get details about variables). :slight_smile: Code::Blocks is working much the same though it’s also building from Code::Blocks.

From skimming the Makefile the variable DEBUG_SYMBOLS is used both with and without RELEASE, if it’s not defined then debug symbols are not present.
Also if you’ve built the project using a different set of variables (ie no DEBUG_SYMBOLS and RELEASE=1) it seems you need to do a clean (make clean). I knew better but I still stumbled on that one so I’m being extra clear.

I’ll be removing the open question from the first thread now.
[/edit]

Rechargable small and medium batteries could probably go mainline.

I’m probably going to restart with these mods. Thanks!