LUA

BlitzMax Forums/BlitzMax Programming/LUA

JoshK(Posted 2006) [#1]
-I only see a RunScriptFile() command for Lua. There must be a command to load a script and parse it so it can be run more quickly?

-Can BlitzMax pass type handles to and from Lua in a reasonably fast time?

-Can Lua script a complex program, or is it only for little discrete tasks?


Cajun17(Posted 2006) [#2]
Lua is plenty fast and powerful. You could write entire games/apps in Lua and use Blitz only for function calls for drawing, sound etc.


N(Posted 2006) [#3]
a) lua_dofile does that. It loads it into memory, parses it, and then executes it. I don't know of any scripting language that does this in another way.

b) Technically, no. Check this for an example of how to work around it in a moderately convenient manner. Specifically, use tables. If you just want to pass a pointer to a type or an integer handle, though, then that's simple as pie.. then again, I seem to fail at making pie quite frequently, so maybe that's a bad example.

c) Far Cry, Painkiller, Baldur's Gate, etc. are all scripted using Lua. It's proven that it's fast and efficient time and time again.

Edit: And I would highly avoid using Pub.LuaScript, but that's 'cause I prefer my own interface.


Sweenie(Posted 2006) [#4]
You can also precompile a script with luac to make it start a bit faster but executionspeed will remain same though.