Page 1 of 1

[1.1.38] selection-tool items do not stack in input slot

Posted: Mon Aug 30, 2021 10:37 am
by PFQNiet
I have the following item in my mod:

Code: Select all

local scanneritem = {
	type = "selection-tool",
	name = name,
	icon = graphics.."icons/"..name..".png",
	icon_size = 64,
	stack_size = 1,
	subgroup = "logistics-observation",
	order = "f["..name.."]",
	open_sound = sounds.open_sound,
	close_sound = sounds.close_sound,
	selection_mode = {"nothing"},
	selection_color = {a=0},
	selection_cursor_box_type = "entity",
	alt_selection_mode = {"nothing"},
	alt_selection_color = {a=0},
	alt_selection_cursor_box_type = "entity",
	mouse_cursor = name,
	flags = {"mod-openable"}
}
I will mention that the only reason this is a `selection-tool` is that `mod-openable` doesn't work on any other item type.

This item is used in certain recipes. Five of them are needed at once. However, while this worked fine in 1.1.37, as of 1.1.38 they will no longer stack in assembling machines.

If this is intentional, I will need some other way of "opening" an item. In my particular case it's really just a way of accessing a special GUI for the item, so technically all I really need is some way of detecting a right-click on any item having this name, they aren't item-specific, so any pointers for a workaround would help too, but this does seem like a regression since it doesn't appear to be listed as an intentional change in the changelog.

Re: [1.1.38] Tools can no longer stack

Posted: Mon Aug 30, 2021 11:26 am
by Xoriun
It says `stack_size = 1`.
Maybe that's the problem?

Re: [1.1.38] Tools can no longer stack

Posted: Mon Aug 30, 2021 11:36 am
by eradicator
PFQNiet wrote: Mon Aug 30, 2021 10:37 am detecting a right-click on any item having this name, they aren't item-specific, so any pointers for a workaround would help too
The only other item type that comes to mind is: item-with-inventory, but I don't know if that fires any events.

Re: [1.1.38] Tools can no longer stack

Posted: Mon Aug 30, 2021 11:58 am
by PFQNiet
Xoriun wrote: Mon Aug 30, 2021 11:26 am It says `stack_size = 1`.
Maybe that's the problem?
Concrete has a stack size of 100 but that doesn't stop you shoving 1k of it into an assembling machine to make a silo ;)

Also it worked in 1.1.37. This appears to be a regression.

Re: [1.1.38] Tools can no longer stack

Posted: Mon Aug 30, 2021 12:18 pm
by PFQNiet
I have "fixed" this by just making it a regular `item` and, instead of `mod-openable`, I made a `custom-input` that listens for `open-item` inputs. If the selected prototype is an item, that item is the one I want, and if the player has either no GUI or their own character open, then the item's GUI will appear. This is as close as I can get to replicating the built-in behaviour of `mod-openable` on a regular item.

Re: [1.1.38] Tools can no longer stack

Posted: Mon Aug 30, 2021 2:24 pm
by SoShootMe
PFQNiet wrote: Mon Aug 30, 2021 10:37 am I have the following item in my mod:

Code: Select all

local scanneritem = {
	...
	stack_size = 1,
	...
}
...
This item is used in certain recipes. Five of them are needed at once. However, while this worked fine in 1.1.37, as of 1.1.38 they will no longer stack in assembling machines.
Very similar to 99708, and while that is marked as resolved in 1.1.39, it's not clear if the fix will also apply to this case.

Re: [1.1.38] selection-tool items do not stack in input slot

Posted: Tue Sep 07, 2021 8:59 am
by Klonan
It looks like a duplicate of this 99708