Page 1 of 1

[16.15] (Minor & API docs) Technology effect quick-bar-count

Posted: Sat Jan 06, 2018 4:08 pm
by Aidiakapi
The effect that increases the number of quick bars is called "quick-bar-count", as seen below:

Code: Select all

{
  type = "technology",
  name = "toolbelt",
  effects =
  {
    {
      type = "quick-bar-count",
      modifier = 1
    }
  },
  ...
},
The documentation states it's "quick-bars-count"

Minor typo probably.

Re: [16.15] (Minor & API docs) Technology effect quick-bar-count

Posted: Sat Jan 06, 2018 6:26 pm
by Rseding91
Thanks for the report. The prototype name and the Lua API name aren't the same thing.

The page you've linked is purely for the runtime control.lua API and isn't used at all in building prototypes.

Most of the time they'll have the same or very similar names - in this case they differ slightly. But changing it would break every single mod that uses it now so I don't consider it worth changing at this time. Maybe for 0.17.

Re: [16.15] (Minor & API docs) Technology effect quick-bar-count

Posted: Sat Jan 06, 2018 11:19 pm
by Aidiakapi
I initially implemented my code using the text it said in the docs "quick-bars-count", but this did not work, in figuring out why, I found it was actually called "quick-bar-count". Both LuaTechnology.effects and LuaTechnologyPrototype.effects (the only two that seem to use the Modifier concept) report it as "quick-bar-count" in-game. See dumps below:

Code: Select all

/c print('proto = ', serpent.block(game.technology_prototypes.toolbelt.effects), 'control = ', serpent.block(game.forces.player.technologies.toolbelt.effects))
proto =         {
  {
    modifier = 1,
    type = "quick-bar-count"
  }
}       control =       {
  {
    modifier = 1,
    type = "quick-bar-count"
  }
}
No mod using "quick-bars-count" would actually function, so I do think it's strictly a typo in the API docs.

Edit: In case I wasn't clear enough, I suggest not changing the game, rather to just remove the one letter from the docs, and save a future mod dev some time and frustration from the game and docs not matching up.

Re: [16.15] (Minor & API docs) Technology effect quick-bar-count

Posted: Sat Nov 03, 2018 3:36 pm
by Bilka
Thank you for the report, I fixed the doc for 0.17.