API documentation
Max
Technical Director, Unknown Worlds Entertainment Join Date: 2002-03-15 Member: 318Super Administrators, Retired Developer, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, Subnautica Developer, Pistachionauts, Future Perfect Developer
in Modding
In Build 246 we silently included "documentation" on the entire API that is exposed to Lua by the game engine. You can find this under the Natural Selection 2/docs/api folder in Steam. I put documentation in quotes because this is just a list of all of the classes, functions and parameters -- it doesn't include any explanation on what the functions do yet. Even though it's limited, I think this is a important first step.
I contemplated generating nicely formatted HTML files from this information, but I concluded that the people in the community would probably do a much better job than I would, so instead I exported the data as machine friendly JSON. These JSON files are automatically generated by our build process so they will always be up-to-date. My plan is to start including descriptions of the functions in the JSON data, but this will take some time for us to flesh out.
I look forward to seeing what you can do with this data!
I contemplated generating nicely formatted HTML files from this information, but I concluded that the people in the community would probably do a much better job than I would, so instead I exported the data as machine friendly JSON. These JSON files are automatically generated by our build process so they will always be up-to-date. My plan is to start including descriptions of the functions in the JSON data, but this will take some time for us to flesh out.
I look forward to seeing what you can do with this data!
Comments
(something like http://docs.sourcemod.net/api/ for sourcemod )
It is really appreciated (at least; from me) when you can just check someone's code and get to know what function do what without searching local files (useful when on someone else computer without NS2, so you can take some of your free time to check code, and wonder which function does what).
Red
What is a 'class' anyways? It seems that this is not part of the lua language. So where and how is "class 'Alien' (Player)" interpreted?
My current understanding is that it copies all parts of the "Player" table to a new "Alien" table, when the .lua file is parsed.