Thanks for all the opinions. My first instinct leads me towards ImaginaryHuman's "trigger" approach. I like that. The cutscene script is run in its entirety when the cutscene begins and each command creates an event in the event list ( a stack would make sense.) Then I have a cutscene manager object which monitors the event list looking for events whose time has come. When an event's time comes, the manager pops it off the stack, triggers the event and continues waiting for the next one. This would enable me to sequence events quite naturally, and seems like it would be pretty flexible.
My Lua VM already has access to all the game objects ( actors, entities, etc ) so I can still use those, but I'll need to add new functions for all the cutscene commands as they'll all need to take a trigger time as their first parameter. Or maybe I'll just rewrite the existing commands to take a trigger time which defaults to 0 ( immediately. )
That seems pretty logical to me, and I think I could get used to writing scripts for that, so I'll code that up this afternoon and see how it looks and feels.
Thanks again everyone.
My Lua VM already has access to all the game objects ( actors, entities, etc ) so I can still use those, but I'll need to add new functions for all the cutscene commands as they'll all need to take a trigger time as their first parameter. Or maybe I'll just rewrite the existing commands to take a trigger time which defaults to 0 ( immediately. )
That seems pretty logical to me, and I think I could get used to writing scripts for that, so I'll code that up this afternoon and see how it looks and feels.
Thanks again everyone.