I'm working on a game where some in-game events need to happen once in a while. A nice example would be a tutorial. You start the game, and at several points in the game an event occurs:
- You encounter your first enemy, the game pauses and you receive an explanation on how to kill it
- You killed the first enemy, you receive a "good job" message
- You gain a new item, a menu with the items stats popup
- etc etc
The game I'm working on is a puzzle game where the rules in the game are pretty much all the same, so it seems inefficient to hardcode all these events in seperate levels.
Should I somehow define these events in an external source, like xml? Then write an intrepeter that reads out the xml and sets the events requirements for the level. I'm not sure how I could define an event that should occur when you killed 2 enemies for example.
Just to be clear, i'm not looking for the best programming language or scripting language to do this, but more at the best method to handle this.
Edit: A second example since my question was pretty hard to understand:
The problem I'm having is to put some extra actions in the game in a procedure that is always pretty much the same. Like an RPG battle, everyone has a turn, picks a skill etc - it's always the same. But what if there was a case where I would to display a cut-scene somewhere in between. Modyfing the entire game structure to pass in an altered battle class with the cutsene included seems very inefficient. I'm wondering how this is usually done?