Armor Up! A mod to make armor more better. New PA Utilities pack!

Thank you for replying so frequently and your willingness to help! I gotta say your contributions to the project are fantastic.

I have (a lot of) questions about the armor mod. Should I duplicate the code of, let’s say the active defense shield bionic, in the armor_tools file (and is as simple as copy and paste with minor tweaks)? Then call it as a use action in the power armor definition in the armors file? Also one thing i’m really not sure of is how to affect the players base stats by simply powering on the armor. The only way I can think of at the moment is by compiling changes in the character.cpp file. Thank you for the help!

1 Like

You can’t put C++ code from a .cpp file in a .json file. That will not work at all.

bio_ads is interesting, because the support code for it is actually in player::absorb_hit():

        // The bio_ads CBM absorbs damage before hitting armor
        if( has_active_bionic( bio_ads ) ) {
            if( elem.amount > 0 && power_level > 24 ) {
                if( elem.type == DT_BASH ) {
                    elem.amount -= rng( 1, 8 );
                } else if( elem.type == DT_CUT ) {
                    elem.amount -= rng( 1, 4 );
                } else if( elem.type == DT_STAB ) {
                    elem.amount -= rng( 1, 2 );
                }
                charge_power(-25);
            }
            if( elem.amount < 0 ) {
                elem.amount = 0;
            }
        }

you would want similar code in the same place, but with a different check in the if statement, and draining UPS power instead of bionic charge.

You’d have to do a similar analysis for each behavior you wanted implemented: “how does the game do something similar? can I reuse that code as is? could I refactor that code so my thing could also use it? Should I just copy and change that code?”

For stat boosters, you’ll want to go to Character::reset_stats() and… wow, that code is not great. I would feel bad for recommending you copy that code.
Okay, for stat boosters, you’ll want to go to Character::reset_stats(), rewrite it to loop through all of the character’s traits, bionics, and items, and add or subtract the appropriate bonus or penalty from the thing in question. Then you’ll need to edit all of those things Json load functions, to parse and store a Json array that looks like “bonuses”: [ [ “stat_or_skill1”, NUM1 ], [ “stat_or_skill2”, NUM2 ] ] . And then you’ll need to through the existing traits and bionics .json files and add the bonus descriptors. And then after that, adding equipment bonuses will be easy, plus modding in new bonus mutations and bionics will be easier.

Screw that noise. Just use the artifact stat boost effects. It even totals them, so you can add and subtract enough to get pretty much any number and it will just show up as one effect.

I always forget about the artifacts code. Yeah, use artifacts.

Also, rewrite Character::reset_stats() at some point.

Ok so right now I’m trying to make a variant of power armor that is in the tool_armor file. Im attempting to have the armor transform into identical armor but in its “on” state and have that powered on version basically pull attributes from the enums.h file. But I can’t get the armor to drain power from the players internal power source. Any ideas?

Also if this doesn’t work, I’ll definitely look into just rewriting the Character::reset_stats() to be more easily modified and try that route.

you may be running into an issue that “power_armor”: true defines an activation action and your activation item defines an activation item. So you can transform in another suit of PA, but then it won’t be activated. And it’ll transform back into the base state if you try.

You may want to look at the code that implements “power_armor”: true, and see if you can get it to chain activation sequences.

This is a little off topic, but is there an easy way to make it so you could load a robot from jury rigged robots or a hacked robot into a vehicle like pet animal?

Animal capture code doesn’t check if a creature is an animal, so you should be able to load robots into livestock stalls and onboard kennels.

1 Like

New content! Power Armor Utilities includes craftable sheaths and stuff for power armor. Get it while it’s hot!

This pack was made because of prompting by Exceptional on Discord, who suggested maintaining Mokou-tan’s Power Armor Additions. I haven’t copied any of his/her code or anything, but it did serve as minor inspiration and an example.

What about armor on the low end that is actually armor? Say wooden styles of armor, maybe stuff made from PVC piping and other “hold my beer” type things?

It seems like the early game is rushing to find a duster/trench coat and leather clothes for protection, so it would be interesting to be able to make armor as a alternative (with other layers so joints can be protected.

My mind sees something similar to the armor used by the Haida, which used interlocking slats to make wood armor.

The LAT mention makes me wonder if a zombie could get out of a kiddie pool full of non-newtonian fluid as well…

Sounds good except, You can’t fit anything ‘worth the time’ that’s less significant than a trenchcoat, backpack or shopping cart.
Altho i’d appreciate being proven wrong.

You could have a real low end that would be just 2x4s, rags and nails to hold it together. Awful durability and only average coverage but craftable almost immediately. Maybe only used until you find the trench coat but it let’s you go into a city with something .

The other thought was upgrades, you make a shoddy wood breastplate, then at a higher level you can make it fitted or add strips of metal/plastic to improve it.

Storage is a bit more difficult though, maybe a sled thing that makes more noise and needs more str to drag but can make it early. That’s a discussion for a different thread though, this one doesn’t need a second derail haha.

There already exists arm and leg coverings made of 2x4s, but any kind of torso covering made from 2x4s screams “high-encumbrance” to me. I suppose you could just live with it, but I don’t think making bad makeshift armor and trying to tank the earlygame is the correct way to play.

That said, early wooden armor isn’t really within the scope of this mod. It’s intended more for advanced lategame stuff. If you wanted more makeshift armor I’d suggest asking around the makeshift items mod, or even getting started on your own mod.

Will these spawn or are the only craftable?

Craftable only.

Post must be 20 characters.

Dunno if its cos I’m running an older version of the game but I had some error messages come up when loading a save with the Power armour utilities mod running, nothing game breaking but I messed around with the recipes file until I fixed it and fixed the sheath not showing in the craft menu. I thought I’d see if you wanted me to upload it and thank you for the Mod while I’m here :slight_smile:

Depends how old the version you’re running is. If some new crafting updates dropped that broke my recipes I’d like to fix them, but I’m not overly concerned with supporting very old versions of the game.

0.c-29017 (I think) sorry still pretty new to the game so dunno how old exactly it is

I think that’s pretty old.