[V2.0.22] How can you set the comparator with set_quick_bar_slot?

Place to get help with not working mods / modding interface.
User avatar
picklock
Fast Inserter
Fast Inserter
Posts: 237
Joined: Sat Nov 09, 2019 6:49 am
Contact:

[V2.0.22] How can you set the comparator with set_quick_bar_slot?

Post by picklock »

With get_quick_bar_slot you get the name of the item, its quality and as table field comparator as ComparatorString the type of quality comparison of a quickbar slot.

With set_quick_bar_slot you can set the item and its quality for a quickbar slot, but not the type of quality comparison, i.e. the comparator field (ComparatorString).

In my opinion, this is inconsistent.

So how can I set the comparator field?
My Mods: Picklocks Fusion Power | Picklocks Inserter | Picklocks Lithium Polymer Accumulator | Picklocks rocket silo stats | Picklocks Set Inventory Filters | Picklocks QuickBar Import/Export | Picklocks Nauvis Cliff-Explosives
robot256
Smart Inserter
Smart Inserter
Posts: 1060
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [V2.0.22] How can you set the comparator with set_quick_bar_slot?

Post by robot256 »

You're right, that's a missing feature. This belongs in Modding Interface Requests.

It's easy to justify, because the devs intend for most "set" functions to accept the results of a "get" function. I just tested in 2.0.22 and this code:

Code: Select all

/c game.player.set_quick_bar_slot(1, game.player.get_quick_bar_slot(1))
will execute just fine, and matching the behavior in the documentation, erase the quality comparison the player configured for that slot.
User avatar
picklock
Fast Inserter
Fast Inserter
Posts: 237
Joined: Sat Nov 09, 2019 6:49 am
Contact:

Re: [V2.0.22] How can you set the comparator with set_quick_bar_slot?

Post by picklock »

Thank you for the confirmation. I did a similar test with the same result.

@Moderators: So if this is a modding interface request, please move it accordingly.
My Mods: Picklocks Fusion Power | Picklocks Inserter | Picklocks Lithium Polymer Accumulator | Picklocks rocket silo stats | Picklocks Set Inventory Filters | Picklocks QuickBar Import/Export | Picklocks Nauvis Cliff-Explosives
Post Reply

Return to “Modding help”