The Minor JSON Questions Thread

Because having a new thread for every small question is unreasonable.

I hope this sticks.

{
    "type": "effect_type",
    "id": "poisoned",
    "name": ["Poisoned"],
    "apply_message": "You feel poisoned!",
    "desc": ["You have been poisoned!"],
    "miss_messages": [["You feel bad inside.", 2]],
  "int_add_val": 1,
  "max_intensity": 3,
  "int_decay_step": -1,
  "int_decay_tick": 4000,
  "decay_messages": [["You feel a little better.", "neutral"], ["You don't feel poisoned any longer", "good"]],
    "rating": "bad",
    "resist_traits": ["POISRESIST"],
    "pain_sizing": true,
    "hurt_sizing": true,
    "main_parts_only": true,
    "base_mods": {
        "per_mod": [-2, -1],
        "dex_mod": [-1, -1],
        "str_mod": [-2, 0],
        "speed_mod": [-5],
        "pain_min": [1],
        "pain_chance": [150, 900],
        "hurt_min": [1],
        "hurt_chance": [450, 2700]
    },
    "scaling_mods": {
        "per_mod": [-1, -0.5],
        "dex_mod": [-1, -1],
        "str_mod": [-2, -1],
        "speed_mod": [-5],
        "pain_min": [0.5],
        "pain_chance": [-25, -200],
        "hurt_min": [1],
        "hurt_chance": [-25, -900]
    }
},
{
    "type": "effect_type",
    "id": "badpoisoned",
    "name": ["Badly Poisoned"],
    "apply_message": "You feel badly poisoned!",
    "desc": ["You have been badly poisoned!"],
    "miss_messages": [["You feel awful inside.", 4]],
  "int_add_val": 1,
  "max_intensity": 3,
  "int_decay_step": -1,
  "int_decay_tick": 9000,
  "decay_messages": [["You feel a little better.", "neutral"], ["You don't feel poisoned any longer", "good"]],
    "rating": "bad",
    "resist_traits": ["POISRESIST"],
    "pain_sizing": true,
    "hurt_sizing": true,
    "main_parts_only": true,
    "base_mods": {
        "per_mod": [-2],
        "dex_mod": [-1],
        "str_mod": [-2, -1],
        "speed_mod": [-10],
        "pain_min": [2],
        "pain_chance": [100, 500],
        "hurt_min": [1],
        "hurt_max": [2],
        "hurt_chance": [300, 1800]
    },
    "scaling_mods": {
        "per_mod": [-1],
        "dex_mod": [-1.5],
        "str_mod": [-1.5, -1],
        "speed_mod": [-5],
        "pain_min": [2],
        "pain_chance": [-20, -100],
        "hurt_min": [1],
        "hurt_max": [2],
        "hurt_chance": [-25, -500]
    }

}

^^

I have 2 poison replacements here. I mean to use this in conjunction with the venom tags in order to make a linger-term poison attack from monsters.

The issue Im having is getting it to affect the PC for more than 1 turn. It does apply. It does not stick for longer than 1 turn.

Im hoping somebody will know what I have done wrong here …
It should work by all my accounts.

Are you setting the duration to something higher than 1 at start?
Setting intensity to 3 but leaving duration default on application will not cause a 3*int_decay_tick duration, just the default duration of 1.
The only case you can skip setting duration is if you set max duration - then it will start at max duration by default.

would it be possible to have a sort of bandoleer for ammo that also have a holster function?
i haven’t attempted to do that yet but i am rather interested in that

if items have multiple use_actions a menu will promt you as to what action every time you use it

I have a question about terrain with vertical and horizontal elements, e.g. t_chainfence_v and t_chainfence_h. Does it matter if I use them both? In ASCII the AUTO_WALL_SYMBOL is used. In tiles they could be treated differently, but usually aren’t. I’ve also noticed there are legacy versions of t_wall with h and v. I get the feeling this is an old format that’s been deprecated but not updated.

Yup. You could use all vertical fencing and with auto-connect they would auto-configure themselves.

You could use them, conversely. But no reason to.

@pisskop: Thanks for the quick response. :slight_smile:

Is there a way to have a chance of furniture or items? I have some crate spots designated in my ASCII map. I want to randomly fill those spaces with closed crates, open crates, or smashed crates. Since crates are furniture and splintered wood and nails are items I can’t find a way to do it. Alternatively, is there a way to randomly smash the map from json?

This is the only way I know of in JSON.

        "furniture": {
            "X": ["f_crate_c", "f_crate_c", "f_crate_o", "f_floor"],      
        },
        "items": {
             "X": { "item": "trash", "chance": 60 }
        },

So 50% for a closed crate, 25% for open, and 25% for floor… but the trash items will spawn even in the crates.

“f_null” is what you want. “f_floor” doesnt exist. Its terrain, “t_floor”, and goes in terrain definitions.

What you do is:

