Changing specific filepaths for sprites.

Place to get help with not working mods / modding interface.
Toodths
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue May 19, 2020 11:49 am
Contact:

Changing specific filepaths for sprites.

Post by Toodths »

So im pretty new to modding factorio and i wanted to implement a really basic line in data.lua that just changes the base sprite of the small electric pole.
After some research i found the image filepath was defined as the first index in layers under the property filename and so wrote this code.

Code: Select all

data.raw["electric-pole"]["small-electric-pole"]["pictures"].layers[0].filename = "$FILEPATH"
This gives the error "attempt to index field '?' (a nil value)" which im assuming is saying that the 'layers' field doesnt exist.
Is this just me being bad a lua or misunderstanding how factorio handles its data.
Because i dont want have to redefine the entire layers field from scratch but with different filepaths which i know works but is really tedious.
Any help is appreciated!
Post Reply

Return to “Modding help”