[MOD 0.17] Deadlock's Crating Machine

Topics and discussion about specific mods
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

orzelek wrote:I'm using simple code check for the item:

Code: Select all

if deadlock_crating then
	for _, item in pairs(itemTable) do
		if data.raw.item[item[1]] then
			deadlock_crating.create(item[1], "deadlock-crating-"..item[2])
		end
	end
end
item[1] is name, item[2] is tech level to add it to.
It's strange that this check would pass but item got broken.

One thing might be that I don't enable thorium in bob's mods and I let Clown's mod to add it. I have full set of bob's, angels and clowns I think.
That looks ideal.

So it seems to work fine at this end when Bob's isn't installed at all. Try working backwards from there ... The only thing I can think of is that whatever version of thorium ore it's picking up, has a malformed icons[] property, i.e. it specifies some kind of icons array but an element in that array doesn't specify icon= ...
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

From bobores_0.16.2/prototypes/thorium-ore.lua:

Code: Select all

-- notice the icon line is missing! Icon will now be generated!
It doesn't say that in any of the other ore definitions that I looked at. The icon simply isn't present at the time that DCM processes the items.
Image

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by orzelek »

Deadlock989 wrote:From bobores_0.16.2/prototypes/thorium-ore.lua:

Code: Select all

-- notice the icon line is missing! Icon will now be generated!
It doesn't say that in any of the other ore definitions that I looked at. The icon simply isn't present at the time that DCM processes the items.
I tried adding a dependency but it's a no go. It might be thoe whole mod combination with all of them present at once thats braking it. I'll debug it if I really need it to work :D

Hmm actually I have this line:

Code: Select all

  12.194 Script @__DeadlockStacking__/prototypes/functions.lua:27: WARNING: creating layers-of-layers stack icon (thorium-ore), this is 4x more rendering effort than a custom icon!
And it's the only case I see in log file thats doing layers-of-layers icon. So it might be something to check.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

orzelek wrote:
Deadlock989 wrote:From bobores_0.16.2/prototypes/thorium-ore.lua:

Code: Select all

-- notice the icon line is missing! Icon will now be generated!
It doesn't say that in any of the other ore definitions that I looked at. The icon simply isn't present at the time that DCM processes the items.
I tried adding a dependency but it's a no go. It might be thoe whole mod combination with all of them present at once thats braking it. I'll debug it if I really need it to work :D
I tried it with Bob's Ores installed without MadClown and again, it works fine for me. So all I can think of is that this is some kind of loading order / dependency thing.
Hmm actually I have this line:

Code: Select all

  12.194 Script @__DeadlockStacking__/prototypes/functions.lua:27: WARNING: creating layers-of-layers stack icon (thorium-ore), this is 4x more rendering effort than a custom icon!
And it's the only case I see in log file thats doing layers-of-layers icon. So it might be something to check.
That's from DSB. It indicates that the thorium ore base item doesn't specify an icon property but a layered icons property instead. So the auto-generated "stack of thorium ore" item is therefore made of layers of layers. But it says "4x", which means that this particular icons property only specifies a single icon layer (the auto-generated icons have a base layer to force the right scaling and then 3 layers for each layer of the base icon, so 1 + 3 = 4x). That's unusual but totally allowed. So it's only as bad for performance as all the other auto-generated icons.

Probably shouldn't have had separate threads for these mods.
Image

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by orzelek »

Deadlock989 wrote:
orzelek wrote:
Deadlock989 wrote: ...
Hmm actually I have this line:

Code: Select all

  12.194 Script @__DeadlockStacking__/prototypes/functions.lua:27: WARNING: creating layers-of-layers stack icon (thorium-ore), this is 4x more rendering effort than a custom icon!
And it's the only case I see in log file thats doing layers-of-layers icon. So it might be something to check.
That's from DSB. It indicates that the thorium ore base item doesn't specify an icon property but a layered icons property instead. So the auto-generated "stack of thorium ore" item is therefore made of layers of layers. But it says "4x", which means that this particular icons property only specifies a single icon layer (the auto-generated icons have a base layer to force the right scaling and then 3 layers for each layer of the base icon, so 1 + 3 = 4x). That's unusual but totally allowed. So it's only as bad for performance as all the other auto-generated icons.

Probably shouldn't have had separate threads for these mods.
The thing is that Clown's mod has icon not icons property for thorium ore. Thats where I'm lost and expecting a bit of heavy debug needed - your mod sees icons property but definition has icon property in Clown's nuclear mod.
This is thorium ore item definition from Clown's mod:

