Divooka Reference

Novella Game

46 nodes

On this page 46

Choices Variable

Function

With NovellaGame.HeadlessVariable, the menu choices to make, by position among the options shown and separated by commas (1,0,2); once they run out the first option is chosen. How a document's other routes are played without a desktop.

Signature
ChoicesVariable() -> Text
string ChoicesVariable()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Headless Variable

Function

The environment variable that makes NovellaGame.Run play headless: its value is how many interactions to play.

Signature
HeadlessVariable() -> Text
string HeadlessVariable()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Screenshots Variable

Function

With NovellaGame.HeadlessVariable, a folder to save a described picture of every interaction in, so a document's frames can be looked at as well as its transcript read.

Signature
ScreenshotsVariable() -> Text
string ScreenshotsVariable()

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Make Novella Game

Function

Makes a game with a title and a resolution.

Signature
NovellaGame -> Novella Game
    title: Text
    width: Integer
    height: Integer
NovellaGame NovellaGame(
    string title = "Novella Game",
    int width = 1280,
    int height = 720)

Parameters

nametypedefaultdescription
titleTextNovella GameThe game's name, shown in the window title and on the main menu.
widthInteger1280The resolution everything is laid out at; the window scales it.
heightInteger720The resolution's height.

Returns

resultNovella Game
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Make Novella Game From Definition

Function

Makes a game from a definition built elsewhere, such as by a functional graph.

Signature
NovellaGame(definition: Game Definition) -> Novella Game
NovellaGame NovellaGame(GameDefinition definition)

Parameters

nametypedefaultdescription
definitionGame Definition—

Returns

resultNovella Game
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Achieve

Function

Live script: grants an achievement.

Signature
Achieve(Novella Game: Novella Game, achievement: Text)
void Achieve(NovellaGame Novella Game, string achievement)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
achievementText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Add Asset

Function

Adds one file from memory, under a path scripts refer to it by.

Signature
AddAsset
    Novella Game: Novella Game
    path: Text
    data: Byte Array
void AddAsset(
    NovellaGame Novella Game,
    string path,
    byte[] data)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
pathText—
dataByte Array—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Add Asset Folder

Function

Adds a folder of game files: images, audio, video, fonts, scripts.

Signature
AddAssetFolder(Novella Game: Novella Game, folder: Text)
void AddAssetFolder(NovellaGame Novella Game, string folder)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
folderText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Add Library Assets

Function

Adds the files embedded in this Divooka document's library: its images, sounds, fonts and scripts.

Signature
AddLibraryAssets
    Novella Game: Novella Game
    _library: IDivookaAssetLibrary
void AddLibraryAssets(
    NovellaGame Novella Game,
    IDivookaAssetLibrary _library)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
_libraryIDivookaAssetLibrary—The document's library (supplied automatically).
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Add Scene

Function

Adds a scene: a label made from a scene's background, music, lines and ending.

Signature
AddScene(Novella Game: Novella Game, scene: Scene)
void AddScene(NovellaGame Novella Game, SceneDefinition scene)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
sceneScene—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Add Story

Function

Adds a story built elsewhere (from nodes or code).

Signature
AddStory(Novella Game: Novella Game, story: Story)
void AddStory(NovellaGame Novella Game, Story story)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
storyStory—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Call Label

Function

Live script: runs a story label to its return, then comes back here.

Signature
CallLabel(Novella Game: Novella Game, label: Text)
void CallLabel(NovellaGame Novella Game, string label)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
labelText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Define Character

Function

Defines a character.

Signature
DefineCharacter -> Character Definition
    Novella Game: Novella Game
    ID: Text
    name: Text
    color: Text
    image: Text
