Minor Lua API Documentation Error

This subforum contains all the issues which we already resolved.
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Minor Lua API Documentation Error

Post 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.

I_IBlackI_I
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Wed Feb 20, 2013 6:57 pm
Contact:

Re: Minor Lua API Documentation Error

Post 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 :-)


Rseding91
Factorio Staff
Factorio Staff
Posts: 14122
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Minor Lua API Documentation Error

Post by Rseding91 »

Thanks for the report. I've fixed those sections for the next version of 0.15.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Resolved Problems and Bugs”