[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.17] Deadlock's Crating Machine

Post by Deadlock989 »

mrvn wrote: ↑
Thu May 09, 2019 12:35 pm
And I never ever, not once, asked you do add anything like that to the base mod. So you telling me you won't do something I didn't ask for is pointless. Thanks for stopping.
Check the thread. You've brought this up at least three times.

I think I need a time-out from you. I'll take you off ignore in six months.
Image

Mernom
Fast Inserter
Fast Inserter
Posts: 122
Joined: Sun Jul 15, 2018 10:05 pm
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Mernom »

I managed to add a new machine tier (had to copy the animation bit to change the tint... Would appritiate tips on how to change only that bit without copying everything), tech, recipe, item...
The one thing that gave me trouble is that it seems like your function can't deal with requests to add to a tech that's not one of your own.
Does the current version accept no tech argument? I'm having crashes when I'm leaving it blank, when icon size is listed.

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

Mernom wrote: ↑
Tue May 28, 2019 7:56 pm
I managed to add a new machine tier (had to copy the animation bit to change the tint... Would appritiate tips on how to change only that bit without copying everything), tech, recipe, item...
If you just want to change the tints, I'd do this (not tested):

Code: Select all

local machine = table.deepcopy(data.raw["assembling-machine"]["deadlock-machine-packer-entity-1"])
-- icons - to do: same for the machine's item's icons as well
if machine.icons then
	for _,icon in pairs(machine.icons) do
		if icon.tint then icon.tint = <your colour here> end
	end
end
-- animation
for _,layer in pairs(machine.animation.layers) do
	if layer.tint then layer.tint = <your colour here> end
	if layer.hr_version and layer.hr_version.tint then layer.hr_version.tint = <your colour here> end
end
-- working vis
if machine.working_visualisation then
	if machine.working_visualisation.animation then
		machine.working_visualisation.animation.tint = brighter_colour(<your colour here>)
		machine.working_visualisation.animation.hr_version.tint = brighter_colour(<your colour here>)
	end
	if machine.working_visualisation.light then
		machine.working_visualisation.light.color = brighter_colour(<your colour here>)
	end
end
data:extend({machine})
Before the data:extend, you'd need to change everything else you want changed, e.g. machine speed, crafting categories etc.
The one thing that gave me trouble is that it seems like your function can't deal with requests to add to a tech that's not one of your own.
Does the current version accept no tech argument? I'm having crashes when I'm leaving it blank, when icon size is listed.
It should deal with any specified tech, but that tech has to already exist as a fully specified technology in data.raw.

It doesn't accept a nil tech argument. In my memory it did, but I must have misremembered, or I'm confusing it with DSB.
Image

Mernom
Fast Inserter
Fast Inserter
Posts: 122
Joined: Sun Jul 15, 2018 10:05 pm
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Mernom »

I'll try to figure out a bit more tommorow then.
As for the brighter color bit, it doesn't seem to work at all. I tried to only edit the base tint stuff, but then I recived an error about the brighter color stuff.

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

Mernom wrote: ↑
Tue May 28, 2019 8:40 pm
I'll try to figure out a bit more tommorow then.
As for the brighter color bit, it doesn't seem to work at all. I tried to only edit the base tint stuff, but then I recived an error about the brighter color stuff.
Post what you have or PM it to me and I can advise. Impossible to diagnose otherwise.
Image

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

PSA
I am working on some updates to the DCM API, because I need some extra functions myself, which are more useful for dealing with broad changes made by big overhaul mods. Some existing functions will be deprecated but they will continue to work as they do now.

While I am at it, I may as well add the "add machine tier" function that people keep hassling me about, even though I have no use for it myself and I don't actually think uber-crating machines are a good idea, but I'll do anything for an easy life. It won't be as comprehensive as the DSB "create tier" functions but it will let you create neon lime-coloured Crating Machines that are fast enough to warrant an epilepsy warning, if that's what you want.

However, ideally this means migrations. I made some very dodgy choices for the names of entities, recipes and items, because it was my first ever mod. I can handle any changes in existing saves as a migration, but third party mods which are currently hacking higher-tier crating machines are probably going to break. So this is your notice.

This is what is going to change (N is the tier number, 1-3 by default)

Crating machine items: deadlock-machine-packer-item-N > deadlock-crating-machine-N
Crating machine recipes: deadlock-machine-packer-recipe-N > deadlock-crating-machine-N
Crating machine entities: deadlock-machine-packer-entity-N > deadlock-crating-machine-N
Crate items, crating recipes and technology names will not change.

