[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: single state vs. multiple
- From: "Fabian Lemke" <lemkef@...>
- Date: Sun, 7 Oct 2001 12:45:25 -0500
I read a few of the discussions in the past few
months regarding this issue. I'm working on a 3d
engine with Lua as the scripting interface. Tolua
is being used to make the interface straight-forward.
Everything is working wonderfuly so far, but I have it
arranged as multiple states.
As I keep adding things, I now see that's a very bad
idea for the current design.. :) I have a very large
amount of game logic implemented in Lua (both because
it's quicker to implement then inside the engine, and
MUCH more flexible).
My problem is that I would rather have separete files
for each object, to provide a more component-approach in
design (instead of one big file). So far this looks
like it will work, but I'm confused as to if the debug
errors will come out right. If possible I'd like to use
the same state, but still use line numbers and file names
for error reporting. If this isn't possible, I guess I'll
have to settle with it. Any thoughts?
oh, one other quick question, is it possible to pass a function
as a parameter to another function? I havn't figured out how
to do this. I want to do a call-back type setup:
---
function moveCallback( object )
...
end
...
AddAutomation( object, MOVETO, {x=1, y=1}, moveCallback)
---
thanks!,
Fabian
(p.s. special thanks to the creators of Lua - it's by
far the best embedding scripting language I've found)