I'm making a global variable viewer.
And it now have tree structure gui and can dig inside infinitely through tables and luaobjects having table-like properties.
And added a function to open directory of default global luaobjects too.
I'm using .help() method to get available property names for objects.
But not all objects are providing that. https://lua-api.factorio.com/latest/Common.html Yes, this link says, "not all".
I think there is no way to get property or function name programmatically.
Such as :
LuaBootstrap, LuaRemote, LuaCommandProcessor, LuaSettings, LuaRCON, LuaRendering
and
objects listed https://lua-api.factorio.com/latest/Concepts.html here
I can parse html contents by hand and put in my code, but it's not cool.
Can you give .help() method to all objects?
Can you give .help() to all LuaObjects?
Can you give .help() to all LuaObjects?
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
Re: Can you give .help() to all LuaObjects?
.help() already works on all of LuaBootstrap, LuaRemote, LuaCommandProcessor, LuaSettings, LuaRCON, LuaRendering. Everything listed in https://lua-api.factorio.com/latest/Concepts.html is just basic tables; just iterate them to see what properties they have.
If you want to get ahold of me I'm almost always on Discord.
Re: Can you give .help() to all LuaObjects?
Are you sure?
Try this on base 1.0
Code: Select all
/c local a={game,script,remote,commands,settings,rcon,rendering} local fail={} for _,v in pairs(a) do local b,c=pcall(function() local d=v.help() end) if not b then table.insert(fail,', '..v.object_name) end end game.print(" following objects don't have help() !!! "..table.concat(fail))
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
Re: Can you give .help() to all LuaObjects?
And iterating the object in concepts such asRseding91 wrote: ↑Thu Sep 03, 2020 3:58 pm Everything listed in https://lua-api.factorio.com/latest/Concepts.html is just basic tables; just iterate them to see what properties they have.
Code: Select all
/c for k,v in pairs(game.map_settings) do game.print(k) end
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
Re: Can you give .help() to all LuaObjects?
My mistake, they have the functions internally but don't expose them.
Also the one example you listed out of all the things in concepts not working is a LuaObject and has .help().
Also the one example you listed out of all the things in concepts not working is a LuaObject and has .help().
If you want to get ahold of me I'm almost always on Discord.
Re: Can you give .help() to all LuaObjects?
Also also, I don't get the point of wanting a .help() function when https://lua-api.factorio.com/latest/ exists and is far more detailed. You can't just arbitrarily access properties on objects without them being valid to call on that object so seeing a big list of things on something is kind of pointless.
If you want to get ahold of me I'm almost always on Discord.
Re: Can you give .help() to all LuaObjects?
Nope. I can't access help function. May be in your source code, help is alive but something is overrided it.
Code: Select all
LuaMapSettings: unknown path help
stack traceback:
(command):1: in function <(command):1>
[C]: in function 'pcall'
(command):1: in main chunk
English is not my native language. Sorry for bad English.
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)
My mods :
Lua API global Variable Viewer (mod portal)
Lua API Event Trace (mod portal)
My tools :
Locale String Editor (github.io webapp)