[Resource] Lua 4 scripting manual

I’ve found this to be an invalubale resource over the years. It’s the official reference manual for Lua 4. Pretty much everything in it is available to HW2 scripting, though some parts are disabled in some contexts.


The biggest gotchas that you might miss if you’re coming from any other programming experience:

  • Arrays are 1-indexed, not 0-indexed.
  • Arrays are tables, and if you itterate over an array you have to remeber to handle the 'n' value that contains the size of the array.
  • true and false [b][u]are not[/u][/b] keywords, and if you try to use them as such you will have headaches. Compare all boolean returning engine functions to 1 or 0, not true or false.