Lua is a programming language that is very suited for plug-in programming in games. Lua source files are compiled by the game or a lua compiler and then used by the game to perform campaign scripting, AI scripting, etc.
The compiled Lua files, however, are of a slightly different format than standard Lua files.
This format is used in the games Empire at War and Forces of Corruption.
Each Petroglyph Lua object file is basically a normal Lua 5.0 object file except for three differences:
The additional integer seems to start at 1 for the first function in the file, and then increases by one for every other function, disregarding function nesting. This integer is supposedly used to allow for persistent Lua state during save-games.
This format is used in the game Universe at War.
Each Petroglyph Lua object file is basically a normal Lua 5.1 object file except for two differences:
To allow Petroglyph's Lua object files to be handled by any existing Lua 5 object file program, I've written lupcvt, a small program that can convert Petroglyph's Lua object files to normal Lua 5 object files and back.