Narramancer Scene
A Narramancer Scene component can be added to a scene to tell the Narramancer system key aspects about the given scene. Only one Narramancer Scene component at most should exist in a scene.
The three main parts of the Narramancer Scene are a list of Nouns, a list of Variables, and a list of ActionVerbs.
When the scene starts:
- The given Nouns will be created/initialized and added to the table.
- The Scene Variables will be assigned to their corresponding starting values.
- Any ActionVerbs in the list are run.
A Narramancer Scene component can be added to a GameObject OR a whole Narramancer Scene GameObject can be created using the create new GameObject context menu, found under Narramancer -> Narramancer Scene.
TextPrinter
A TextPrinter is a component that displays narrative text to the player, usually using a revealing animation. TextPrinters are required to use PrintTextNodes. A prefab for a ready-to-go TextPrinter GameObject is provided in the folder /Narramancer/Prefabs/.
ChoicePrinter
A ChoicePrinter is a component that displays choices as buttons to the player. A ChoicePrinter is required to use OfferChoicesNode. A prefab for a ready-to-go ChoicePrinter GameObject is provided in the folder /Narramancer/Prefabs/.
TextAndChoicePrinter
TextAndChoicePrinter combines the functionality of a TextPrinter and a ChoicePrinter into one interface, allowing text and choices to exist in the same ScrollView. A prefab for a ready-to-go TextAndChoicePrinter GameObject is provided in the folder /Narramancer/Prefabs/ and this is the one that is used in all Narramancer Example scenes.
SaveMenu
The SaveMenu component handles the menu and functionality that allows the player to save their game. A prefab for a ready-to-go SaveMenu GameObject is provided in the folder /Narramancer/Prefabs/ and this is the one that is used in all Narramancer Example scenes.
LoadMenu
The LoadMenu component handles the menu and functionality that allows the player to load a saved game. A prefab for a ready-to-go LoadMenu GameObject is provided in the folder /Narramancer/Prefabs/ and this is the one that is used in all Narramancer Example scenes.
SerializableSpawner
A SerializableSpawner is a component that spawns other GameObjects. The type of GameObject spawned is defined by a single predefined GameObject or Prefab. Various settings are provided for where the new spawned object is created. Spawners are required to use SpawnNodes and can also be used by CreateInstanceNode. GameObjects created and handled by SerializableSpawners will automatically be saved and recreated on load.
A SerializableSpawner component can be added to a GameObject OR a whole SerializableSpawner GameObject can be created using the create new GameObject context menu, found under Narramancer -> Serializable Spawner.
RunActionVerbMonoBehaviour
Use a RunActionVerbMonoBehaviour to run an ActionVerb on scene load (or triggered by other things such as UnityEvents). This component also allows for verb input values to be assigned using a list of assignments. Input values that are components or GameObjects can be assigned to in-scene objects.
To control when the ActionVerb runs, you can disable 'Run on Start' and call the public method RunVerb() on the component instead.
A RunActionVerbMonoBehaviour component can be added to a GameObject OR a whole RunActionVerbMonoBehaviour GameObject can be created using the create new GameObject context menu, found under Narramancer -> Run Action Verb.
SetGlobalVariablesMonoBehaviour
Use a SetGlobalVariablesMonoBehaviour to assign values to Global Variables on scene start (or triggered by other things such as UnityEvents). This is the only way to use in-scene components and GameObjects as values for Global Variables.
To control when the values are assigned, you can disable 'Run on Start' and call the public method ApplyValues() on the component instead.
A SetGlobalVariablesMonoBehaviour component can be added to a GameObject OR a whole SetGlobalVariablesMonoBehaviour GameObject can be created using the create new GameObject context menu, found under Narramancer -> Set Global Variables.
CreateNounForGameObject
Using a CreateNounForGameObject is one way of creating NounInstances within your game. This method is similar to defining a noun using NounScriptableObjects, but is preferred if your nouns are highly coupled to GameObjects. Creating a noun using this component automatically connects the new NounInstance with the attached GameObject, which will be saved and recreated on load.
SetEnabledFromProperty
The SetEnabledFromProperty is a simple way of activating or disabled a given GameObject based on if a given Noun currently has a given property.
NOTE that the target GameObject being enabled and disabled should NOT be the same one that has this component, as the update functionality will stop working when the GameObject first gets disabled.
SetSliderFromStat
The SetSliderFromStat is a simple way of reflecting a given Noun's stat value using a Unity.UI.Slider. The component can be attached to a Slider, and will continuously apply the current value of the noun's stat.