Code: Select all

		{
			type = "item",
			name = "thorium-232",
			icon = "__Clowns-Nuclear__/graphics/icons/thorium-232.png",
			icon_size = 32,
			flags = {"goes-to-main-inventory"},
			subgroup = "intermediate-product",
			order = "r[thorium-232]",
			stack_size = 100
		},

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

orzelek wrote:The thing is that Clown's mod has icon not icons property for thorium ore. Thats where I'm lost and expecting a bit of heavy debug needed - your mod sees icons property but definition has icon property in Clown's nuclear mod
Yeah, I'm stumped too. Tried to follow their code but it's a rabbit warren, especially Bob's, but this is the sense of what's going on:

I think you can rule out MadClown's. That's a perfectly well defined item. And in my tests, DSB and DCM work just fine when MC and only MC is installed. So something else in your combo is generating a thorium ore item with no icon property (because DSB and DCM prefer icon over icons) but with a malformed icons property.

Also, DSB and DCM work just fine for me when Bob's Ores and only Bob's Ore is installed. BO defines an in-world thorium ore resource without an icon, so in that sense the resource is malformed, at least for a while. Looking at the ore functions in boblibrary, there is something going on around line 292. If no icon is defined for an ore resource (as there isn't, for thorium) then it tries to make a single-layer icons property instead. It seems to be doing that whether or not thorium ore generation is turned on in the config. I don't know why that isn't happening properly for you.

I've now tested MCNuclear and BO separately and both at the same time, in all three cases I can generate thorium ore crates and stacks with no errors. The icon is sort of grey when only MCNuclear is running.

Sorry, but that's as much as I can figure out.

Edited to add: my gut instinct at the moment is to add more checks and then disallow crate creation if the item icons are malformed. It's probably wrong of me to assume that there aren't mods out there with half-finished items in them.

Edited again: I just did some code tidying and then tried to run your stacksaddon-0.0.2 (thorium uncommented) with AAI Industry (which uses some layered icons), a test "helper" mod for AAI Industry, Angel's Bio, Angel's Infinite Ores, Angel's Petro, Angel's Refining, Angel's Smelting, Bob's Metals etc., Bob's Ores, Bob's Electronics, Bob's Logistics, Bob's Revamp, MadClown's Extended Angelbob, MadClown's Processing, MadClown's Nuclear. Took me half an hour to install, what with all the missing dependencies, but I got it running. Thorium ore still shows up as a single-layer icons thing unlike every other Bob's ore, but it loads fine and stacks and crates up just fine. Sorry, I've tried to puzzle this out but it's something unique to your mod list. What's really bothering me about your error message now is that blahblahblah.icons[1] should be the wooden crate icon, not anything from the other mods.
Image

orzelek
Smart Inserter
Smart Inserter
Posts: 3911
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by orzelek »

It turns out reason for all of this was much simpler.
I had prototype crating and stacking from forum thread not from mod portal.
Redownloading from mod portal makes it work properly.. :D
Since prototype had same version number game wouldn't update it automatically.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

orzelek wrote:It turns out reason for all of this was much simpler.
I had prototype crating and stacking from forum thread not from mod portal.
Redownloading from mod portal makes it work properly.. :D
Since prototype had same version number game wouldn't update it automatically.
Image
Image

foodfactorio
Filter Inserter
Filter Inserter
Posts: 454
Joined: Tue Jun 20, 2017 1:56 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by foodfactorio »

(btw which episode of tng is this from?) :)
(also me from the mod portal - im not dustine lol) = https://mods.factorio.com/mods/Dustine/ ... ssion/9108
my 1st Mod Idea :) viewtopic.php?f=33&t=50256

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

foodfactorio wrote:(btw which episode of tng is this from?) :)
Season 3, episode 16, "The Offspring"
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

Version: 1.1.3
Date: 04. 03. 2018
Inter-mod support:
- Added two new functions for modders.
- deadlock_crating.remove(string) will search DCM's native technologies for any recipe unlocks with a matching substring and remove them.
- deadlock_crating.reset() will clear all crating recipes from all DCM technologies, leaving only the machine unlocks.
- See the modding readme for more details.
Bugfixes:
- Addressed a global variable pollution issue.
- If external mods use .create() to add to one of the native DCM technologies, the recipe now appears in the correct subgroup in the crafting tab.
Image

