a) It actually is a table, just with special variables. As it is, I've got a basic 'hook' thing set up, meaning that it's a matter of two C++ function calls to add in a hook. Hooks can be added anywhere one wants, be it ships.tbl or scripting.tbl. I just have everything in scripting.tbl because it's faster & easier to test stuff on the main screen than to load a mission and wait for a ship to warp in or out.
b) Done, this was something half-bugging me during documentation anyways. Next CVS build (scripting is fixed in it, btw) you'll be able to do something like this:
#State Hooks
$State: GS_STATE_MAIN_MENU
$Hook: [[mainhall.lua]]
+Override: YES
#End
Where mainhall.lua is a scripting file with the luascript. If you feel inclined you can compile it
by running luac on it, this should help load times for extremely long scripts.
SEXP/Scripting integration is an interesting situation. The easiest way is probably making two SEXPs, script-eval-number and script-eval-string, which return a number and string respectively. This probably won't be so bad, since I can hide the "return" part so you'd just have to write in "Ship.Species.Name" or whatnot.
It's easy enough to deal with variables from scripting, but what I'd like to do is have it be possible with an array. IE:
mn.Variables["High scorer"] = high_scorer_ship.Name
would set the SEXP variable "High scorer". Unfortunately I'm having some problems with Lua behaving properly when I try to do something like that.
gr.drawText will be gr.drawString in the next CVS build