Since I'm calling the script file once every AI update for the object and since I'm still reading the file from the disk you can actually edit the script file while the sample is running and watch the changes happen in real time.
While it is cool to see this kind of functionality obviously it's an ugly perf problem to be hitting the disk that often so my next step will be to add caching of the script file in memory. This will also allow me to load scripts from an archive file very easily. All in all very cool and potentially powerful stuff.
One of the interesting things I ran into with this sample was how ToLua handles inheritance. My engine is very OO heavy. Perhaps too heavy but that's another conversation. Drawing the textured quad on the screen uses the following class hierarchy:
Base::IGameObject - Base class for all in-game objects. Holds basic data.
Base::ITexturedQuad - Holds all non-platform specific data and methods.
Windows::CTexturedQuad - DirectX specific implementation of the TQ
In my first attempt at getting things working I tried to just register Windows::CTexturedQuad with Lua hoping things would just magically work. Of course they didn't. I could pass a pointer of that type to my script but I couldn't access any members of the base class.
At this point I was a little afraid that I'd have to pass in a pointer of each type to access all the members. As it worked out it wasn't nearly that bad. All I had to do was register the base classes with Lua and their members were magically exposed to my CTexturedQuad pointer.
None of this is rocket science or all that amazing outside of the fact that it just works so easily. The ToLua++/Lua combo is very nice for scripting. I highly recommend it for anyone looking for such a tech.