Tables from data.lua to control.lua
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Tables from data.lua to control.lua
Is there a way to keep the tables from the data---.lua stage, that they can be used in the Control.lua stage? In my Experiments i couldnt get it to work, but since my Knowledge of such Things (coding) is limited I thought I ask if I either do it wrong, or if there is no way.
Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"
Re: Tables from data.lua to control.lua
If you give an example of what you're tryign to accomplish, i may be able to help you there
- Arch666Angel
- Smart Inserter
- Posts: 1636
- Joined: Sun Oct 18, 2015 11:52 am
- Contact:
Re: Tables from data.lua to control.lua
So I have been told that people are lazy and don't want to unpack, edit config.lua's and repack mods files to change setting. Since the game is lacking an interface to edit edit from inside the game/mods menu the simplest way I could think of was another "trigger" mod which only does enable/disable certain options of the main mod:
[quote=""trigger mod" data.lua"]
if not exoticdancers then exoticdancers = {} end
exoticdancers.over18modetrigger = true
[/quote]
[quote=""main mod" data.lua"]...
require("config")
if exoticdancers.over18modetrigger then
exoticdancers.over18mode = false
end
...
[/quote]
Then I wanted to do the same thing with a mod, that only has things happening in the control.lua and it wont work. As far as I understand the whole thing the control.lua is executed independently from the data.luas and does not have access to tables from other mods data.luas?
I new to coding and lua, so forgive my newb questions
[quote=""trigger mod" data.lua"]
if not exoticdancers then exoticdancers = {} end
exoticdancers.over18modetrigger = true
[/quote]
[quote=""main mod" data.lua"]...
require("config")
if exoticdancers.over18modetrigger then
exoticdancers.over18mode = false
end
...
[/quote]
Then I wanted to do the same thing with a mod, that only has things happening in the control.lua and it wont work. As far as I understand the whole thing the control.lua is executed independently from the data.luas and does not have access to tables from other mods data.luas?
I new to coding and lua, so forgive my newb questions

Angels Mods
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"
I. Angel's Mods Subforum
II. Development and Discussion
III. Bugs & FAQ

"should be fixed"