[1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post Reply
curiosity
Fast Inserter
Fast Inserter
Posts: 176
Joined: Wed Sep 11, 2019 4:13 pm
Contact:

[1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post by curiosity »

To reproduce:
1. Register the following custom input:

Code: Select all

  {
    type = "custom-input",
    name = "rb-open-selected",
    key_sequence = "ALT + mouse-button-1",
    include_selected_prototype = true,
  }
2. In-game execute the following command:

Code: Select all

/c script.on_event('rb-open-selected', function(e)
    local p = e.selected_prototype
    if p then
        game.print{'', e.tick, ' ', p.base_type, '.', p.derived_type, '.', p.name}
    else
        game.print{'', e.tick, ' nothing'}
    end
end)
3. Open an assembler with a recipe that has fluid ingredients or products and Alt-click on the fluid slot.

Observed:
The "nothing" message.

Expected:
A message with fluid type and name.

This works correctly for item slots, the discrepancy is quite unexpected.

Honktown has also confirmed that the bug exists for the mining fluid.

Honktown
Filter Inserter
Filter Inserter
Posts: 889
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post by Honktown »

Related: viewtopic.php?p=539988#p539988

Open prototypes explorer GUI doesn't work with input/output fluids on assemblers, nor the input fluid on miners, but does work on the output fluid (e.g. yes: crude-oil from a pumpjack, no: sulfuric acid for uranium-ore)
I have mods! I guess!
Link

robot256
Filter Inserter
Filter Inserter
Posts: 436
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post by robot256 »

The assembler fluidbox API is a hot mess, so I'm not surprised it's not doing what you want. Assembler fluidboxes are assigned at runtime based on what recipe is selected. Each recipe can ignore, use, or merge the N different prototype fluidboxes to make M = (between 0 and N) dynamic fluidboxes. The fluidbox prototypes theoretically contain all the information you need, but requesting the prototypes for the dynamic fluidboxes doesn't give you the corresponding prototype fluidboxes. The indexes and index limits in the API are messed up.

Honktown
Filter Inserter
Filter Inserter
Posts: 889
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post by Honktown »

robot256 wrote:
Mon May 16, 2022 2:04 am
The assembler fluidbox API is a hot mess, so I'm not surprised it's not doing what you want. Assembler fluidboxes are assigned at runtime based on what recipe is selected. Each recipe can ignore, use, or merge the N different prototype fluidboxes to make M = (between 0 and N) dynamic fluidboxes. The fluidbox prototypes theoretically contain all the information you need, but requesting the prototypes for the dynamic fluidboxes doesn't give you the corresponding prototype fluidboxes. The indexes and index limits in the API are messed up.
This isn't about the fluidbox prototypes. This is about the fluids themselves. Edit: I didn't mean to sound rude. I can see why someone might be interested in the fluidboxes themselves, and think the subject was referring to them.
I have mods! I guess!
Link

Rseding91
Factorio Staff
Factorio Staff
Posts: 12231
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.59] Custom input's include_selected_prototype does not work on fluid slots in crafting machines

Post by Rseding91 »

Thanks for the report. This is due to the way these specific icons are created and handled in 1.1.x and older. This entire section of the GUI logic was re-written for the expansion so once it's released it will also be fixed in base game.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Fixed for 1.2”