How to Access data.raw from control.Lua?
Posted: Tue May 16, 2017 6:27 pm
I realised data.lua is loaded before settings.lua so instead is there a way to modify data from control.lua? I've tried but get a nil value error on "data" in eg "data.raw.ammo"
As an example here is some code that doesn't work.
As an example here is some code that doesn't work.
Code: Select all
for i, ammo in pairs(data.raw.ammo) do
ammo.magazine_size = settings.global["magazine_size"].value
end