Trivial smoke not working in 0.18

Place to get help with not working mods / modding interface.
Post Reply
User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Trivial smoke not working in 0.18

Post by IngoKnieto »

Hi fellow modders,

I am having problems updating a mod from 0.17 to 0.18. I used to define the smoke of burners like this:

Code: Select all

data:extend({
  trivial_smoke{name = "red_smoke", color = {r = 0.8, g = 0.1, b = 0.1, a = 0.3}, start_scale = 0.8, fade_in_duration = 30 },
  trivial_smoke{name = "blue_smoke", color = {r = 0.1, g = 0.1, b = 0.8, a = 0.3}, start_scale = 0.8, fade_in_duration = 30 },
  trivial_smoke{name = "light_blue_smoke", color = {r = 0.2, g = 0.8, b = 0.8, a = 0.3}, start_scale = 0.8, fade_in_duration = 30 },
  trivial_smoke{name = "pink_smoke", color = {r = 0.8, g = 0.1, b = 0.8, a = 0.3}, start_scale = 0.8, fade_in_duration = 30 },
})
And then I used it it different burners:

Code: Select all

  {
    type = "burner",
    [more values]
    smoke =
    {
	  {
		name = "blue_smoke",
		frequency = 10, --  thickness
                position = {0.0, -0.25},
	  }
    }
  },
This does not work anymore, the game now says on all the 4 trivial_smoke lines:
"attempt to call global 'trivial_smoke' (a nil value)"

I'm pretty sure this stopped working with 0.18, but I can't find anything regarding trivial smoke in the changelog. Can anybody help me?

User avatar
IngoKnieto
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Oct 03, 2016 9:29 am
Contact:

Re: Trivial smoke not working in 0.18

Post by IngoKnieto »

Solved thanks to RustyBlade64 help on Discord.

Apparently the trivial_smoke function was changed from global to local, so you can't use it anymore:
https://github.com/wube/factorio-data/b ... s.lua#L539
https://github.com/wube/factorio-data/b ... ke.lua#L16

This is how I am doing it now:

Code: Select all

local util = require("util")

local red_smoke = util.table.deepcopy(data.raw["trivial-smoke"].smoke)
red_smoke.name = "red_smoke"
red_smoke.color = {r = 0.8, g = 0.1, b = 0.1, a = 0.3}
red_smoke.start_scale = 0.8
red_smoke.fade_in_duration = 30
red_smoke.fade_away_duration  = 0

data:extend({
red_smoke
})

Post Reply

Return to “Modding help”