The Minor JSON Questions Thread

Is there a document somewhere describing the properties of terrains?

In particular I want to know about the line:
[glow=red,2,300]“roof”: “t_flat_roof”,[/glow]
Seems to me all indoor terrain should have this as well as windows and doors. It’s very hit-or-miss, t_floor gets a roof when looking down on it from above but t_carpet_red doesn’t. Is this a matter of no one’s taken the time to fully implement it, or it a matter of being an experimental feature that may be dropped?

In a related matter, it rains where I’ve placed [glow=red,2,300]t_open_air_rooved[/glow]! I guessed this piece was for interior spaces, but it’s not flagged [glow=red,2,300]INDOORS[/glow]. Have I misunderstood its purpose or is it broken?

Roofs aren’t fully implemented, but they probably won’t be dropped.
Some weird terrains, like carpet, are sometimes badly specified. They should be copies of floor with some extra modifications, but instead are copied manually, meaning that they may have been missed when updating other terrain.

Rain and roofs are currently independent. Roofs creates terrain above current terrain, but rain depends on outdoor/indoor specification, which doesn’t depend on terrain above yet.
Some of that is half-implemented because we can’t really commit to fully 3D environment until 3D vision is in. Meaning we need to support 2D hacks and maintain compatibility with them.

Had a much longer post typed out but the board timed me out, so just the major questions.

First a little question, where are the json files for rams?

I am trying to make an underground bore attachment.

[
{
“id”: “bore”,
“type”: “vehicle_part”,
“name”: “borehead”,
“item”: “bore”,
“location”: “structure”,
“symbol”: “O”,
“broken_symbol”: “#”,
“color”: “brown”,
“broken_color”: “brown”,
“epower” : -18,
“difficulty”: 1,
“durability”: 10000,
“damage_modifier”: 10000000000,
“damage”: 10000000,
“bashing”: 1000000,
“bonus”:70000,
“size”:350,
“breaks_into”: [ { “item”: “gray” } ],
“flags”: [ “TOOL_NONE”, “PROTRUSION”, “STABLE”, “NO_JACK”, “SCOOP”, “CARGO”, “ARMOR”, “JACKHAMMER” ],
“damage_reduction” : {
“all” : 15,
“cut” : 30,
“stab” : 50
}
}
]

(Didn’t include recipe or item data, just vehicle_part.)

Loads fine, recipe works fine, attaches fine. The issue is that no matter what I do, I need to reach a speed of 96 km/h to destroy a tree with the bore. Tried upping “damage_modifier” like I saw on the reaper or ram, didn’t help. Added “damage” and “bashing” from an ammo item hoping it would help, but it did not. The reaper and advanced reaper both have a “bonus” field of 7, so I added that with a large number, but no luck. [JACKHAMMER] was a desperate attempt, I was actually surprised at how accepting the game was of me tossing in random snippets.

I guess I really want to know how collision damage is calculated in relation to some of these values. The goal is to get it to eat through rock at very slow speeds. (I’ll raise the mass and energy consumption to incredible levels to balance it out.) Are trees a poor test subject?

Thanks for any help!

rams?

Id look at metal and wooden spikes. and maybe spiked armor plating.

“ramming” has less to do with any one part but how heavy your car is. afaic. make it armored and do damage.

I meant the actual vehicle part, for instance “steel ram” or “spiked ram” or “superalloy ram” or “superalloy ram?” They have to be installed in a frame-adjacent square on the vehicle?

I will try out messing with the vehicle weight though, thanks.

Edit: “military composite ram” was supposed to be the third one.

Oh I think rams are part of the vehicle additions mod. So I think you’d look in the data>mods>blazemod folder.

Weird, always thought they were part of the core game. Nothing enlightening in the ram files though unfortunately.

I did try increasing the mass of the bore (and vehicle) by 9000 kg; moderate success, was able to “bore” through a tree at only 64 km/h.

I think the recent changes to engine/motor and the planned gears are going to be an issue however, may have to make special rail “tires” and a massive bore engine for now.

Do structures like trees and rock walls have damage or health associated with them? Seems like no. Even with this test, a continual tile-adjacent ramming doesn’t seem to destroy a tree.

Any specific info on how “diameter” and “width” affect wheels in game?

Most structures like trees and walls just have a chance of being destroyed based on the power of the strike made against them. A heavier fast vehicle will have a higher chance of breaking something down than a lighter one, because mass and momentum are taken into account. Some parts also have a multiplier to their damage, like spiked plating, but I don’t know if that translates into terrain damage calculations or if it’s just monster damage. When bashing things on foot I understand the ‘you don’t seem to be damaging the x’ message just comes up when you have a 0% chance to break something.

Diameter and width from what I understand affects your offroading capabilities. Larger wheels are less liable to sink into the ground, giving you better traction offroad, reducing your power loss when driving through grass and dirt. The size of your wheels is compared to the weight of your vehicle to give you it’s offroading capability. Larger wheels supposedly also reduce your maximum speed slightly, but I’ve seen little difference with that bit myself.

Thanks for the replies.

