Question about Lua implementation

Infinite Ores, Refining, Ore Processing ...

Moderator: Arch666Angel

Post Reply
salbris
Inserter
Inserter
Posts: 43
Joined: Sun May 24, 2015 4:50 am
Contact:

Question about Lua implementation

Post by salbris »

Hey!

I'm working on fixing up Foreman so that it works correctly for Bobs/Angels.

Foreman: https://github.com/Rybadour/Foreman

I ran into an error coming out of various Angel's mods:

Code: Select all

C:\Users\Ryan\AppData\Local\Temp\angelsrefining_0.11.10\angelsrefining_0.11.10\data.lua (...p\angelsrefining_0.11.10\angelsrefining_0.11.10\data.lua:21: attempt to index global 'mods' (a nil value))
C:\Users\Ryan\AppData\Local\Temp\angelspetrochem_0.9.8\angelspetrochem_0.9.8\data.lua (...emp\angelspetrochem_0.9.8\angelspetrochem_0.9.8\data.lua:17: attempt to index global 'mods' (a nil value))
C:\Users\Ryan\AppData\Local\Temp\angelssmelting_0.6.6\angelssmelting_0.6.6\data.lua (...\Temp\angelssmelting_0.6.6\angelssmelting_0.6.6\data.lua:50: attempt to index global 'mods' (a nil value))
I don't see this global "mods" dictionary specified by Factorio mod API: https://lua-api.factorio.com/latest/index.html

Just curious what this is and how I should implement it. Should I fill a dictionary called "mods" with all the "enabled" mods. Is this something standard in Factorio or something specific to Bobs?

Bilka
Factorio Staff
Factorio Staff
Posts: 3129
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Question about Lua implementation

Post by Bilka »

The "mods" table is explained here: https://lua-api.factorio.com/latest/Data-Lifecycle.html

TL;DR: It is a map of mod name to mod version (as a string) for all enabled mods. It is present in the data and settings stage for all mods.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

salbris
Inserter
Inserter
Posts: 43
Joined: Sun May 24, 2015 4:50 am
Contact:

Re: Question about Lua implementation

Post by salbris »

Excellent thanks! I'll incorporate it into Foreman!

Btw, do ya'll have any plans to make all this easier for tool developers? Or is there an open ticket?

It's not ideal that we have to re-implement a big chunk of how mods are interpreted in Factorio. If ya'll had a standalone application that could parse mod data and provide item and recipe information that would save us a ton of headache.

Post Reply

Return to “Angels Mods”