foodfactorio
Filter Inserter
Filter Inserter
Posts: 454
Joined: Tue Jun 20, 2017 1:56 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by foodfactorio »

Deadlock989 wrote:
foodfactorio wrote:(btw which episode of tng is this from?) :)
Season 3, episode 16, "The Offspring"
cool many thanks :)
(also me from the mod portal - im not dustine lol) = https://mods.factorio.com/mods/Dustine/ ... ssion/9108
my 1st Mod Idea :) viewtopic.php?f=33&t=50256

aka13
Filter Inserter
Filter Inserter
Posts: 683
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by aka13 »

This is great, thank you for your work. For the first time I have been tempted into item boxing, all thanks to your efforts!
Pony/Furfag avatar? Opinion discarded.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

You're most welcome.
Image

usafphoenix
Long Handed Inserter
Long Handed Inserter
Posts: 58
Joined: Sun Aug 06, 2017 9:42 am
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by usafphoenix »

Technology issue cross-compatibility with Research Queue.

Research Queue issues error (no crash, just an error message printed to the game screen) when trying to load up technology from Deadlock's Crating Machine and Compact Loaders mod (stacking beltboxes seem fine).
Console outputs "failed to load tech". unfortunately it doesn't tell me which technology key isn't loading, but only these two mods in my testing trigger this behaviour.
because the error doesn't tell me anything more, like "cannot load graphic. or "technology data string missing", i don't know where to begin to look for what may be causing the error to print to screen.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

usafphoenix wrote:Technology issue cross-compatibility with Research Queue.

Research Queue issues error (no crash, just an error message printed to the game screen) when trying to load up technology from Deadlock's Crating Machine and Compact Loaders mod (stacking beltboxes seem fine).
Console outputs "failed to load tech". unfortunately it doesn't tell me which technology key isn't loading, but only these two mods in my testing trigger this behaviour.
because the error doesn't tell me anything more, like "cannot load graphic. or "technology data string missing", i don't know where to begin to look for what may be causing the error to print to screen.
I use RQ myself (so essential that they're building it into the next Factorio GUI) and haven't had any issues during a long play-through. Before I investigate further can I check you're using the most recent versions of RQ, DCM and DCL?
Image

User avatar
steinio
Smart Inserter
Smart Inserter
Posts: 2633
Joined: Sat Mar 12, 2016 4:19 pm
Contact:

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by steinio »

Hi,

get this error after updating to 0.16.30:

Code: Select all

Error while loading item prototype "deadlock-crate-coal" (item): Must have a fuel_value when fuel_acceleration_multiplier, fuel_top_speed_multiplier or fuel_emissions_multiplier are used.
Modifications: Deadlock's Crating Machine
Adding

Code: Select all

itemcopy.fuel_emissions_multiplier = nil
to line 67 in /protoypes/functions.lua fixed it.

Cu, steinio.
Image

Transport Belt Repair Man

View unread Posts

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

steinio wrote:Hi,

get this error after updating to 0.16.30:

Code: Select all

Error while loading item prototype "deadlock-crate-coal" (item): Must have a fuel_value when fuel_acceleration_multiplier, fuel_top_speed_multiplier or fuel_emissions_multiplier are used.
Modifications: Deadlock's Crating Machine
Adding

Code: Select all

itemcopy.fuel_emissions_multiplier = nil
to line 67 in /protoypes/functions.lua fixed it.

Cu, steinio.
Thanks for the report. Looks like one of those mods is adding the new fuel emissions multiplier to coal, which DCM doesn't look out for (because it didn't exist until recently). Easy fix, will sort it out later tonight.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

Version: 1.1.4
Date: 13. 03. 2018
Bugfixes:
- Fixed a potentially breaking change in 0.16.29 to do with the new fuel emission multiplier.
- To prevent this kind of thing happening again, crate items are now generated "from scratch" instead of copying base item properties.
Image

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [MOD 0.16.x] Deadlock's Crating Machine

Post by Deadlock989 »

Version: 1.1.5
Date: 24. 03. 2018
Changes:
- Players can now pack and unpack crates by hand, due to new support in the game for avoiding circular recipes.
- Simplified the crate inventory tab to try and minimise space used. Machines are now found on the Production tab.
- Removed an unnecessary layer from crate icons to lessen the rendering effort needed for crates on belts.
Inter-mod support:
- Items from other mods with icon sizes of 64 and 128 are now supported. See modding readme.
- Added a verbose logging option to mod settings so you can see what DCM is doing with your itamz.
Image

Post Reply

Return to “Mods”