G
Guest
Guest
Archived from groups: rec.games.roguelike.development (More info?)
I've been toying around with Lua for a while now, and I currently have a
bit of a problem. The thing is, I'm not 100% sure what the best way to
use the scripting system is.
I considered using an event-based model, where scripts attached to
objects are run on specific events, such as onCollide, onUse, onDamaged,
etc. Then the script is run, and the corresponding event code is run.
However, this feels a bit limiting, and could require a lot of work if a
new event type needs to be added.
Then I considered running the entire game through scripting, with
speed-critical bits coded in C. I toyed around with this idea before,
and liked it, but I'm more than a little worried about speed issues,
especially if my game is realtime.
Lastly, I considered hardcoding game events, and just using scripts as
datafiles, which is, needless to say, handy, but a bit of a waste of
potential.
I feel like I'm missing something rather obvious, here. Any advice
would be appreciated. I'm very comfortable with Lua, and have no
problems using Lua's C API, but understanding the language isn't enough,
when I don't know what to *do* with it...
I've been toying around with Lua for a while now, and I currently have a
bit of a problem. The thing is, I'm not 100% sure what the best way to
use the scripting system is.
I considered using an event-based model, where scripts attached to
objects are run on specific events, such as onCollide, onUse, onDamaged,
etc. Then the script is run, and the corresponding event code is run.
However, this feels a bit limiting, and could require a lot of work if a
new event type needs to be added.
Then I considered running the entire game through scripting, with
speed-critical bits coded in C. I toyed around with this idea before,
and liked it, but I'm more than a little worried about speed issues,
especially if my game is realtime.
Lastly, I considered hardcoding game events, and just using scripts as
datafiles, which is, needless to say, handy, but a bit of a waste of
potential.
I feel like I'm missing something rather obvious, here. Any advice
would be appreciated. I'm very comfortable with Lua, and have no
problems using Lua's C API, but understanding the language isn't enough,
when I don't know what to *do* with it...