Right now you have to create a fake technology with allowed recipes as unlocks to access them ingame, which is quite ugly
add LuaItemPrototype.limitation
add LuaItemPrototype.limitation
Make the allowed recipes for modules with productivity effect accessible from control.lua via LuaItemPrototype (like LuaItemPrototype.module_effects)
Right now you have to create a fake technology with allowed recipes as unlocks to access them ingame, which is quite ugly
Right now you have to create a fake technology with allowed recipes as unlocks to access them ingame, which is quite ugly
Re: add LuaItemPrototype.limitation
Right now nothing about recipes is mutable runtime (not even on the C++ side). There are plans to allow that but it's probably not going to be done in 0.13. Once that's done this kind of change will be possible but until then it will have to wait.
If you want to get ahold of me I'm almost always on Discord.
Re: add LuaItemPrototype.limitation
What i mean is read access in control.lua to what data/base/prototypes/item/module.lua adds to modules:
Basically it would allow a script to check whether a module can be inserted in an assembler with a specific recipe
Code: Select all
type = "module",
name = "productivity-module",
icon = "__base__/graphics/icons/productivity-module.png",
flags = {"goes-to-main-inventory"},
subgroup = "module",
order = "c[productivity]-a[productivity-module-1]",
stack_size = 50,
default_request_amount = 10,
effect = { productivity = {bonus = 0.04}, consumption = {bonus = 0.4}, pollution = {bonus = 0.3}, speed = {bonus = -0.15}}, -- <---- read access is already available via LuaItemPrototype.module_efffects
limitation = productivitymodulelimitation(), -- <---- this here
limitation_message_key = "production-module-usable-only-on-intermediates"
Re: add LuaItemPrototype.limitation
Implemented in 0.13.12.