I will migrate tiers 1-5. If you created some other numbered tier higher or lower than that, let me know ASAP. If you named your crating machines with some different scheme to the above, you'll have to fix it / migrate it yourself. If you are copying a base machine, be advised now that the names are going to change. The good news is that you should be able to replace all of your copying/tweaking with a single function call per machine.

Unicorns-TBA.png
Unicorns-TBA.png (478.01 KiB) Viewed 4829 times
Image

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

A reminder about the post above. I have completed the update and it will be uploaded when shanemadden gets time to do the pull request and publish it.

As stated above, for the crating machines, the entity name, recipe name and item name are changing. Any yellow, red and blue machines provided by the mod will be automatically migrated so this will not affect any players who are just using the base mod itself. If your mods are creating copies of the machines and giving them tiers numbers 4 or 5, any machines in the game save, placed in the world or in player inventories, will be migrated as well. Crate items and recipes are not changing. But if you gave your machines some other naming system or went beyond tier 5, you will need to handle the migrations yourself.

If you are currently copying a crating machine and modifying it, the name will be changing, so your code is going to break:

Crating machine items: deadlock-machine-packer-item-N > deadlock-crating-machine-N
Crating machine recipes: deadlock-machine-packer-recipe-N > deadlock-crating-machine-N
Crating machine entities: deadlock-machine-packer-entity-N > deadlock-crating-machine-N

There will be a new function, deadlock_crating.add_tier(), which lets you create any arbitrary tier of machine and will be the recommended way of extending DCM tiers from now on. When the PR is accepted, there will be an updated page of API documentation, in Markdown, that tells you how to use it - you will be able to find it both in the mod zip file and on the main Github source code page for the mod.
Last edited by Deadlock989 on Mon Jun 10, 2019 7:56 am, edited 1 time in total.
Image

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

The API update is now live. If you start using the new functions, maybe add a version requirement in the DCM dependency (>= 1.5.0).
Image

devfrag
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Aug 09, 2016 2:59 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by devfrag »

Apologies if this has been reported before. I did search this thread and didn't see anything at a quick glance. Is the superior crating machine speed suppose to be 0.125? The express one is at 3.

https://imgur.com/a/agrQ9bS

Thanks

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

devfrag wrote: ↑
Wed Jul 03, 2019 4:31 pm
Apologies if this has been reported before. I did search this thread and didn't see anything at a quick glance. Is the superior crating machine speed suppose to be 0.125? The express one is at 3.

https://imgur.com/a/agrQ9bS

Thanks
Hi, that crating machine isn't defined by this mod. It is created by / defined by Krastorio. You need to report it to the Krastorio guys.
Image

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

Added Italian locale, thanks to Linver for providing it.
Image

Recon777
Filter Inserter
Filter Inserter
Posts: 267
Joined: Fri Jun 10, 2016 4:04 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Recon777 »

There seems to be an issue with the bounding box of our higher tier crating machines. Squeakthrough isn't playing nice with it for some reason, though I'm not yet sure what is the root of the issue.

Image

I was trying to test Pawz's unreleased version of the mod, which uses your new function. Since I didn't make that mod, I can't comment myself as to why it might be breaking but you might know. Perhaps the function is not passing through the bounding box correctly?

Also, for what it's worth, the idea of these two higher tier crating machines is to be able to handle bob's turbo and ultimate belts carrying uncrated items and be able to crate one belt with one machine. Obviously, the idea is not to handle a fast belt full of crated items. That would be ridiculously fast. So where yellow, red, and blue are speeds 1,2, and 3 respectively, purple and green are simply 4 and 5.

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

Recon777 wrote: ↑
Thu Jul 11, 2019 4:23 am
There seems to be an issue with the bounding box of our higher tier crating machines. Squeakthrough isn't playing nice with it for some reason, though I'm not yet sure what is the root of the issue.
Well, the root cause is that Squeak Through is the most godawful piece of crap, and takes diabolical liberties.

Squeak Through carpet bombs every single entity it can find from any other mod, shrinking their bounding boxes without even bothering to check whether they even need changing or not. It doesn't care whether the entities concerned are already passable when placed next to each other, or whether the numbers it pulls out of a hat fuck up the entity's selection boxes or their fluid connections. It has as much finesse as napalm. But it does all of this relatively early, during its data-updates stage. If you're adding new entities later than that, e.g. in data-final-fixes - as recommended for DCM and DSB, because you need to catch all the item and tech creation from a slew of other mods - then you end up in a situation where Squeak Through has managed to screw up the entities in tiers 1, 2, and 3, but never touches your new entities in tiers 4 or 5 (or whatever). Hey presto, bounding boxes don't match.

