[Rseding91] [2.0.33] reading the effect_description (a LocalisedString) returns unexpected data

This subforum contains all the issues which we already resolved.
User avatar
Quezler
Fast Inserter
Fast Inserter
Posts: 144
Joined: Fri Mar 25, 2016 6:37 pm
Contact:

[Rseding91] [2.0.33] reading the effect_description (a LocalisedString) returns unexpected data

Post by Quezler »

In my latest mod i have added support to pass in some nothing modifiers in the data stage and parse what they mean in the control stage, but this seems to cause problems when using the {"", glue function, here is an example:

Code: Select all

table.insert(data.raw["technology"]["automation-science-pack"].effects, {
  type = "nothing",
  icon = "__core__/graphics/icons/any-quality.png",
  effect_description = {"foobar", {"", "foo", "bar"}}
})

Code: Select all

script.on_event(defines.events.on_player_created, function(event)
  local player = game.get_player(event.player_index) --[[@as LuaPlayer]]
  player.gui.screen.add{
    type = "label",
    name = "label",
    caption = {"foobar", {"", "foo", "bar"}},
  }
  log(serpent.block(player.gui.screen["label"].caption))
  log(serpent.block(prototypes.technology["automation-science-pack"].effects[2].effect_description))
end)

Code: Select all

  31.532 Script @__localised-string__/control.lua:8: {
  "foobar",
  {
    "",
    "foo",
    "bar"
  }
}
  31.532 Script @__localised-string__/control.lua:9: {
  "foobar",
  ""
}
Both effect_description on the nothing modifier and caption on the luagui are documented as LocalisedString, yet when given the same input data only the luagui returns the expected result (that being the full table used as the second argument), reading the effect description should return a nested {"", "foo", "bar"} instead of ""
Rseding91
Factorio Staff
Factorio Staff
Posts: 14982
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [2.0.33] reading the effect_description (a LocalisedString) returns unexpected data

Post by Rseding91 »

Thanks for the report. This is now fixed for the next release.
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”