With 0.18.2, they added damaged_trigger_effect = hit_effects.entity()
to "C:\Program Files (x86)\Steam\steamapps\common\Factorio\data\base\prototypes\entity\demo-turrets.lua"
Well, I have a Gun turret mod that won't load now.
The mod has a control.lua that has these 2 lines:
local hit_effects = require ("prototypes.entity.demo-hit-effects")
local sounds = require("prototypes.entity.demo-sounds")
However, they don't seem to be working.
Is that control.lua file not pulling in the locals correctly?
attempt to index global 'sounds' (a nil value)
Re: attempt to index global 'sounds' (a nil value)
I changed this: local hit_effects = require ("prototypes.entity.demo-hit-effects")
to this: local hit_effects = game.prototype_entity["demo-hit-effects"]
and this: local sounds = require ("prototypes.entity.demo-sounds")
to this: local sounds = game.prototype_entity["demo-sounds"]
Still no go
to this: local hit_effects = game.prototype_entity["demo-hit-effects"]
and this: local sounds = require ("prototypes.entity.demo-sounds")
to this: local sounds = game.prototype_entity["demo-sounds"]
Still no go
Re: attempt to index global 'sounds' (a nil value)
I think you're trying to reference the base mod's sound files, correct? If so, don't you have to point it at base? Without that, it's looking in your mod for a demo-sounds file.
From the breaking change thread:
This worked for me, but my mod was referencing sounds in the data stage.
From the breaking change thread:
Code: Select all
local sounds = require("__base__.prototypes.entity.demo-sounds")
Re: attempt to index global 'sounds' (a nil value)
Well, that was it. Thank you!
Using "__base__." was what I needed.
Oh, I also took it out of the control.lua file and put it in the data.lua:
Using "__base__." was what I needed.
Oh, I also took it out of the control.lua file and put it in the data.lua:
Code: Select all
local sounds = require("__base__.prototypes.entity.demo-sounds")
local hit_effects = require ("__base__.prototypes.entity.demo-hit-effects")
data:extend({
{
type = "ammo-turret",
name = "gun-turret",