Testers and feedback needed: Recipe Lists mod


#1

So I made this little mod which makes unlocking recipes much more convenient:
reclist.smod (14.2 KB)

Features:

  • multi-job recipe lists can be defined in a JSON file (alias: reclist:recipe_lists, path: reclist/data/recipe_lists.json);
  • recipes and corresponding bulettins in town bonus Lua scripts are ignored, recipe list with same uri as the town bonus is unlocked automatically without a bulettin (town upgrade UI shows the info about new recipes anyway, no need for separate bulletins);
  • new campaign encounter which can unlock a recipe list with given uri, specify whether to take the list with reembark team and optionally launch bulettins;
  • recipes unlocked the old way are not taken with the reembark team, the whole lists are taken instead what makes it possible to modify them via mods and not have to complete the quest again to unlock mod-added recipes (doesn’t work on existing saves, would require mad rewriting of the job controller),
  • currently used by tier 3 town bonuses and Ambertsone quest line in heirbloom and Mason/Weaver recipe sharing encounters (this means recipes unlocked other ways are not taken with the reembark team, this is intentional!);
  • "recipes" section of the reembarkation file is populated with recipe keys from unlocked lists for backward compatibility.

Recipe list format:

{
	"stonehearth:amberstone:geomancy": {
		"stonehearth:jobs:blacksmith": {
			"tools:golem_pick": true,
		},
		"stonehearth:jobs:mason": {
			"refined:golem_parts": true,
		},
		"stonehearth:jobs:potter": {
			"refined:golem_parts": true,
		},
		"stonehearth:jobs:weaver": {
			"crafting_materials:golem_backpack": true,
		}
	}
}

Why true key instead of a simple list? Because lists don’t support removing entries with mixintypes, this way it is possible to disable a recipe in a list by either setting it’s value to false or using "mixintypes": {"recipe_key": "remove"}.

For all the cheaters wanting to unlock all Tier 3 recipes via Lua console from the debug tools (worked this out thanks to @Nandalee) on existing saves:

stonehearth.town:get_town('player_1')._sv.recipe_lists = {}
stonehearth.town:get_town('player_1').__saved_variables:mark_changed()
stonehearth.town:get_town('player_1'):unlock_recipe_list('stonehearth:town_bonus:deity', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('stonehearth:town_bonus:guildmaster', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('stonehearth:town_bonus:valor', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('rayyas_children:town_bonus:deity', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('rayyas_children:town_bonus:guildmaster', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('rayyas_children:town_bonus:valor', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('northern_alliance:town_bonus:deity', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('northern_alliance:town_bonus:guildmaster', true)
stonehearth.town:get_town('player_1'):unlock_recipe_list('northern_alliance:town_bonus:valor', true)

This was surprisingly easy to code so I need others to test it; I could also use some feedback. Another thing is I need such functionality for the next release of LostEms but this seems like a universal mod so I am not sure what distribution model to use (a core mod like Dani’s?).


#2

Hiya, @Pawel_Malecki! On load:

Error
std::logic_error: 'Error in CompileScript loading "reclist/monkey_patches/reclist_reembarkation_encounter.lua": reclist/monkey_patches/reclist_reembarkation_encounter.lua:82: 'do' expected near 'local''
stack traceback:
	[C]: ?
	[C]: in function 'require'
	radiant/lib/env.lua:60: in function 'require'
	reclist/reclist_server.lua:14: in function 'monkey_patching'
	reclist/reclist_server.lua:25: in function <reclist/reclist_server.lua:24>
	[C]: ?
	[C]: in function 'trigger'
	radiant/modules/events.lua:55: in function <radiant/modules/events.lua:55> 

#3

Fixed version in the first post.

EDIT: The new version supports backward compatibility (recipes from recipe lists are added to "recipes" section of the reembark file).


Is there a console comand to unlock Re-Embarkation recipes?