Page 1 of 1

Minor Lua API Documentation Error

Posted: Fri Apr 28, 2017 8:02 am
by chrisgbk
On http://lua-api.factorio.com/latest/Data-Lifecycle.html under "3. control.lua initialization" the "script" object is hotlinked to LuaGameScript, however "script" is actually an instance of LuaBootstrap, as "game" represents LuaGameScript.

Re: Minor Lua API Documentation Error

Posted: Fri Apr 28, 2017 2:10 pm
by I_IBlackI_I
http://lua-api.factorio.com/latest/
All of the API functionality is implemented via class members. To make any use of the API, therefore, you need to have access to instances of these classes. To facilitate that, three global objects are provided:

game :: LuaGameScript: This is the main object, through which most of the API is accessed. It is, however, not available inside handlers registered with LuaBootstrap::on_load.
script :: LuaBootstrap: Provides an interface for registering event handlers.
remote :: LuaRemote: Allows inter-mod communication by way of providing a repository of interfaces that is shared by all mods.
commands :: LuaCommandProcessor: Allows registering custom commands in the in-game console accessible via the ~ key.
I count 4 :-)

Re: Minor Lua API Documentation Error

Posted: Fri Apr 28, 2017 9:55 pm
by Supercheese
Should probably just change "three" to "the following".

Re: Minor Lua API Documentation Error

Posted: Fri Apr 28, 2017 10:16 pm
by Rseding91
Thanks for the report. I've fixed those sections for the next version of 0.15.