[Tips]Updating mods to 0.16

Place to post guides, observations, things related to modding that are not mods themselves.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

[Tips]Updating mods to 0.16

Post 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).
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Lundis999
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Jul 03, 2016 5:26 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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",
	},
...
floodo1
Inserter
Inserter
Posts: 21
Joined: Tue Jun 28, 2016 2:33 am
Contact:

Re: [Tips]Updating mods to 0.16

Post by floodo1 »

The Modifier "num-quick-bars" became "quick-bar-count" (see my thread about current documentation inaccuracy)
mustapelto
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Jul 01, 2017 10:54 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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.
orzelek
Smart Inserter
Smart Inserter
Posts: 3924
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: [Tips]Updating mods to 0.16

Post 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.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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,
Sunnova
Fast Inserter
Fast Inserter
Posts: 169
Joined: Mon May 16, 2016 12:10 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post by Sunnova »

Looks like maximum_wire_distance is now capped at 64.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Sunnova
Fast Inserter
Fast Inserter
Posts: 169
Joined: Mon May 16, 2016 12:10 pm
Contact:

Re: [Tips]Updating mods to 0.16

Post 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. :)
Post Reply

Return to “Modding discussion”