CharacterDefinition DefineCharacter(
    NovellaGame Novella Game,
    string id,
    string name,
    string color = "",
    string image = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
IDText—The name scripts use for the character.
nameText—The name shown when they speak.
colorText—The name's colour, such as #c0392b.
imageText—The character's image tag, so lines can change their expression.

Returns

resultCharacter Definition
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Define Image

Function

Defines an image by name from a file among the assets (or a colour such as #000).

Signature
DefineImage(Novella Game: Novella Game, name: Text, file: Text)
void DefineImage(
    NovellaGame Novella Game,
    string name,
    string file)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—
fileText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Get Number

Function

Reads a story variable as a number.

Signature
GetNumber(Novella Game: Novella Game, name: Text) -> Number
double GetNumber(NovellaGame Novella Game, string name)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—

Returns

ValueNumber
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Get Variable

Function

Reads a story variable as text.

Signature
GetVariable(Novella Game: Novella Game, name: Text) -> Text
string GetVariable(NovellaGame Novella Game, string name)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—

Returns

ValueText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Hide

Function

Live script: hides an image.

Signature
Hide(Novella Game: Novella Game, tag: Text, with: Text)
void Hide(
    NovellaGame Novella Game,
    string tag,
    string with = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
tagText—
withText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Input

Function

Live script: asks the player to type something and returns it.

Signature
Input -> Text
    Novella Game: Novella Game
    prompt: Text
    defaultText: Text
string Input(
    NovellaGame Novella Game,
    string prompt,
    string defaultText = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
promptText—
defaultTextText—

Returns

TextText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Load Script

Function

Adds a script, given as text.

Signature
LoadScript(Novella Game: Novella Game, script: Text, name: Text)
void LoadScript(
    NovellaGame Novella Game,
    string script,
    string name = "script.novella")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
scriptText—Novella script.
nameTextscript.novellaA name for messages, such as the file it came from.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Load Script File

Function

Adds a script file from disk.

Signature
LoadScriptFile(Novella Game: Novella Game, path: Text)
void LoadScriptFile(NovellaGame Novella Game, string path)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
pathText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Load Scripts From Assets

Function

Adds every script (.novella) among the game's files, under a folder or everywhere.

Signature
LoadScriptsFromAssets -> Integer
    Novella Game: Novella Game
    folder: Text
int LoadScriptsFromAssets(
    NovellaGame Novella Game,
    string folder = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
folderText—

Returns

CountInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Narrate

Function

Live script: narration.

Signature
Narrate(Novella Game: Novella Game, text: Text)
void Narrate(NovellaGame Novella Game, string text)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
textText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Notify

Function

Live script: shows a notification.

Signature
Notify(Novella Game: Novella Game, text: Text)
void Notify(NovellaGame Novella Game, string text)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
textText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Pause

Function

Live script: waits for a time, or for a click when the time is zero.

Signature
Pause(Novella Game: Novella Game, seconds: Number)
void Pause(NovellaGame Novella Game, double seconds = 0)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
secondsNumber0
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Play

Function

Live script: plays a file on a channel (music loops, sound plays once).

Signature
Play
    Novella Game: Novella Game
    channel: Text
    file: Text
    fadeIn: Number
void Play(
    NovellaGame Novella Game,
    string channel,
    string file,
    double fadeIn = 0)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
channelText—
fileText—
fadeInNumber0
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Random Integer

Function

A random whole number from the story's own generator, so rolling back and choosing again draws the same one.

Signature
RandomInteger -> Integer
    Novella Game: Novella Game
    minimum: Integer
    maximum: Integer
int RandomInteger(
    NovellaGame Novella Game,
    int minimum,
    int maximum)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
minimumInteger—The smallest number it can be.
maximumInteger—The largest number it can be.

Returns

NumberInteger
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Register Command

Function

Registers a command that takes no arguments and returns nothing, the shape a Divooka function graph has most often.

Signature
RegisterAction
    Novella Game: Novella Game
    name: Text
    action: Action
void RegisterAction(
    NovellaGame Novella Game,
    string name,
    Action action)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—
actionAction—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Register Command Function

Function

Registers a command that takes arguments and answers: a graph given the arguments as text, whose answer the story reads as _return (a number, true or false, or text, as typed).

Signature
RegisterCommandFunction
    Novella Game: Novella Game
    name: Text
    handler: Func<Text Array, Text>
void RegisterCommandFunction(
    NovellaGame Novella Game,
    string name,
    Func<string[], string> handler)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—What run names the command by.
handlerFunc<Text Array, Text>—The graph: text in, text out.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Register Expression Function

Function

Registers a function conditions, text and effects can call by name, such as [title_for(trust)]: a graph given the arguments as text, whose answer is read as typed.

Signature
RegisterExpressionFunction
    Novella Game: Novella Game
    name: Text
    function: Func<Text Array, Text>
void RegisterExpressionFunction(
    NovellaGame Novella Game,
    string name,
    Func<string[], string> function)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—What expressions call it by.
functionFunc<Text Array, Text>—The graph: text in, text out.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Run

Function

Opens the game in a window and plays until the player quits.

Signature
Run(Novella Game: Novella Game)
void Run(NovellaGame Novella Game)

Parameters

nametypedefaultdescription
Novella GameNovella Game—

Remarks

With NovellaGame.HeadlessVariable set to a number, it plays that many interactions headless through the game's real controls instead, choosing the options NovellaGame.ChoicesVariable lists and then the first option of every menu, and prints what was said: how an example document or a build is checked without a desktop.

Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Say

Function

Live script: a character says a line, and the call returns when the player continues.

Signature
Say(Novella Game: Novella Game, character: Text, text: Text)
void Say(
    NovellaGame Novella Game,
    string character,
    string text)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
characterText—A character id, or empty for narration.
textText—The line, with text tags if wanted.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Scene

Function

Live script: clears the stage and shows a background.

Signature
Scene(Novella Game: Novella Game, image: Text, with: Text)
void Scene(
    NovellaGame Novella Game,
    string image = "",
    string with = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
imageText—
withText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Config

Function

Sets a configuration value, as define config.name = value does in a script: text, a number, true or false. A value set here holds over the scripts' own definition of the key.

Signature
SetConfig(Novella Game: Novella Game, key: Text, value: Text)
void SetConfig(
    NovellaGame Novella Game,
    string key,
    string value)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
keyText—The setting, such as version, text_speed, main_menu_music.
valueText—The value as written: 1.2, true, audio/theme.ogg.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Default

Function

Sets a variable's initial value, as default does.

Signature
SetDefault
    Novella Game: Novella Game
    variable: Text
    value: Text
void SetDefault(
    NovellaGame Novella Game,
    string variable,
    string value)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
variableText—
valueText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Resolution

Function

Sets the resolution the game is laid out at.

Signature
SetResolution
    Novella Game: Novella Game
    width: Integer
    height: Integer
void SetResolution(
    NovellaGame Novella Game,
    int width = 1920,
    int height = 1080)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
widthInteger1920
heightInteger1080
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Result

Function

Answers the run command being handled: the story reads this as _return.

Signature
SetResult(Novella Game: Novella Game, value: Text)
void SetResult(NovellaGame Novella Game, string value)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
valueText—The answer, as written: text, a number, true or false.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Theme

Function

Sets a theme value, as define theme.name = value does: a colour, a size, an image file, a font. A value set here holds over the scripts' own definition of the key.

Signature
SetTheme(Novella Game: Novella Game, key: Text, value: Text)
void SetTheme(
    NovellaGame Novella Game,
    string key,
    string value)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
keyText—The setting, such as text_font, accent_color, textbox_image.
valueText—The value as written: #c0392b, 36, gui/textbox.png; a list as [40, 40, 40, 40].
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Title

Function

Sets the game's title.

Signature
SetTitle(Novella Game: Novella Game, title: Text)
void SetTitle(NovellaGame Novella Game, string title)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
titleText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Set Variable

Function

Sets a story variable (in a live script, or from a command).

Signature
SetVariable(Novella Game: Novella Game, name: Text, value: Text)
void SetVariable(
    NovellaGame Novella Game,
    string name,
    string value)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
nameText—
valueText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Show

Function

Live script: shows an image, optionally at a position and with a transition.

Signature
Show
    Novella Game: Novella Game
    image: Text
    at: Text
    with: Text
void Show(
    NovellaGame Novella Game,
    string image,
    string at = "",
    string with = "")

Parameters

nametypedefaultdescription
Novella GameNovella Game—
imageText—An image name: a tag and attributes, such as qinglan smile.
atText—A transform: left, center, right, or one the story defines.
withText—A transition: dissolve, fade and so on.
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Stop

Function

Live script: stops a channel.

Signature
Stop(Novella Game: Novella Game, channel: Text, fadeOut: Number)
void Stop(
    NovellaGame Novella Game,
    string channel,
    double fadeOut = 0)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
channelText—
fadeOutNumber0
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

To String

Function

This node carries no documentation.

Signature
ToString(Novella Game: Novella Game) -> Text
string ToString(NovellaGame Novella Game)

Parameters

nametypedefaultdescription
Novella GameNovella Game—

Returns

resultText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Translate Text

Function

Text in the player's language, through the story's string translations (translate ... strings).

Signature
TranslateText(Novella Game: Novella Game, text: Text) -> Text
string TranslateText(NovellaGame Novella Game, string text)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
textText—

Returns

TextText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

Validate

Function

Checks the story: undefined labels, characters, images, files, commands. Returns the problems found.

Signature
Validate(Novella Game: Novella Game) -> Text Array
string[] Validate(NovellaGame Novella Game)

Parameters

nametypedefaultdescription
Novella GameNovella Game—

Returns

ProblemsText Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels

With

Function

Live script: runs a transition over what changed.

Signature
With(Novella Game: Novella Game, transition: Text)
void With(NovellaGame Novella Game, string transition)

Parameters

nametypedefaultdescription
Novella GameNovella Game—
transitionText—
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Novella Game
Package
Novella Visual Novels