Story Manager - UQdeco2800/2021-studio-6 GitHub Wiki
Description
The story manager is a singleton component that loads, displays and shows StoryBase objects. Only one StoryBase object can be loaded in the story manager at a time. When a story has run its course, the StoryBase object should dispose of itself. Each story has an identification stored in the StoryNames enum that is used to trigger a particular story.
How to Use
To display and trigger a story, first load the story using the loadCutscene function and providing it with a StoryNames. Then display it using the display function. This is the minimum required interaction needed to play a story. The story manager will then pause the game then run the story loaded, and dispose of it when the story has been played. After the disposal the story manager will then return the previous pause state.
Typical Runtime of a Cut Scene
How to create a story
There are currently two types of stories which all inherit from StoryBase. They are:
- CutScene
- BasicDialogue
Each story should be initialised with the respective config abstract class (e.g. CutSceneConfig). For example, PrologueCutScene which contains the raw assets inherits CutSceneConfig which initialises those raw assets which is then finally converted into usable entities through the CutScene class.
CutScene
A cutscene displays a dialogue box, full sized image sequences and music.
BasicDialogue
A dialogue box (Exactly the same implementation as Sprint 1 dialogue box but hooked into the story manager system)
Creation of other story types
As long as the story UI in mind implements the StoryBase interface according to its javadoc, the story manager should be able to control it.