I ended up just making an absurdly massive vehicle, engine power, and power stored per battery (the numbers became silly), and still wasn’t able to reach a viable speed from rest to push/destroy through a tree obstacle.

The damage modifier definitely does not affect damage against landscape structures, as far as I’ve seen.

Would be nice to somehow change the “REAPER” flag so that it works against rock walls instead and applied the damage modifier to it or something.

Could be some kind of livestock be juryrigged using jsons?
Like for example you feed it wheat or rice or some grain so it follows you around and then it lays bird eggs or something along those lines.
Or some kind of alien animal that is able to be tamed like a dog and then is like an ant queen and you then butcher the animals.
Is such possible using jsons alone or some of what it would need to work is hardcoded?

I would think so, a quick check into the dog json files shows “placate_triggers”: [ “MEAT” ], so you could probably play with that, adding it to other monsters and using different foods.

As for having them lay harvestables like eggs, could be more tricky, don’t see anything immediately useful to pillage in the ant queen files other than the flag “QUEEN,” which I kinda think is what causes them to lay ant eggs? I see this tag in other monsters that also create offspring, but nothing that specifies what specific item/creature is spawned. Will poke around a bit more. Could possibly try having a silent mutation that causes them to leave a “slime trail” but instead of slime, egg items, at lower frequency.

But if you just want a tameable ant queen-esque monster, that seems totally possible.

Edit: spoke too soon, forgot about how dog food is the tool used to make dogs friendly towards you, may not be as simple as I thought.
Edit: Though spawning a friendly queen ant with the debug menu seems to cause all subsequent eggs and ants to also be friendly to you, which is fun.
Edit: Ah, the wiki was pretty helpful on this. http://www.wiki.cataclysmdda.com/index.php?title=Creature_AI

Its all hardcoded. Make an item that changes the faciton of the target to ‘player’ in the c++ hardcode and then make an item that uses that action

Alright. Here’s one for you that deals with mutations. I am looking to create my own mutation branch with several abilities which are essentially renamed versions of abilities that already exist. My concern is that in changing the mutation ID, I lose the actual mutation power since those are hard coded.

For example… I wish to take this…

    "type" : "mutation",
    "id" : "WINGS_BIRD",
    "name" : "Bird Wings",
    "points" : 2,
    "visibility" : 4,
    "ugliness" : 2,
    "description" : "You have a pair of large, feathered wings.  Your body is too heavy to be able to fly, but you can use them to slow your descent during a fall, and will not take falling damage under any circumstances.",
    "prereqs" : ["WINGS_STUB"],
    "cancels" : ["WINGS_BAT", "WINGS_INSECT", "WINGS_BUTTERFLY"],
    "category" : ["MUTCAT_BIRD"]

and turn it into this

    "type" : "mutation",
    "id" : "WINGS_DRAGON",
    "name" : "Drakota Wings",
    "points" : 2,
    "visibility" : 4,
    "ugliness" : 2,
    "description" : "You have a pair of large, articulate, demi-chiropteran wings.  Your body is too heavy to be able to fly, but you can use them to slow your descent during a fall, and will not take falling damage under any circumstances.",
    "prereqs" : ["WINGS_STUB"],
    "cancels" : ["WINGS_BAT", "WINGS_INSECT", "WINGS_BUTTERFLY", "WINGS_BIRD"],
    "category" : ["MUTCAT_DRAGON"]

My question is this: How do I make the new wings have the same ability as the bird wings? The JSON… “language”… here clearly doesn’t contain the code for the removal of fall damage.

You need to locate the places where wing id is referenced and add the new wing. Then recompile the game.
Easiest done by just a brute force search for the wing id in the src directory. For example, grep "WINGS_BIRD" -r src.

Can’t be done with json alone.

Crap. That’s what I was afraid of. The lua/hardcoded stuff are the limit of my personal skill, but I do have a friend who went to college to learn coding and who is helping me with this project, which I hope to expand greatly in scope.

Alright. That will help a great deal at the end of the day. Thanks for the info.

in which item json is that rivtech powered suit?
i cant find it and i want to make some crude powered suits quite similar to the ever charming huge scrap mounts orks wear in 40k

tool_armor.json. Some of its features are hardcoded in places.

At this moment im away from my place,but could i simply copy it json,change some stuff for balance and make it powered by gasoline?

i think it might have to be powered by a ups or bionic.

im not 100℅ sure though.

you could make a gasoline powered suit of armor, but it wouldnt req a helmet to use.
such a machine would be monstrously heavy and inefficient.
such a machine would have the glaring flaw of having combustible fluids as it external power source

but yes, you dont strictly have to balance for realism or ease of power acquisition, in theory you could make an airtight body glove of armor powered by gasoline kept in hammerspace

Not that I don’t find the idea immesely amusing but I would never want to wear a gasoline powered suit of armor.

A ) : Is it supposed to be so loud? And vibrating so much?
B ) : Yea that’s normal. You’ll get used to it once the swelling stops your brain from bouncing around in your cranium. The V6’s weren’t as bad, but the added power from the V12 definitely makes up for some minor brain trauma.