Author Topic: The Minor JSON Questions Thread  (Read 5531 times)

Offline pisskop

  • Survivor
  • ***
  • Posts: 3585
  • Excitebike
    • View Profile
The Minor JSON Questions Thread
« on: November 03, 2016, 01:29:38 AM »
Because having a new thread for every small question is unreasonable.

I hope this sticks.





Offline pisskop

  • Survivor
  • ***
  • Posts: 3585
  • Excitebike
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #1 on: November 03, 2016, 01:31:13 AM »
(click to show/hide)

^^

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.
« Last Edit: November 03, 2016, 01:46:42 AM by pisskop »

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3793
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #2 on: November 03, 2016, 06:33:29 AM »
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.

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.

Offline xironfistx

  • Zombie Food
  • *
  • Posts: 77
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #3 on: November 18, 2016, 04:35:17 PM »
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

Offline pisskop

  • Survivor
  • ***
  • Posts: 3585
  • Excitebike
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #4 on: November 18, 2016, 05:07:45 PM »
if items have multiple use_actions a menu will promt you as to what action every time you use it

Offline egomassive

  • NPC
  • **
  • Posts: 105
    • View Profile
    • egomassive.com
Re: The Minor JSON Questions Thread
« Reply #5 on: November 18, 2016, 08:20:14 PM »
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.

Offline pisskop

  • Survivor
  • ***
  • Posts: 3585
  • Excitebike
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #6 on: November 18, 2016, 08:34:06 PM »
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.

Offline egomassive

  • NPC
  • **
  • Posts: 105
    • View Profile
    • egomassive.com
Re: The Minor JSON Questions Thread
« Reply #7 on: November 18, 2016, 09:56:46 PM »
@pisskop: Thanks for the quick response. :)

Offline egomassive

  • NPC
  • **
  • Posts: 105
    • View Profile
    • egomassive.com
Re: The Minor JSON Questions Thread
« Reply #8 on: November 21, 2016, 01:54:17 AM »
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?

Offline acidia

  • NPC
  • **
  • Posts: 155
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #9 on: November 21, 2016, 02:03:53 AM »
This is the only way I know of in JSON.
Code: [Select]
        "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.


Offline pisskop

  • Survivor
  • ***
  • Posts: 3585
  • Excitebike
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #10 on: November 21, 2016, 08:46:59 PM »
"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.

Offline egomassive

  • NPC
  • **
  • Posts: 105
    • View Profile
    • egomassive.com
Re: The Minor JSON Questions Thread
« Reply #11 on: November 22, 2016, 08:28:01 AM »
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.

Offline Greiger

  • NPC
  • **
  • Posts: 167
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #12 on: November 23, 2016, 02:04:34 AM »
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.
« Last Edit: November 23, 2016, 07:33:13 PM by Greiger »
I have a mod!  It has new vehicles! Like 3 wheeled microcars, dune buggies, trailer parks, and tanker trucks!
http://smf.cataclysmdda.com/index.php?topic=13738.0
It may be, just slightly outdated :P

Offline Coolthulhu

  • Contributor
  • Survivor
  • ****
  • Posts: 3793
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #13 on: November 26, 2016, 07:07:23 AM »
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.

Offline Greiger

  • NPC
  • **
  • Posts: 167
    • View Profile
Re: The Minor JSON Questions Thread
« Reply #14 on: November 26, 2016, 04:18:02 PM »
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 have a mod!  It has new vehicles! Like 3 wheeled microcars, dune buggies, trailer parks, and tanker trucks!
http://smf.cataclysmdda.com/index.php?topic=13738.0
It may be, just slightly outdated :P