Mooncat wrote:
Hi, I saw your mods on mod portal. It feels a little bit weird to see a mod separated into different entries. And a question came to my mind: how the hell can someone maintain their works like this? If something is changed, he needs to apply the change 4 times.
Agreed, but I implemented it this way to make it easier for the player, not easier for the Modder.
Mooncat wrote:Yes, recipes and other things can only be created in data phase. They are all loaded during the loading screen of the game. Once loaded, the data table is gone and no more things can be added. So, in-game configuration is not a good option.
But you can also consider pre-game configuration which I would prefer in your mod as a player. You can put the value in, for example, config.lua. Then, use this value to create recipes in data.lua. The data file is just a lua file anyway, you can still do some maths inside it.
We will have to agree to disagree. To change the percentage by unzipping the mod, opening the config.lua and editing it was in my opinion too much to expect a player to do. Allowing them to change percentages using the in-game Mods menu is a better way for a normal player.
And of course, the 'triggers' are optional. I didn't want to force people to use a trigger.
It sounds fair. Yes, that option has some drawbacks. Players are involved more for custom configuration. And after they have received update, they need to re-configure again. It is up to you to keep it as is. It is your mod anyway.
Hi, just letting you know of some errors that prevent the game to load when I use the latest version (ZRecycling_0.13.12) alone with the following mods.
5dim_core_0.13.1
File __ZRecycing_graphics/item-group/5dum_core/enuclear.png not found
ElectricVoid_1.0.7
Error while loading recipe prototype "dry411srev-electric-consumer"
(recipe): Recipe dry411srev-electric-consumer must have at least one product
Mobile-suit_1.5.5
Error while loading recipe prototype "dry411srev-secret-wait-point"
(recipe): Recipe dry411srev-secret-wait-point must have at least one product
5dim and Mobile-suit may have other errors pop up, these are just the ones that pop up first.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sat Jul 09, 2016 4:03 pm
by DRY411S
The_Mak wrote:Hi, just letting you know of some errors that prevent the game to load when I use the latest version (ZRecycling_0.13.12) alone with the following mods.
5dim_core_0.13.1
File __ZRecycing_graphics/item-group/5dum_core/enuclear.png not found
ElectricVoid_1.0.7
Error while loading recipe prototype "dry411srev-electric-consumer"
(recipe): Recipe dry411srev-electric-consumer must have at least one product
Mobile-suit_1.5.5
Error while loading recipe prototype "dry411srev-secret-wait-point"
(recipe): Recipe dry411srev-secret-wait-point must have at least one product
5dim and Mobile-suit may have other errors pop up, these are just the ones that pop up first.
The first one is because I have got a missing graphics file, the next two are because those mods have got recipes in that don't have any ingredients! My code assumes that recipes have ingredients.
Edit: I have a fix that will be released tomorrow.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 1:53 am
by Simcra
Really enjoying your mod, it is well designed. I have one concern, the recipes are not localised, perhaps you could add a suffix of -9999 to them and not prefix them, so that they inherit the regular locale, just an idea.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 8:38 am
by Peter34
I've just started testing alpha 0.13 seriously, downloaded and enabled a lot of mods (old favourites, and some new ones, including v0.13.12 of this one), and I got this error message upon starting Factorio:
Error while loading recipe:prototype
"dry411srev-creative-mode_item-source" (recipe): Recipe
dry411srev-creative-mode_item-source must have at least one produkt.
Modifications: ZRecycling
I deleted the ZRecycling mod from my /mods folder (I have a backup folder containing all mods I want to experiment with, it still resides there), and after doing that Factorio did launch. So either there's some bug in this mod, or else this mod is interacting badly with another mod, in which case I don't know how to decipher what that other mod is.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 8:58 am
by DRY411S
Simcra wrote:Really enjoying your mod, it is well designed. I have one concern, the recipes are not localised, perhaps you could add a suffix of -9999 to them and not prefix them, so that they inherit the regular locale, just an idea.
Thank you for the nice feedback.
Can you reference somewhere where this suffix thing is confirmed please. I cannot find anywhere.
It's hard to know what to do about this. The locale is used in more than one place, both for the recycling recipe name, AND for the results. For example, when recycling electronic circuits, the locale is used for the circuit, AND both the iron-plate and copper-cable.
Anything that produces a single recycling result (for example turning gears back into iron-plate), the locale displays correctly for the result but not the recipe.
This is a factorio limitation, not much I can do. I could produce a locale for every recycling recipe and include it in the mod, but I have no idea what other mods people are using. Dynamic generation of locale strings is also not possible.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 9:02 am
by DRY411S
Peter34 wrote:I've just started testing alpha 0.13 seriously, downloaded and enabled a lot of mods (old favourites, and some new ones, including v0.13.12 of this one), and I got this error message upon starting Factorio:
Error while loading recipe:prototype
"dry411srev-creative-mode_item-source" (recipe): Recipe
dry411srev-creative-mode_item-source must have at least one produkt.
Modifications: ZRecycling
I deleted the ZRecycling mod from my /mods folder (I have a backup folder containing all mods I want to experiment with, it still resides there), and after doing that Factorio did launch. So either there's some bug in this mod, or else this mod is interacting badly with another mod, in which case I don't know how to decipher what that other mod is.
Peter34 wrote:I've just started testing alpha 0.13 seriously, downloaded and enabled a lot of mods (old favourites, and some new ones, including v0.13.12 of this one), and I got this error message upon starting Factorio:
Error while loading recipe:prototype
"dry411srev-creative-mode_item-source" (recipe): Recipe
dry411srev-creative-mode_item-source must have at least one produkt.
Modifications: ZRecycling
I deleted the ZRecycling mod from my /mods folder (I have a backup folder containing all mods I want to experiment with, it still resides there), and after doing that Factorio did launch. So either there's some bug in this mod, or else this mod is interacting badly with another mod, in which case I don't know how to decipher what that other mod is.
It might be a Creative Mode mod that I'm using, or it might be a mod like YARM or Rseding91's force fields mod. Both those two add a "tool" item. YARM's is used to select/indicate ore fields to "measure", and the force field mod adds a tool used to configure the force field-emitting item. I don't know if either of those do require ingredients to craft or not, I'm just thinking out loud, but I can check tomorrow, or possibly later today.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 10:07 am
by DRY411S
Peter34 wrote:It might be a Creative Mode mod that I'm using, or it might be a mod like YARM or Rseding91's force fields mod. Both those two add a "tool" item. YARM's is used to select/indicate ore fields to "measure", and the force field mod adds a tool used to configure the force field-emitting item. I don't know if either of those do require ingredients to craft or not, I'm just thinking out loud, but I can check tomorrow, or possibly later today.
Thank you for the further information. I don't know what mod uses that recipe either, but I do know that the error message means that the recipe has no ingredients. The latest versions of the mods (in the post below) will now handle ANY recipe, ANY mod that has recipes with no ingredients.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Sun Jul 10, 2016 10:07 am
by DRY411S
Download Latest versions
For Factorio 0.13Download v0.13.13 is now available on the mod portal.
Peter34 wrote:It might be a Creative Mode mod that I'm using, or it might be a mod like YARM or Rseding91's force fields mod. Both those two add a "tool" item. YARM's is used to select/indicate ore fields to "measure", and the force field mod adds a tool used to configure the force field-emitting item. I don't know if either of those do require ingredients to craft or not, I'm just thinking out loud, but I can check tomorrow, or possibly later today.
Thank you for the further information. I don't know what mod uses that recipe either, but I do know that the error message means that the recipe has no ingredients. The latest versions of the mods (in the post below) will now handle ANY recipe, ANY mod that has recipes with no ingredients.
Thanks for the quick update!
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 9:08 am
by Mooncat
I'm here because I smell trouble caused by my mod. It is grad that you have fixed that.
The recipes take no ingredient because they are for testing purpose or initial base setup.
And the other reason I am here is because I see you are having trouble on localising recipe names. I think I can help. (I tried helping Choumiko for his Rail Tanker, but it turned out item prototype does not support the necessary property. But I am sure recipe prototype has that property because I am using it in my Creative Mode. Anyway, let's get started.)
The magic property is "localised_name".
In my mod, I have to generate recipes for producing different fluids without ingredient. Fluids from other mods are also supported, so I can't really localise the recipes one-by-one. I used localised_name to do the trick. Here are the necessary snippets in my mod:
In localisation file:
[recipe-name]
single-result-recipe=__1__
double-results-recipe=__1__ and __2__
trible-results-recipe=__1__, __2__ and __3__
and then choose them and fill in the blanks accordingly.
Hope this helps.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 11:37 am
by DRY411S
Mooncat wrote:I'm here because I smell trouble caused by my mod. It is grad that you have fixed that.
The recipes take no ingredient because they are for testing purpose or initial base setup.
My mod tries to 'reverse recipe' anything that are certain types, item-groups, and item sub-groups. In vanilla with these combinations, there are no recipes that have no ingredients. That's where I got caught out. If mod writers made their special recipes for in the "other" item group then my mod would not try to handle them.
Mooncat wrote:And the other reason I am here is because I see you are having trouble on localising recipe names. I think I can help. (I tried helping Choumiko for his Rail Tanker, but it turned out item prototype does not support the necessary property. But I am sure recipe prototype has that property because I am using it in my Creative Mode. Anyway, let's get started.)
The magic property is "localised_name".
In my mod, I have to generate recipes for producing different fluids without ingredient. Fluids from other mods are also supported, so I can't really localise the recipes one-by-one. I used localised_name to do the trick. Here are the necessary snippets in my mod:
In localisation file:
[recipe-name]
single-result-recipe=__1__
double-results-recipe=__1__ and __2__
trible-results-recipe=__1__, __2__ and __3__
and then choose them and fill in the blanks accordingly.
Hope this helps.
This is excellent advice thanks.
I've had to tweak it because most of the things that I'm recycling don't have vanilla recipe-name. In vanilla, the only things with recipe-name are fluids, which I don't recycle. I'm recycling items, entities, equipment and ammo.
What I need to recycle has entity-name, equipment-name, item-name and ammo-category-name. Certainly entity-name seems to have the localised_name property. Rather than produce long lists of component parts, I'm just wrapping 'Recycled' and 'parts' around the original name. Here's me hovering over the Passive provider chest in my Recycling Machine menu.
Localised entity
Localised.png (464.99 KiB) Viewed 7436 times
By the way do you know how to change the text in the screenshot form 'Choose recipe for assembly' to 'Choose recipe for recycling'. I cannot find any way of doing that.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 3:58 pm
by DRY411S
I now have locale working fine in vanilla. There is some work to for the locale of popular mods, but I'll release soon for vanilla locale only.
I'd be grateful if anybody wants to give me some locale translations. There aren't many required. Here is the English version.
[entity-name]
recycling-machine-1=Recycling Machine 1
recycling-machine-2=Recycling Machine 2
recycling-machine-3=Recycling Machine 3
[entity-description]
recycling-machine-1=Allows recycling of items that can be made in an Assembling Machine 1
recycling-machine-2=Allows recycling of items that can be made in an Assembling Machine 2
recycling-machine-3=Allows recycling of items that can be made in an Assembling Machine 3
[item-name]
recycling-machine-1=Recycling Machine 1
recycling-machine-2=Recycling Machine 2
recycling-machine-3=Recycling Machine 3
[item-description]
recycling-machine-1=Allows recycling of items that can be made in an Assembling Machine 1
recycling-machine-2=Allows recycling of items that can be made in an Assembling Machine 2
recycling-machine-3=Allows recycling of items that can be made in an Assembling Machine 3
[item-group-name]
dry411srev-logistics=Logistics Recycling
dry411srev-production=Production Recycling
dry411srev-combat=Combat Recycling
dry411srev-intermediate-products=Intermediate products Recycling
[recipe-name]
recycledparts=Recycled __1__ parts
recycledunknown=Recycling Machine Mod Warning: No locale available for subgroup __1__
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 4:24 pm
by Mooncat
DRY411S wrote:I now have locale working fine in vanilla. There is some work to for the locale of popular mods, but I'll release soon for vanilla locale only.
I'd be grateful if anybody wants to give me some locale translations. There aren't many required. Here is the English version.
[entity-name]
recycling-machine-1=Recycling Machine 1
recycling-machine-2=Recycling Machine 2
recycling-machine-3=Recycling Machine 3
[entity-description]
recycling-machine-1=Allows recycling of items that can be made in an Assembling Machine 1
recycling-machine-2=Allows recycling of items that can be made in an Assembling Machine 2
recycling-machine-3=Allows recycling of items that can be made in an Assembling Machine 3
[item-name]
recycling-machine-1=Recycling Machine 1
recycling-machine-2=Recycling Machine 2
recycling-machine-3=Recycling Machine 3
[item-description]
recycling-machine-1=Allows recycling of items that can be made in an Assembling Machine 1
recycling-machine-2=Allows recycling of items that can be made in an Assembling Machine 2
recycling-machine-3=Allows recycling of items that can be made in an Assembling Machine 3
[item-group-name]
dry411srev-logistics=Logistics Recycling
dry411srev-production=Production Recycling
dry411srev-combat=Combat Recycling
dry411srev-intermediate-products=Intermediate products Recycling
[recipe-name]
recycledparts=Recycled __1__ parts
recycledunknown=Recycling Machine Mod Warning: No locale available for subgroup __1__
Wow, so fast. I was still wondering how to get the correct localised name from the categories. I thought you just need to use the names under [item-name] because you are recycling items anyway, but it turns out not all names are under there. Some items like offshore-pump only have names under [entity-name] and not in [item-name] (how the hell its item can be localised...). Given the fact that there is no API to check whether a localised string exists, I totally have no idea on that.
By the way, about the recipe names, won't it be to long to have "Recycling Machine Mod Warning: No locale available for subgroup __1__" in game?
Maybe it would be better: "[No locale found] __1__"
And for "Recycled __1__ parts", maybe "Recycle __1__" ?
Just a suggestion.
DRY411S wrote:By the way do you know how to change the text in the screenshot form 'Choose recipe for assembly' to 'Choose recipe for recycling'. I cannot find any way of doing that.
I don't know either. I think it is hard coded.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 5:11 pm
by DRY411S
It's a large look up table based on subgroup. I will need to extend it for mods that create new subgroups.
-- Localise the recipe name
local localestring = ""
local localetype = ""
local function localise_text(item,recipe,result)
-- Thanks to Mooncat https://forums.factorio.com/memberlist.php?mode=viewprofile&u=20664
-- and this advice https://forums.factorio.com/viewtopic.php?f=97&t=26039&p=183183#p183183
-- Based on the subgroup name, this lookup table builds a locale string from the base.cfg locale
-- In English, "Recycled <item_being_recycled> parts" is displayed
-- TODO: expand to support mods that create a lot of new subgroups.
local locale_section = {
["recycling-machine"] = "entity-name.",
["module"] = "item-name.",
["logistic-network"] = "entity-name.",
["gun"] = "item-name.",
["transport"] = "entity-name.",
["barrel"] = "item-name.",
["equipment"] = "equipment-name.",
["production-machine"] = "entity-name.",
["defensive-structure"] = "entity-name.",
["circuit-network"] = "item-name.",
["energy-pipe-distribution"] = "entity-name.",
["inserter"] = "entity-name.",
["extraction-machine"] = "entity-name.",
["belt"] = "entity-name.",
["energy"] = "entity-name.",
["smelting-machine"] = "entity-name.",
["intermediate-product"] = "item-name.",
["storage"] = "entity-name.",
["tool"] = "item-name.",
["science-pack"] = "item-name.",
["ammo"] = "item-name.",
["capsule"] = "item-name.",
["armor"] = "item-name.",
}
if locale_section[item.subgroup] then
localestring = {"recipe-name.recycledparts",{locale_section[item.subgroup] .. result}}
else
-- Show the user the name of the unsupported subgroup,
-- when they hover over the Recycling Recipes
-- for future bug reporting and enhancement
localestring = {"recipe-name.recycledunknown", {item.subgroup}}
end
end --localise_text
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 5:36 pm
by Mooncat
DRY411S wrote:It's a large look up table based on subgroup. I will need to extend it for mods that create new subgroups.
-- Localise the recipe name
local localestring = ""
local localetype = ""
local function localise_text(item,recipe,result)
-- Thanks to Mooncat https://forums.factorio.com/memberlist.php?mode=viewprofile&u=20664
-- and this advice https://forums.factorio.com/viewtopic.php?f=97&t=26039&p=183183#p183183
-- Based on the subgroup name, this lookup table builds a locale string from the base.cfg locale
-- In English, "Recycled <item_being_recycled> parts" is displayed
-- TODO: expand to support mods that create a lot of new subgroups.
local locale_section = {
["recycling-machine"] = "entity-name.",
["module"] = "item-name.",
["logistic-network"] = "entity-name.",
["gun"] = "item-name.",
["transport"] = "entity-name.",
["barrel"] = "item-name.",
["equipment"] = "equipment-name.",
["production-machine"] = "entity-name.",
["defensive-structure"] = "entity-name.",
["circuit-network"] = "item-name.",
["energy-pipe-distribution"] = "entity-name.",
["inserter"] = "entity-name.",
["extraction-machine"] = "entity-name.",
["belt"] = "entity-name.",
["energy"] = "entity-name.",
["smelting-machine"] = "entity-name.",
["intermediate-product"] = "item-name.",
["storage"] = "entity-name.",
["tool"] = "item-name.",
["science-pack"] = "item-name.",
["ammo"] = "item-name.",
["capsule"] = "item-name.",
["armor"] = "item-name.",
}
if locale_section[item.subgroup] then
localestring = {"recipe-name.recycledparts",{locale_section[item.subgroup] .. result}}
else
-- Show the user the name of the unsupported subgroup,
-- when they hover over the Recycling Recipes
-- for future bug reporting and enhancement
localestring = {"recipe-name.recycledunknown", {item.subgroup}}
end
end --localise_text
Looks like binding the categories manually is the only option right now.
Thanks for sharing that. this may be useful for other modders too.
Re: [MOD 0.13.0+|v0.12]Recycling Machines
Posted: Tue Jul 12, 2016 6:51 pm
by DRY411S
Download Latest versions
For Factorio 0.13Download v0.13.14 is now available on the mod portal.
There was a bug that meant that most of Bob's Electronics and Bob's Modules were not being offered for Recycling. This is now fixed. There is a limitation. Bob allows some modules to be built two different ways. Recycling Machines only allows one recycling method for those modules.
Download Trigger mods for Factorio v0.13 from the Mod Portal