whoward69
DLL Minion
(Yet another) BNW Lua API Reference
Q1) So how is this one different?
A1) The others are either based on the out-of-date reference originally provided in the SDK, or by trawling the Lua game code. This one has been compiled by parsing the C++ code that forms the Lua API.
Q2) So it's 100% accurate?
A2) No - the process is mostly automated, but still requires some human intervention, so it can never be guaranteed to be 100% accurate.
Q3) So what's the advantage?
A3) It's in XML, so with a few well-crafted XSL transforms you can have it in any format you want, eg the attached spreadsheet. And it's searchable.
Q4) Will you be doing the same for G&K and vanilla?
A4) No - the process is just too boring. BNW is regularly on sale ... go and buy it!
Q5) Will you be adding your DLL additions?
A5) Possibly
Q6) What if I find an error?
A6) Fork the repository, make the change to the required LuaXyz.xml file and push it
Q7) What if the error is in the spreadsheet?
A7) The spreadsheet was generated from the xml (the primary data source), so change the xml (see Q6), and then regenerate the spreadsheet
Q8) Will you be adding links to the game core Lua files where the methods are used?
A8) No - that's what powerful search tools like Agent Ransack are for!
The attached zip contains a MS-Excel spreadsheet with one tab per object.
The extracted xml and processing code is on GitHub
Object Methods
Area 25
City 367
Deal 55
Fractal 4
Game 262
League 52
Map 36
Player 787
Plot 190
Team 41
TeamTech 18
Unit 373
Each tab contains one row per method, formatted as follows
Column Description
A The name of the method as exposed via C++ to Lua
B A sanity check! A should be the same as C.substring(1)
C The name of the method as extracted from the XML, prefixed with the access operator (dot or colon)
D The return value of the method, see post #2 below
E The first parameter (if any) of the method, see below
F onwards Second, third, etc parameters of the method
Required parameters are formatted as
and optional parameters as
Types that look like XyzTypes (eg PlayerTypes, BeliefTypes, TeamTypes, etc) are references to C++ enums - they can be treated as integers
Entries highlighted in red are known to be buggy (or just not implemented!)
Enjoy
W
Q1) So how is this one different?
A1) The others are either based on the out-of-date reference originally provided in the SDK, or by trawling the Lua game code. This one has been compiled by parsing the C++ code that forms the Lua API.
Q2) So it's 100% accurate?
A2) No - the process is mostly automated, but still requires some human intervention, so it can never be guaranteed to be 100% accurate.
Q3) So what's the advantage?
A3) It's in XML, so with a few well-crafted XSL transforms you can have it in any format you want, eg the attached spreadsheet. And it's searchable.
Q4) Will you be doing the same for G&K and vanilla?
A4) No - the process is just too boring. BNW is regularly on sale ... go and buy it!
Q5) Will you be adding your DLL additions?
A5) Possibly
Q6) What if I find an error?
A6) Fork the repository, make the change to the required LuaXyz.xml file and push it
Q7) What if the error is in the spreadsheet?
A7) The spreadsheet was generated from the xml (the primary data source), so change the xml (see Q6), and then regenerate the spreadsheet
Q8) Will you be adding links to the game core Lua files where the methods are used?
A8) No - that's what powerful search tools like Agent Ransack are for!
The attached zip contains a MS-Excel spreadsheet with one tab per object.
The extracted xml and processing code is on GitHub
Area 25
City 367
Deal 55
Fractal 4
Game 262
League 52
Map 36
Player 787
Plot 190
Team 41
TeamTech 18
Unit 373
Each tab contains one row per method, formatted as follows
A The name of the method as exposed via C++ to Lua
B A sanity check! A should be the same as C.substring(1)
C The name of the method as extracted from the XML, prefixed with the access operator (dot or colon)
D The return value of the method, see post #2 below
E The first parameter (if any) of the method, see below
F onwards Second, third, etc parameters of the method
Required parameters are formatted as
Code:
type:name
Code:
[type:name:default]
Types that look like XyzTypes (eg PlayerTypes, BeliefTypes, TeamTypes, etc) are references to C++ enums - they can be treated as integers
Entries highlighted in red are known to be buggy (or just not implemented!)
Enjoy
W