I'm attempting to write a widget for profiling and controlling your metal maker economy. Basically, it would let you quickly select your hover target, it would let you force on or force off all of your makers at once, and it would tell you roughly how much energy and metal your metal makers are dealing with. Later on I might build my own backend and start adding features (for example, taking allies' energy donations into account, or giving your excess energy to stalled allies rather than feeding it into inefficient metal makers).
For now, though, my intended implementation involves hooking into TheFatController's Improved MetalMakers widget. It sounds like it should be possible to get to its global control variables from my own widget, but I'm having trouble doing so. The variables in question are defined like this, in unit_improved_metal_maker.lua:
Code: Select all
-- global vars (so other widget (i.e. guis) can interact with the widget)
mmw_update = 1.25 -- Seconds per update, do not set this too low
mmw_etargetPercent = 0.5 -- Percent of energy bar to aim for
mmw_estallPercent = 0.3 -- Percent of "mmw_etargetPercent", when energy stalling begins (30% of 50% -> 15%)
mmw_forceStall = false
I've tried a few things, mostly variations on the following (as well as a few wild attempts that I came across in the forums or in other widgets, all of which turned out to only work on things defined in luarules):
Code: Select all
local temp = mmw_update
local temp = _G.mmw_update
local temp = _G["mmw_update"]
Everything I do either results in temp == nil or a null pointer exception on _G. I've never done any Lua development, so I feel like I'm missing something really, really obvious. Any tips?