Skip to content

Components

These are the components you place in a scene. Five of them can be created as ready-made GameObjects from GameObject → Narramancer: Narramancer Scene, Run Action Verb, Set Global Variables, Serializable Spawner and Create Noun For GameObject.

A Narramancer Scene component tells Narramancer about the scene it is in. Use at most one per scene. It holds a list of nouns, a list of scene variables, and a list of ActionVerbs. When the scene starts:

  • the nouns are created and added to the table,
  • the scene variables are given their starting values,
  • the ActionVerbs in Run on Start Verbs start running.

Add it to any GameObject, or create one from GameObject → Narramancer → Narramancer Scene.

Runs an ActionVerb when the scene starts, or when something else triggers it, such as a UnityEvent. You can assign the verb’s inputs from a list of assignments, including objects in the scene.

To control when the verb runs, turn off Run on Start and call RunVerb() on the component instead. After changing the verb’s inputs, press Update Assignments to sync the list. Values assigned to a renamed input are kept, as long as its type is unchanged.

Create one from GameObject → Narramancer → Run Action Verb.

Assigns values to global variables when the scene starts, or when something else triggers it. This is the way to give a global variable an object from the scene as its value.

To control when the values are assigned, turn off Run on Start and call ApplyValues() instead. After changing the global variables, press Update Assignments to sync the list.

Create one from GameObject → Narramancer → Set Global Variables.

One Saveable per GameObject decides what that object saves. It gives the object a permanent id that saves use to find it, and has a toggle for its active state and for each component Narramancer can save: Transform, Rect Transform, Image, Sprite Renderer, Text, Audio Source, Animation and Nav Mesh Agent. Fields marked [Save] on your own scripts are saved through it too.

See Saving scene objects for the details, and Window → Narramancer → Add Missing Saveables to add them in bulk.

If a noun instance is tied to a GameObject, add a SerializeNounInstanceReference to that GameObject to keep the link after a load.

Spawns GameObjects from a single GameObject or prefab, with settings for where new objects appear. Spawners are needed by the Spawn node and can be used by the Create Instance node. GameObjects a spawner creates are saved and recreated on load automatically.

Create one from GameObject → Narramancer → Serializable Spawner.

The movement and animation nodes add a small helper component to the object they move, when it needs one: Tweener for Translate GameObject and Tween GameObject Rotation, AnimationPlayer for Play Animation, and NavMeshMover for Move NavMesh Agent. You don’t add these yourself. They are what let a move or an animation resume after a load, and the object’s Saveable restores them.

Creates a noun instance for the GameObject it is on. This is like defining a noun with a noun asset, but suits nouns that are closely tied to a GameObject. The new instance is linked to the GameObject, and both are saved and recreated on load.

Create one from GameObject → Narramancer → Create Noun For GameObject.

Turns a target GameObject on or off depending on whether a noun currently has a given property.

The target should be a different GameObject from the one with this component. Otherwise the component stops updating as soon as it disables its own GameObject.

Shows a noun’s stat on a Unity UI Slider. Put it on the Slider and it keeps the slider at the stat’s current value.

The sample UI is built from these components. Each has a ready-made prefab in Narramancer/Prefabs.

Component Prefab What it does
TextPrinter Text Printer Canvas Shows narrative text, usually revealed a little at a time. Needed by the Print Text node.
ChoicePrinter Choice Printer Canvas Shows choices as buttons. Needed by the Offer Choices node.
TextAndChoicePrinter Text and Choice Printer Canvas Both in one scroll view. The samples use this one.
HistoryLogPrinter History Log Canvas A scrollback log of the text and choices so far.
SaveMenu, LoadMenu Save Manager Canvas Save and load slots with thumbnails.
Overlay Buttons Manager Canvas The Log, Save and Load buttons from the samples, wired to the menus above.

Choices are saved per printer, so a scene with more than one printer comes back with each printer’s choices where they were.

Narramancer is source-available. It's free for noncommercial use underPolyForm Noncommercial 1.0.0, and commercial use needs an Asset Store license.Source on GitHub.