Page 1 of 1

[Tips]Updating mods to 0.16

Posted: Wed Dec 13, 2017 5:00 pm
by Bilka
Just some observations I made about what I had to change to make my own mods work in 0.16, mostly things that aren't directly noted in the changelog.
Gui
Note: I'm using the mod gui as the root objects for my gui.

Using styles defined in data phase
All base game styles e.g. "caption_label_style" have been renamed to remove the "_style" suffix, so e.g. "caption_label_style" is now simply "caption_label". Can usually also be searched + replaced, the game will tell you which style it can't find.
Items/Entities etc
Icon_size
Icon_size is now a required property of any prototype that has icon/icons defined, the icons no longer have a default size. Here are the old icon size defaults which can be used as a reference to add the icon_size:
32x32px for entity, fluid, item, item-group, recipe, technology, virtual-signal
128x128px for achievement, tutorial
If icon path references base mod, technology icon was expected to be 128x128px and item-group icon 64x64px.
LuaEntity::action = {type = "area", ...}
Instead of "perimeter", "radius" has to be used
The base game tiles have been renamed
"grass"->"grass-1"
"grass-medium"->"grass-3"
"grass-dry"->"grass-2"
"dirt"->"dirt-3"
"dirt-dark"->"dirt-6"
"sand"->"sand-1"
"sand-dark"->"sand-3"
Events
Reminder that on_preplayer_mined_item was renamed to on_pre_player_mined_item and that on_player_changed_position exists now (and a lot more events).

Re: [Tips]Updating mods to 0.16

Posted: Wed Dec 13, 2017 5:26 pm
by Lundis999
Some additional things (I'll edit this post when/if I find more...)

You now need to declare a category for autoplace-controls:

Code: Select all

data:extend{
  	{
  type = "autoplace-control",
  name = "omnite",
  richness = true,
  order = "b-e",
  category = "resource",
	},
...

Re: [Tips]Updating mods to 0.16

Posted: Thu Dec 14, 2017 12:58 am
by floodo1
The Modifier "num-quick-bars" became "quick-bar-count" (see my thread about current documentation inaccuracy)

Re: [Tips]Updating mods to 0.16

Posted: Thu Dec 14, 2017 1:28 pm
by mustapelto
The global functions get_circuit_connector_sprites and get_circuit_connector_wire_shifting_for_connector have been removed. Instead, you now have to add to circuit_connector_definitions and then read from there. Example:

Code: Select all

circuit_connector_definitions["foobar"] = circuit_connector_definitions.create
(
  universal_connector_template,
  {
    { variation = 18, main_offset = {4/32, 21/32}, shadow_offset = {4/32, 21/32}, show_shadow = true },
  }
)
which you can then access in the entity definition by adding e.g.

Code: Select all

circuit_connector_sprites = circuit_connector_definitions["foobar"].sprites

Re: [Tips]Updating mods to 0.16

Posted: Sat Dec 16, 2017 12:20 pm
by darkfrei
circuit_wire_connection_points: get_circuit_connector_wire_shifting_for_connector({0.15625, -1.0625}, {0.15625, -1.0625}, 2) don't works anymore.

Re: [Tips]Updating mods to 0.16

Posted: Sat Dec 16, 2017 12:39 pm
by orzelek
Since they changed base game handling for wires you need this at start of file:

Code: Select all

require ('circuit-connector-generated-definitions")
And then you need to use it in same way that base game does:

Code: Select all

    circuit_wire_connection_point = circuit_connector_definitions["chest"].points,
    circuit_connector_sprites = circuit_connector_definitions["chest"].sprites, 
This is from chest - you need to look at base game entities to look for others.

If you have a custom entity then further analysis of how those are generated in the lua file will be needed to generate your own set of connectors.

Re: [Tips]Updating mods to 0.16

Posted: Sat Dec 16, 2017 1:31 pm
by darkfrei
orzelek wrote:Since they changed base game handling for wires you need this at start of file:

Code: Select all

require ('circuit-connector-generated-definitions")
My entity ix 2x2 and so it works:

Code: Select all

circuit_wire_connection_points = data.raw["mining-drill"]["burner-mining-drill"].circuit_wire_connection_points,
circuit_connector_sprites = data.raw["mining-drill"]["burner-mining-drill"].circuit_connector_sprites,

Re: [Tips]Updating mods to 0.16

Posted: Sun Dec 17, 2017 12:18 am
by Sunnova
Looks like maximum_wire_distance is now capped at 64.

Re: [Tips]Updating mods to 0.16

Posted: Mon Dec 18, 2017 9:21 am
by bobingabout
for GUI tables, colspan was changed to.... column_width I think. column_count? I've forgotten, I'd have to look it up.

If you just set the inserters mod to run on 0.16, it complains about the tag being missing.

Re: [Tips]Updating mods to 0.16

Posted: Mon Dec 18, 2017 4:29 pm
by Sunnova
bobingabout wrote:for GUI tables, colspan was changed to.... column_width I think. column_count? I've forgotten, I'd have to look it up.

If you just set the inserters mod to run on 0.16, it complains about the tag being missing.
column_count is correct. :)