In talking it over with Scat, we've come up with what I believe will be the most informative "format" for our individual LUA function articles - and before we begin, wanted to run it passed the team - and the community, who are the ones that will likely need this the most.
From the Main LUA Scripting Page, each supported LUA Function will have a link to it's own page where we will lay out the definition of the function, it's params, and example(s). Hopefully it'll look something like this:
Example: GetCurrentHP
Can you guys think of anything else we might need before we begin? Note that some other LUA Functions are far more complex, so give it some thought.
So far, this is our "template", if you want to copy/paste and change the values to a new article:
Code: Select all
== LUA Functions: GetCurrentHP(param) ==
Returns the current '''current hit points''' of ''param''. The parameter can be either a player or the NPC currently being interacted with.
[[Developer:LUA_Functions | Back to LUA Functions Index]]
=== Syntax ===
var = GetCurrentHP(param)
Must be a reference to a player or NPC.
=== Parameters ===
Required: ''param'' (int)
''param'' must be one of the vars in the function params. In the example above, it would be either "NPC" or "Spawn"
=== Usage ===
function hailed(NPC, Spawn)
Say(NPC, "Your current hit points are " .. GetCurrentHP(Spawn) .. "!")
end
This makes the NPC respond to the player who hails it with the players current hit points.
== Notes ==
(optional) Additional notes or special instructions
== Reference ==
(optional) Links to forum posts or other reference pertaining to this function
Note: If you indent 1 space, the text gets surrounded by a box - as in the example in Usage.
Note: I would always like to offer the "[[Developer:LUA_Functions | Back to LUA Functions Index]]" BACK option if possible... since the BACK button on browsers sometimes surprises us... :/