[quote=“Soron, post:50, topic:837”]Correct, if you’re just adding a crafted gun that uses existing ammo and such, you only need to edit ranged.json and recipe.json, neither of which require a recompile. And they should be giving passable error messages now, too :).
Ammo still needs to be defined in itypedef.cpp, although that will hopefully be changed soon.
If you want them to occur “naturally” (i.e., without crafting), you’ll need to edit stuff like mapitemsdef.cpp as well.[/quote]
Well then, mind checking my changes then? The .exe refuses to run with these changes:
item and surrounding code:
[spoiler] “type”: “GUN”,
“symbol”: “(”,
“color”: “magenta”,
“name”: “NX-17 charge rifle”,
“description”: “A multi-purpose rifle, designed for use in conjunction with a unified powersupply, or UPS. It does not reload normally; instead, press fire once tostart charging it from your UPS, then again to unload the charge.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“flags”: [“CHARGE”, “NO_UNLOAD”],
“skill”: “rifle”,
“ammo”: “none”,
“weight”: 16,
“volume”: 13,
“damage”: 8,
“cutting”: 0,
“to_hit”: -1,
“ranged_damage”: 0,
“range”: 0,
“accuracy”: 6,
“recoil”: 0,
“durability”: 8,
“burst”: 0,
“clip_size”: 10,
“reload”: 0
},
{
“id”: “v30”,
“type”: “GUN”,
“symbol”: “(”,
“color”: “magenta”,
“name”: "V30 laser rifle ",
“description”: “The work of a master electrician. By disabling the safeties and extending thecharging array, this rifle features improved lethality and accuracy overits predecessor, at the expense of clip size.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“skill”: “rifle”,
“ammo”: “fusion”,
“weight”: 18,
“volume”: 16,
“damage”: 7,
“cutting”: 0,
“to_hit”: 1,
“ranged_damage”: 5,
“range”: 0,
“accuracy”: 25,
“recoil”: 0,
“durability”: 8,
“burst”: 0,
“clip_size”: 10,
“reload”: 300
},
{
“id”: “flamethrower_simple”,
“type”: “GUN”,
“symbol”: “(”,
“color”: “pink”,
“name”: “simple flamethr.”,
“description”: “A simple, home-made flamethrower. While its capacity is not superb, it ismore than capable of igniting terrain and monsters alike.”,
“rarity”: 1,
“material”: [“STEEL”, “PLASTIC”],
“flags”: “FIRE_100”,
“skill”: “shotgun”,
“ammo”: “gasoline”,
“weight”: 8,
“volume”: 16,
“damage”: 8,
“cutting”: 0,
“to_hit”: -1,
“ranged_damage”: -5,
“range”: 0,
“accuracy”: 6,
“recoil”: 0,
“durability”: 6,
“burst”: 0,
“clip_size”: 800,
“reload”: 800
},
[/spoiler]
recipe and surrounding code:
[spoiler] {
“result”: “coilgun”,
“category”: “CC_WEAPON”,
“skill_pri”: “electronics”,
“difficulty”: 3,
“time”: 25000,
“reversible”: true,
“autolearn”: true,
“tools”: [
[
[“screwdriver”, -1],
[“toolset”, -1]
],
[
[“soldering_iron”, 10],
[“toolset”, 1]
]
],
“components”: [
[
[“pipe”, 1]
],
[
[“power_supply”, 1]
],
[
[“amplifier”, 1]
],
[
[“scrap”, 6]
],
[
[“cable”, 20]
]
]
},
{
"result": "v30",
"category": "CC_WEAPON",
"skill_pri": "electronics",
"skill_sec": "mechanics",
"difficulty": 10,
"time": 40000,
"reversible": true,
"autolearn": true,
"tools": [
[
["screwdriver", -1],
["toolset", -1]
],
[
["wrench", -1],
["toolset", -1]
],
[
["soldering_iron", 6],
["toolset", 2]
]
],
"components": [
[
["scrap”,3]
],
[
["v29”,1]
],
[
["cable", 10]
],
[
["amplifier", 2]
],
[
["power_supply", 3]
]
]
},
{
"result": "noise_emitter",
"id_suffix": "radio-mod",
"category": "CC_ELECTRONIC",
"skill_pri": "electronics",
"difficulty": 1,
"time": 15000,
"reversible": false,
"autolearn": true,
"tools": [
[
["screwdriver", -1],
["toolset", -1]
],
[
["soldering_iron", 5],
["toolset", 1]
]
],
"components": [
[
["radio", 1]
],
[
["amplifier", 2]
]
]
},
[/spoiler]