Solution: uninstall Squeak Through, because it's bollocks.
Image

Recon777
Filter Inserter
Filter Inserter
Posts: 267
Joined: Fri Jun 10, 2016 4:04 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Recon777 »

Deadlock989 wrote: ↑
Thu Jul 11, 2019 8:10 am
But it does all of this relatively early, during its data-updates stage. If you're adding new entities later than that, e.g. in data-final-fixes - as recommended for DCM and DSB, because you need to catch all the item and tech creation from a slew of other mods - then you end up in a situation where Squeak Through has managed to screw up the entities in tiers 1, 2, and 3, but never touches your new entities in tiers 4 or 5 (or whatever). Hey presto, bounding boxes don't match.

Solution: uninstall Squeak Through, because it's bollocks.
Wow, that sounds pretty terrible. A new mod which does what Squeakthrough should have done (but without being crap) would be a good idea. But yes, it sounds like this mod will have to go. It's odd because I know Supercheese is better than this.

What I'm really curious about is why this is only showing up now where the previous version of our extension mod did the deepcopy technique and did not have this problem. Perhaps the deepcopy was reading the post-squeakthrough bounding box sizes of the lower tier crating machines and so they matched.

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

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Deadlock989 »

Recon777 wrote: ↑
Fri Jul 12, 2019 1:48 am
Perhaps the deepcopy was reading the post-squeakthrough bounding box sizes of the lower tier crating machines and so they matched.
Most likely.
Image

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by slippycheeze »

Recon777 wrote: ↑
Fri Jul 12, 2019 1:48 am
Deadlock989 wrote: ↑
Thu Jul 11, 2019 8:10 am
Solution: uninstall Squeak Through, because it's bollocks.
Wow, that sounds pretty terrible. A new mod which does what Squeakthrough should have done
Picker Tweaks has a similar feature, but apparently less issues? At least, none I noticed, but I have not used this mod with it. None of the tree related oddities, anyway. Sadly, comes with many cheat-ish options, positively, you can turn them all off. YMMV.

Illiander42
Filter Inserter
Filter Inserter
Posts: 406
Joined: Mon Feb 05, 2018 10:01 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Illiander42 »

"More Accurate Player Size Compared to Vehicles" is a mod that does 90% of what squeak through does, as far as I can see. Seems to work by making the player BB smaller.

Also, I have a bug when I use version 1.5.0 or later of crating with 0.0.4 or later of Bob's intergrations. Complains it can't find "machine" or something.

mrvn
Smart Inserter
Smart Inserter
Posts: 5696
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by mrvn »

Illiander42 wrote: ↑
Tue Jul 16, 2019 6:31 pm
"More Accurate Player Size Compared to Vehicles" is a mod that does 90% of what squeak through does, as far as I can see. Seems to work by making the player BB smaller.

Also, I have a bug when I use version 1.5.0 or later of crating with 0.0.4 or later of Bob's intergrations. Complains it can't find "machine" or something.
Squeak through lets you move between pipes and other entities that touch because the reduced collision box opens up a gap between them, No amount of reducing the player collision box should have the same effect.

slippycheeze
Filter Inserter
Filter Inserter
Posts: 587
Joined: Sun Jun 09, 2019 10:40 pm
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by slippycheeze »

mrvn wrote: ↑
Thu Jul 18, 2019 9:56 am
Illiander42 wrote: ↑
Tue Jul 16, 2019 6:31 pm
"More Accurate Player Size Compared to Vehicles" is a mod that does 90% of what squeak through does, as far as I can see. Seems to work by making the player BB smaller.

Also, I have a bug when I use version 1.5.0 or later of crating with 0.0.4 or later of Bob's intergrations. Complains it can't find "machine" or something.
Squeak through lets you move between pipes and other entities that touch because the reduced collision box opens up a gap between them, No amount of reducing the player collision box should have the same effect.
Are the pipes actually gapless, though?

Recon777
Filter Inserter
Filter Inserter
Posts: 267
Joined: Fri Jun 10, 2016 4:04 am
Contact:

Re: [MOD 0.17] Deadlock's Crating Machine

Post by Recon777 »

Honestly, if we could just walk through pipes that'd cover about 80% of Squeakthrough's usefulness. Pipes are the main culprit because they tend to form hook-shaped figures that are impassible, often "catching" you as you run by.

Post Reply

Return to β€œMods”