Spliffs for immersion/realism

SO… Im trying to learn javascript, I want to get into modding the game and contributing further- I guarantee I made a few mistakes here and it most likely isn’t functional yet but this should be 90% of the code to add spliffs (weed and tobacco cigs) to the game. feedback, testing or criticism would be great.

{
  "type": "recipe",
  "activity_level": "NO_EXERCISE",
  "result": "spliff",
  "category": "CC_CHEM",
  "subcategory": "CSC_CHEM_DRUGS",
  "skill_used": "fabrication",
  "time": "2 m",
  "autolearn": true,
  "reversible": true,
  "flags": [
    "BLIND_HARD"
  ],
  "components": [
    [
      [
        "rolling_paper",
        2
      ]
    ],
    [
      [
        "weed",
        1
"rolling_tobacco",
1
      ],
      [
        "joint_roach",
        3
"cig_butt",
3
OR 
"spliff roach". 3
      ]
    ]
  ]
}

{
  "id": "spliff",
  "type": "COMESTIBLE",
  "comestible_type": "MED",
  "name": {
    "str": "spliff"
  },
  "description": "half-and-half rolling tobacco and some good ol' jazz cabbage.",
  "weight": "1 g",
  "volume": "4 ml",
  "price": "200 cent",
  "price_postapoc": "100 cent",
  "symbol": "!",
  "color": "dark_gray",
  "container": "box_cigarette",
  "stim": 2,
  "healthy": -1,
  "fun": 20,
  "addiction_potential": 25,
  "addiction_type": "nicotine",
  "flags": [
    "NO_INGEST",
    "IRREPLACEABLE_CONSUMABLE",
    "EDIBLE_FROZEN"
  ],
  "use_action": [
    "SMOKING"
  ]
}

{
  "type": "GENERIC",
  "id": "spliff_lit",
  "name": {
    "str": "spliff"
  },
  "color": "light_green",
  "symbol": "!",
  "description": "A lit spliff, musky tobacco notes only slightly masking that of the dank, verdant grass",
  "weight": "2 g",
  "volume": "4 ml",
  "category": "drugs",
  "emits": [
    "emit_joint_trail",
"emit_tobacco_trail"
  ],
  "use_action": [
    {
      "type": "firestarter",
      "moves": 200,
      "moves_slow": 2000
    },
    {
      "target": "spliff_roach",
      "msg": "You extinguish the spliff.",
      "active": false,
      "menu_text": "Extinguish",
      "type": "transform"
    }
  ],
  "material": [
    "paper"
  ],
  "armor_data": {
    "warmth": 3,
    "armor": [
      {
        "material": [
          {
            "type": "paper",
            "covered_by_mat": 100,
            "thickness": 0.1
          }
        ],
        "encumbrance": 15,
        "coverage": 25,
        "covers": [
          "mouth"
        ]
      }
    ]
  },
  "flags": [
    "LITCIG",
    "LIGHT_2",
    "TRADER_AVOID",
    "FIRESTARTER",
    "FRAGILE",
    "OVERSIZE"
  ]
}

{
  "type": "GENERIC",
  "id": "spliff_roach",
  "name": {
    "str": "spliff roach",
    "str_pl": "spliff roaches"
  },
  "color": "brown",
  "symbol": "!",
  "description":Its not a joint, it's not a cigarette... it's just kinda nasty and barely useful.",
  "category": "other",
  "weight": "1 g",
  "volume": "1 ml",
  "flags": [
    "TRADER_AVOID"
  ]
}

looks good for me
FYI this is not javascript, this is json, which is pretty different thing

1 Like

Well its javascript based or something like that. We all learn something new everyday lol! thanks though. I’ll probably try and test it when I have time just not sure exactly how and im pretty certain there’s gotta be a syntax error there somewhere I did just kinda come at this with a bunch of caffeine and NO experience tbqh

java and javascript are some of a bunch of primitive scripting languages that all have based a lot of syntax and logic on C. JSON is not a programming language at all, but rather a data representation language for storage of information, but without any processing ability at all. Again, the extensive usage of various forms of brackets is probably inspired by C.

That said, most programming languages (both scripted and compiled) use a similar underlying logic, although the syntax and names of operations can differ substantially. Trying to learn from jumping between them is likely to be confusing, though.

1 Like