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 separate levels.
Should I somehow define these events in an external source, like XML? Then write an interpreter 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 two 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.
Thanks!
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 like to display a cutscene somewhere in between. Modyfing the entire game structure to pass in an altered battle class with the cutscene included seems very inefficient. I'm wondering how is this usually done.