From 6446fed2b2a380017ae6bc87ea6deed234a1f006 Mon Sep 17 00:00:00 2001 From: huesatlight Date: Thu, 11 Jun 2026 13:12:53 -0500 Subject: [PATCH 1/7] Update add-recipe.lua fix the following bugs: can now add items with the same subtype number as picks. now adds digging weapons to resources.digger_type instead of weapon_type, eg: great pick when checking for procedurally generated items to exclude, use the flag instead of the adjective, which was incorrectly excluding things like "short skirt" and "large dagger". side effects: no longer adds instruments and instrument parts, but the behavior the documentation says. incidentally, the original comments said procedurally generated weapons (divine) were excluded because they weren't craftable. But they could be crafted, if they were added. This can still be done using the "single" option. --- add-recipe.lua | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/add-recipe.lua b/add-recipe.lua index 222dc5511f..28f01fbdb9 100644 --- a/add-recipe.lua +++ b/add-recipe.lua @@ -63,7 +63,7 @@ function addItems(category, exotic) --category: the category of items we're adding --exotic: whether to add exotic items --returns: list of item objects that were added - local known = category[1] + local known_category = category[1] local native = category[2] local all = category[3] local added = {} --as:df.itemdef[] @@ -72,16 +72,20 @@ function addItems(category, exotic) local item = item --as:df.itemdef_weaponst local subtype = item.subtype local itemOk = false - + local known = known_category + -- digging implements are seperate from weapons in entity resources. + if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then + known = diggers + end + --check if it's a training weapon local t1, t2 = pcall(function () return item.flags.TRAINING == false end) local training = not(not t1 or t2) - --we don't want procedural items with adjectives such as "wavy spears" - --(because they don't seem to be craftable even if added) + --excludes procedural items, eg: "wavy spears" for divine origins --nor do we want known items or training items (because adding training --items seems to allow them to be made out of metals) - if (item.adjective == "" and not training and not checkKnown(known, subtype)) then + if (not item.base_flags.GENERATED and not training and not checkKnown(known, subtype)) then itemOk = true end @@ -89,11 +93,13 @@ function addItems(category, exotic) itemOk = false end - --check that the weapon we're adding is not already known to the civ as - --a digging implement so picks don't get duplicated - if (checkKnown(diggers, subtype)) then - itemOk = false - end + --if the weapon we're adding is a digging implement, add to diggers instead of weapons + --prevents picks from being duplicated, and puts great picks in correct category + if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then + if (checkKnown(diggers, subtype)) then + itemOk = false + end + end if (itemOk) then known:insert('#', subtype) From 71731bf3da21ef380f4a4608a70f8db9e04c6e29 Mon Sep 17 00:00:00 2001 From: huesatlight Date: Thu, 11 Jun 2026 13:24:53 -0500 Subject: [PATCH 2/7] Update changelog.txt --- changelog.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/changelog.txt b/changelog.txt index 33844aaaaf..3a3ea09d08 100644 --- a/changelog.txt +++ b/changelog.txt @@ -36,6 +36,19 @@ Template for new versions: ## Removed +# 53.14-alpha3 + +## New Tools + +## New Features + +## Fixes +- ``script\add-recipe``: fix to include incorrectly excluded recipes + +## Misc Improvements + +## Removed + # 53.14-r2 ## New Tools From 1bdc9c6f09d9e174ed74f907662ce21ae3ae5539 Mon Sep 17 00:00:00 2001 From: huesatlight Date: Thu, 11 Jun 2026 16:25:21 -0500 Subject: [PATCH 3/7] Update changelog.txt --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 3a3ea09d08..d3a769f28f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -43,7 +43,7 @@ Template for new versions: ## New Features ## Fixes -- ``script\add-recipe``: fix to include incorrectly excluded recipes +- `script\add-recipe`: fix to include incorrectly excluded recipes ## Misc Improvements From f264fa4138a881562772c5d568a03549e593c42f Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 11 Jun 2026 20:28:42 -0500 Subject: [PATCH 4/7] Update changelog.txt correct syntax --- changelog.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index d3a769f28f..623ebce64d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -43,7 +43,7 @@ Template for new versions: ## New Features ## Fixes -- `script\add-recipe`: fix to include incorrectly excluded recipes +- `add-recipe`: fix to include incorrectly excluded recipes ## Misc Improvements From 308e0beef857660aa5111d7e2f74f84507d6d64a Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 11 Jun 2026 20:31:18 -0500 Subject: [PATCH 5/7] correct whitespace --- add-recipe.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add-recipe.lua b/add-recipe.lua index 28f01fbdb9..2cc22ba3ac 100644 --- a/add-recipe.lua +++ b/add-recipe.lua @@ -74,10 +74,10 @@ function addItems(category, exotic) local itemOk = false local known = known_category -- digging implements are seperate from weapons in entity resources. - if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then + if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then known = diggers end - + --check if it's a training weapon local t1, t2 = pcall(function () return item.flags.TRAINING == false end) local training = not(not t1 or t2) From 4db594ebfa465a6e09a358199bb597a5b8b5bdcb Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 11 Jun 2026 21:25:16 -0500 Subject: [PATCH 6/7] fix other whitespace --- add-recipe.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/add-recipe.lua b/add-recipe.lua index 2cc22ba3ac..495993504e 100644 --- a/add-recipe.lua +++ b/add-recipe.lua @@ -73,7 +73,7 @@ function addItems(category, exotic) local subtype = item.subtype local itemOk = false local known = known_category - -- digging implements are seperate from weapons in entity resources. + -- digging implements are seperate from weapons in entity resources. if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then known = diggers end From 3b63417b908c219ff5323c9998444cf626621f77 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Thu, 11 Jun 2026 21:27:51 -0500 Subject: [PATCH 7/7] fix more whitespace --- add-recipe.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/add-recipe.lua b/add-recipe.lua index 495993504e..fe7fd63576 100644 --- a/add-recipe.lua +++ b/add-recipe.lua @@ -95,11 +95,11 @@ function addItems(category, exotic) --if the weapon we're adding is a digging implement, add to diggers instead of weapons --prevents picks from being duplicated, and puts great picks in correct category - if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then + if (df.itemdef_weaponst:is_instance(item) and item.skill_melee == df.job_skill.MINING) then if (checkKnown(diggers, subtype)) then itemOk = false end - end + end if (itemOk) then known:insert('#', subtype)