terrain [
“X”: “[t_floor”, “t_dirt”, “t_dirt”]
],
furniture [
“X”: [f_null", “f_null”, “f_null”, “f_chair”]
]

^^ The above, properly coded, would make a terrain of [66% dirt] and [33% floor] and then have a 25% chance of placing a chair on that terrain regardless of what terrain is there.

Thanks acidia and pisskop. I didn’t know about f_null. With that I can have open, closed, or missing crates; and then spread debris items over an area. That’s probably more realistic than neat piles of debris only where the crates were supposed to be.

Alrighty just the kind of thread I needed.

So I was working on a mod focusing on small cars. Microcars and such. If I understand correctly gas prices were through the roof before the cataclysm, and I figured I’d make some small 1 person clowncars commuter cars to reflect the car industry adapting.

I had them functioning great. The gas one would get excellent gas milage while still being small enough to push and pull by hand just like real microcars! I had plans to add a couple more cars, and some lore fliers and such later.

Now I come back, download the newest experimental like usual and it seems there are some massive car overhauls. Now the microcar goes roughly 10 steps before running out of gas entirely (excellent coasting distance though) And from what I can gather on the github engines have changed drastically. The microcar’s engine has changed to a 2L gas engine, from an I4 increasing it’s speed but a 2L engine on a 10L tank ain’t getting far.

So I’ll change the engine to another one simple enough, but I can’t find any of these new engines. I still only see the old ones. Am I missing a file somewhere? Is the overhaul only partially implemented? Where would I get information on these new engines to use an appropriate one?

Also anything else I’ll need to know about the overhaul?

EDIT: Ok update! I found the new engines I think. Kinda confused why there are 2 different engine lists, but I’m sure there’s a reason. There’s a lot more info about gear ratios and such so I can only assume these are them. But when I try to replace the current engine with a v2_combustion the game throws an error saying that engine does not exist.

EDIT2: Think I figured that out. Also figured out that the fuel problem was due to another mod that I had originally built my own mod to build off of but had since removed the dependencies to. But my test world still had it loaded so fuel was draining at an insane rate.

I’d like to be able to build my own engines for the mod. Sadly I do not know real life mechanics. Can anyone give me an overview of what idle, optimim, redline, and gears are and how to parse the numbers on the new engines? I assume efficiency has something to do with how well it conserves fuel, and I 'm guessing idle optimum and redline are the power of the engine, but gears is complete Greek to me.

Engine operates at some RPM - higher when strained more.
Idle is the minimum RPM - if the engine is active, it won’t go below this.
Optimum is the RPM at which the efficiency is the best possible. The further you go from optimum, the worse the efficiency gets.
Redline is the RPM at which damage starts. Anything below it is safe.
Gears can allow different RPM to power ratios, which means more “chances” to get better efficiency and avoid redlining. Higher ratios allow more velocity, lower ones allow small engines to pull bigger vehicles without dying.

Efficiency is the multiplier on fuel energy. Efficiency 1.0 means all fuel energy is used, efficiency 0.1 means 90% of fuel is wasted and only 10% is turned into power. This is before the penalty from sub-optimal RPM.

I may be wrong about some of those.

Sweet awesome. So if I want a custom engine that is high efficiency but low velocity for a very small car. it sounds like I would want an engine with low rpms in and gears with high numbers since it does not have to haul any real weight.

Thank you for the info!

I would also be interested in modding engines, now that they have been exported in json.

Primarily steam engines, having difficulties with fuel types though.
I need to flesh out some kind of ‘boiler’ object, which accepts any type of flammable fuel & water.
I have the object ingame, but I am having a great deal of trouble defining the fuel/ammo type.
This boiler in turn, needs to create steam. Something that might not be able to do with json.

Managed to implement steam fueltype, but it does not behave like steam at all.

I sorta have boilers, that don’t work. And I have steam, that does not work either.

Defining the actual steam engines should be relatively simple, even just a clone of a typical gasoline engine with the fueltype set to steam.

The intention of this is to add some simple, low power steam engines that the player may craft, out of various scrap components.
See : https://www.youtube.com/watch?v=9VX-93HDrAE
Along with boilers, that the player may craft, and a very low tech, inefficient alternator.

I had planned to add steam engines a long time ago, but I couldn’t really wrap my head around the C++ side of things.

This is mainly to do with a total conversion mod I had in mind, but it could have some potential within the basegame.

idk if we can specify water as a fuel -yet.

Once a general provision for some simple things come into place, I think it would be quite easy to accomplish.
If there was a way to specify a type of part, that has inputs, outputs and some rate of conversion, you could virtually accomplish any type of mechanical system.
A few ideas:

[spoiler]Fuel Cell:
Water + Electricity = Hydrogen

Boiler:
Water + Burnable Material = Steam

Electric Boiler:
Water + Electricity = Steam

Condenser:
Steam + Time = Clean Water

Steam Engine (Various sizes, types of gearbox):
Steam = Rotational Energy

Improvised Generator/ Alternator:
Recipe would obviously require a great deal of copper,
some mechanical components.
Rotational Energy = Electricity

Improvised Battery:
Lead, plastic, Acid

[/spoiler]

could be something like power armor,but powered by gasoline be a thing?
i dont know how is the jsons of the power armor set up.
it is possible to add stat effects to clothing or armor?
i would love to make a makeshift power armor that burns you at random intervals and does not require you to be naked to use it.

You could copy the RM13 combat armor and change it to have gasoline ammo instead of plutonium.
Though it doesn’t count as power armor.

All power armor is hardcoded to require being naked.