How should we handle a story game?

One thing that you must do is make the story actually work in a story/horror game!
So I am wondering, whats the best way to handle all the events that happen and the dialogues, etc

Thanks!

2 Likes

I would use wait events to accurately time the whole dialogue or functions or use touched where you could set up an invisible barrier and if a few players touch it then a new dialogue pops up or a cutscene plays.

My approach? Create a table that contains events in sequential order. As long as you use numerical indices, your table is guaranteed to stay in order (traverse the table with ipairs, not pairs!). Because functions are first-class citizens in Lua, you can store them as table entries and call them as you iterate the master table to progress the game.

You could store functions in each entry that check for specific criteria to be met (or events to be fired), do specific things (like spawn NPCs or open doors) or create victory conditions.

4 Likes