You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While an edge case, providing a lua script with no widget:GetInfo() allows for modifying game behaviour in a predictable way; files without a widget:GetInfo() are executed and can modify the LuaUI environment, though they cannot be disabled; this throws a misleading Failed to load XXX.lua message when in fact the file has indeed been executed.
No game-supplied widgets make use of this loophole to modify game state, although a few display it by gating their code (including widget:GetInfo()) behind some check, e.g. for a mod option. Such files are shown below:
[t=00:04:44.049029][f=-000001] Failed to load: __defs_write.lua (no GetInfo() call)
[t=00:04:44.388663][f=-000001] Failed to load: gui_unit_market.lua (no GetInfo() call)
[t=00:04:44.347048][f=-000001] Failed to load: gui_scavenger_info.lua (no GetInfo() call)
[t=00:04:44.060007][f=-000001] Failed to load: autocheat.lua (no GetInfo() call)
I use this to modify the widget environment (e.g. extending table, string etc) before any widget:Initialize() is run (arguably a less than ideal solution), and the successful operation of such files highlights the misleading nature of calling file loading a failure.
The text was updated successfully, but these errors were encountered:
What kind of solution would you recommend for this? Is the issue more that the log message doesn't communicate clearly, or that it's possible for widgets to run code before being officially "loaded"? The log message seems easy to change; widgets being able to modify the environment sounds very tricky to change.
While an edge case, providing a lua script with no
widget:GetInfo()
allows for modifying game behaviour in a predictable way; files without awidget:GetInfo()
are executed and can modify the LuaUI environment, though they cannot be disabled; this throws a misleadingFailed to load XXX.lua
message when in fact the file has indeed been executed.No game-supplied widgets make use of this loophole to modify game state, although a few display it by gating their code (including
widget:GetInfo()
) behind some check, e.g. for a mod option. Such files are shown below:I use this to modify the widget environment (e.g. extending
table
,string
etc) before anywidget:Initialize()
is run (arguably a less than ideal solution), and the successful operation of such files highlights the misleading nature of calling file loading a failure.The text was updated successfully, but these errors were encountered: