Closed John-Candlebury closed 5 years ago
This is a very strange bug. I changed the contents of NC_ROBOFAC_ITERCOM_trade
item group to contain some other item group, say, default_zombie_clothes
,
{
"type": "item_group",
"id": "NC_ROBOFAC_INTERCOM_trade",
"entries": [ { "group": "default_zombie_clothes", "repeat": [ 15, 25 ] } ]
}
and yet while debug-testing NC_ROBOFAC_INTERCOM_trade
item group I still got contents of robofac_basic_trade
item group like I didn't change anything.
The NC_ROBOFAC_INTERCOM_trade
group is defined twice, here and here and the robofac_basic_trade
and NC_ROBOFAC_INTERCOM_trade
groups don't have the subtypes set.
Subtype is optional, per the docs, but if you do so, it uses the "old" format. I'd suggest explicitly specifying it.
subtype
is optional. It can becollection
ordistribution
. If unspecified, it defaults toold
, which denotes that this item group uses the old format (which is technically a distribution).
I did something like this and it works (adjust accordingly per your intent):
diff --git a/data/json/npcs/robofac/NC_ROBOFAC_INTERCOM.json b/data/json/npcs/robofac/NC_ROBOFAC_INTERCOM.json
index ec86cc2ae4..14cb84bb88 100644
--- a/data/json/npcs/robofac/NC_ROBOFAC_INTERCOM.json
+++ b/data/json/npcs/robofac/NC_ROBOFAC_INTERCOM.json
@@ -2,6 +2,7 @@
{
"type": "item_group",
"id": "NC_ROBOFAC_INTERCOM_trade",
+ "subtype": "collection",
"entries": [ { "group": "robofac_basic_trade", "repeat": [ 15, 25 ] } ]
},
{
@@ -13,6 +14,7 @@
{
"type": "item_group",
"id": "robofac_basic_trade",
+ "subtype": "distribution",
"entries": [
{ "group": "bionics_common", "prob": 100 },
{ "group": "textbooks", "prob": 100 },
diff --git a/data/json/npcs/robofac/classes.json b/data/json/npcs/robofac/classes.json
index 3cbc3a2f3a..8e6e863ac0 100644
--- a/data/json/npcs/robofac/classes.json
+++ b/data/json/npcs/robofac/classes.json
@@ -1,18 +1,4 @@
[
- {
- "type": "item_group",
- "id": "NC_ROBOFAC_INTERCOM_trade",
- "subtype": "distribution",
- "entries": [
- { "group": "bionics_common", "prob": 100 },
- { "group": "textbooks", "prob": 100 },
- { "group": "electronics", "prob": 100 },
- { "group": "science", "prob": 100 },
- { "group": "robofac_basic_robots", "prob": 100 },
- { "group": "cop_armory", "prob": 100 },
- { "group": "ammo_any_batteries_full", "prob": 100 }
- ]
- },
{
"type": "item_group",
"id": "NC_ROBOFAC_INTERCOM_worn",
Thanks for the solution @ralreegorganon!
NC_ROBOFAC_FREE_MERCHANT_misc
suffered from this very same silent failing bug. But the solution above did not actually help.
There might be something else worth investigating?
You can't use arrays in an entries
list like you're doing here. Everything from trenchcoat on down needs to be converted to an object instead.
{
"type": "item_group",
"sub-type": "collection",
"id": "NC_ROBOFAC_FREE_MERCHANT_misc",
"entries": [
{ "item": "FMCNote", "count-min": 50, "count-max": 300, "prob": 100 },
{ "group": "produce", "count-min": 10, "count-max": 20, "prob": 100 },
{ "group": "bunker_basement_food", "count-min": 5, "count-max": 10, "prob": 100 },
{ "item": "jerky", "count-min": 10, "count-max": 25, "prob": 100 },
{ "item": "FMCNote", "count-min": 50, "count-max": 300, "prob": 100 },
[ "trenchcoat", 25 ],
[ "trenchcoat_leather", 20 ],
[ "trenchcoat_fur", 10 ],
[ "jacket_leather", 25 ],
[ "jacket_jean", 15 ],
[ "jacket_flannel", 15 ],
[ "pants_cargo", 40 ],
[ "shorts_cargo", 25 ],
[ "pants_leather", 15 ],
[ "gloves_fingerless", 30 ],
[ "gloves_fur", 5 ],
[ "gloves_leather", 35 ],
[ "boots", 20 ],
[ "boots_hiking", 30 ],
[ "hood_rain", 15 ],
[ "runner_bag", 20 ],
[ "sunglasses", 15 ],
[ "goggles_ski", 5 ],
[ "wristwatch", 30 ],
[ "bandana", 20 ],
[ "scarf", 15 ],
[ "fungicide", 20 ],
[ "antifungal", 20 ],
[ "antiparasitic", 20 ],
[ "grapnel", 5 ]
]
},
Could be closed?
Describe the bug
A given item group cannot spawn directly, but if it is added as an entry of secondary item group, the items from the first list can spawn.
Steps To Reproduce
robofac_basic_trade
item group and try to test it. Notice how nothing happensNC_ROBOFAC_INTERCOM_trade
item group and test it. Notice that it does work, even thoughNC_ROBOFAC_ITERCOM_trade
is just an indirect call forrobofac_basic_trade
.Expected behavior
robofac_basic_trade
works as an independent item group.