元编程参考文档

Novella 游戏

46 个节点

本页内容 46

选项变量

函数

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.

签名
选项变量() -> 文本
string ChoicesVariable()

返回

结果文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

无界面变量

函数

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

签名
无界面变量() -> 文本
string HeadlessVariable()

返回

结果文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

截图变量

函数

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.

签名
截图变量() -> 文本
string ScreenshotsVariable()

返回

结果文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

创建 Novella 游戏

函数

Makes a game with a title and a resolution.

签名
创建 Novella 游戏 -> Novella Game
    标题: 文本
    宽度: 整数
    高度: 整数
NovellaGame NovellaGame(
    string title = "Novella Game",
    int width = 1280,
    int height = 720)

参数

名称类型默认值说明
标题文本Novella GameThe game's name, shown in the window title and on the main menu.
宽度整数1280The resolution everything is laid out at; the window scales it.
高度整数720The resolution's height.

返回

Novella 游戏Novella Game
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

从定义创建 Novella 游戏

函数

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

签名
从定义创建 Novella 游戏(定义: Game Definition) -> Novella Game
NovellaGame NovellaGame(GameDefinition definition)

参数

名称类型默认值说明
定义Game Definition—

返回

Novella 游戏Novella Game
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

获得成就

函数

Live script: grants an achievement.

签名
获得成就(Novella Game: Novella Game, 成就: 文本)
void Achieve(NovellaGame Novella Game, string achievement)

参数

名称类型默认值说明
Novella GameNovella Game—
成就文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

添加素材

函数

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

签名
添加素材(Novella Game: Novella Game, 路径: 文本, 数据: 字节数组)
void AddAsset(
    NovellaGame Novella Game,
    string path,
    byte[] data)

参数

名称类型默认值说明
Novella GameNovella Game—
路径文本—
数据字节数组—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

添加素材文件夹

函数

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

签名
添加素材文件夹(Novella Game: Novella Game, 文件夹: 文本)
void AddAssetFolder(NovellaGame Novella Game, string folder)

参数

名称类型默认值说明
Novella GameNovella Game—
文件夹文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

添加库素材

函数

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

签名
添加库素材
    Novella Game: Novella Game
    _library: IDivookaAssetLibrary
void AddLibraryAssets(
    NovellaGame Novella Game,
    IDivookaAssetLibrary _library)

参数

名称类型默认值说明
Novella GameNovella Game—
_libraryIDivookaAssetLibrary—The document's library (supplied automatically).
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

添加场景

函数

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

签名
添加场景(Novella Game: Novella Game, 场景: Scene)
void AddScene(NovellaGame Novella Game, SceneDefinition scene)

参数

名称类型默认值说明
Novella GameNovella Game—
场景Scene—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

添加故事

函数

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

签名
添加故事(Novella Game: Novella Game, 故事: Story)
void AddStory(NovellaGame Novella Game, Story story)

参数

名称类型默认值说明
Novella GameNovella Game—
故事Story—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

调用标签

函数

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

签名
调用标签(Novella Game: Novella Game, 标签: 文本)
void CallLabel(NovellaGame Novella Game, string label)

参数

名称类型默认值说明
Novella GameNovella Game—
标签文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

定义角色

函数

Defines a character.

签名
定义角色 -> Character Definition
    Novella Game: Novella Game
    ID: 文本
    名称: 文本
    颜色: 文本
    图像: 文本
CharacterDefinition DefineCharacter(
    NovellaGame Novella Game,
    string id,
    string name,
    string color = "",
    string image = "")

参数

名称类型默认值说明
Novella GameNovella Game—
ID文本—The name scripts use for the character.
名称文本—The name shown when they speak.
颜色文本—The name's colour, such as #c0392b.
图像文本—The character's image tag, so lines can change their expression.

返回

结果Character Definition
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

定义图像

函数

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

签名
定义图像(Novella Game: Novella Game, 名称: 文本, 文件: 文本)
void DefineImage(
    NovellaGame Novella Game,
    string name,
    string file)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—
文件文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

获取数字

函数

Reads a story variable as a number.

签名
获取数字(Novella Game: Novella Game, 名称: 文本) -> 数字
double GetNumber(NovellaGame Novella Game, string name)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—

返回

值数字
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

获取变量

函数

Reads a story variable as text.

签名
获取变量(Novella Game: Novella Game, 名称: 文本) -> 文本
string GetVariable(NovellaGame Novella Game, string name)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—

返回

值文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

隐藏

函数

Live script: hides an image.

签名
隐藏(Novella Game: Novella Game, 标签: 文本, 转场: 文本)
void Hide(
    NovellaGame Novella Game,
    string tag,
    string with = "")

参数

名称类型默认值说明
Novella GameNovella Game—
标签文本—
转场文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

输入

函数

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

签名
输入 -> 文本
    Novella Game: Novella Game
    提示词: 文本
    默认文本: 文本
string Input(
    NovellaGame Novella Game,
    string prompt,
    string defaultText = "")

参数

名称类型默认值说明
Novella GameNovella Game—
提示词文本—
默认文本文本—

返回

文本文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

加载脚本

函数

Adds a script, given as text.

签名
加载脚本(Novella Game: Novella Game, 脚本: 文本, 名称: 文本)
void LoadScript(
    NovellaGame Novella Game,
    string script,
    string name = "script.novella")

参数

名称类型默认值说明
Novella GameNovella Game—
脚本文本—Novella script.
名称文本script.novellaA name for messages, such as the file it came from.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

加载脚本文件

函数

Adds a script file from disk.

签名
加载脚本文件(Novella Game: Novella Game, 路径: 文本)
void LoadScriptFile(NovellaGame Novella Game, string path)

参数

名称类型默认值说明
Novella GameNovella Game—
路径文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

从素材加载脚本

函数

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

签名
从素材加载脚本(Novella Game: Novella Game, 文件夹: 文本) -> 整数
int LoadScriptsFromAssets(
    NovellaGame Novella Game,
    string folder = "")

参数

名称类型默认值说明
Novella GameNovella Game—
文件夹文本—

返回

数量整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

旁白

函数

Live script: narration.

签名
旁白(Novella Game: Novella Game, 文本: 文本)
void Narrate(NovellaGame Novella Game, string text)

参数

名称类型默认值说明
Novella GameNovella Game—
文本文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

通知

函数

Live script: shows a notification.

签名
通知(Novella Game: Novella Game, 文本: 文本)
void Notify(NovellaGame Novella Game, string text)

参数

名称类型默认值说明
Novella GameNovella Game—
文本文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

暂停

函数

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

签名
暂停(Novella Game: Novella Game, 秒数: 数字)
void Pause(NovellaGame Novella Game, double seconds = 0)

参数

名称类型默认值说明
Novella GameNovella Game—
秒数数字0
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

播放

函数

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

签名
播放
    Novella Game: Novella Game
    声道: 文本
    文件: 文本
    淡入: 数字
void Play(
    NovellaGame Novella Game,
    string channel,
    string file,
    double fadeIn = 0)

参数

名称类型默认值说明
Novella GameNovella Game—
声道文本—
文件文本—
淡入数字0
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

随机整数

函数

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

签名
随机整数 -> 整数
    Novella Game: Novella Game
    最小值: 整数
    最大值: 整数
int RandomInteger(
    NovellaGame Novella Game,
    int minimum,
    int maximum)

参数

名称类型默认值说明
Novella GameNovella Game—
最小值整数—The smallest number it can be.
最大值整数—The largest number it can be.

返回

数字整数
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

注册命令

函数

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

签名
注册命令(Novella Game: Novella Game, 名称: 文本, 操作: Action)
void RegisterAction(
    NovellaGame Novella Game,
    string name,
    Action action)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—
操作Action—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

注册命令函数

函数

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).

签名
注册命令函数
    Novella Game: Novella Game
    名称: 文本
    处理函数: Func<文本数组, 文本>
void RegisterCommandFunction(
    NovellaGame Novella Game,
    string name,
    Func<string[], string> handler)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—What run names the command by.
处理函数Func<文本数组, 文本>—The graph: text in, text out.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

注册表达式函数

函数

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.

签名
注册表达式函数
    Novella Game: Novella Game
    名称: 文本
    函数: Func<文本数组, 文本>
void RegisterExpressionFunction(
    NovellaGame Novella Game,
    string name,
    Func<string[], string> function)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—What expressions call it by.
函数Func<文本数组, 文本>—The graph: text in, text out.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

运行

函数

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

签名
运行(Novella Game: Novella Game)
void Run(NovellaGame Novella Game)

参数

名称类型默认值说明
Novella GameNovella Game—

备注

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.

所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

说话

函数

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

签名
说话(Novella Game: Novella Game, 字符: 文本, 文本: 文本)
void Say(
    NovellaGame Novella Game,
    string character,
    string text)

参数

名称类型默认值说明
Novella GameNovella Game—
字符文本—A character id, or empty for narration.
文本文本—The line, with text tags if wanted.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

场景

函数

Live script: clears the stage and shows a background.

签名
场景(Novella Game: Novella Game, 图像: 文本, 转场: 文本)
void Scene(
    NovellaGame Novella Game,
    string image = "",
    string with = "")

参数

名称类型默认值说明
Novella GameNovella Game—
图像文本—
转场文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置配置项

函数

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.

签名
设置配置项(Novella Game: Novella Game, 键: 文本, 值: 文本)
void SetConfig(
    NovellaGame Novella Game,
    string key,
    string value)

参数

名称类型默认值说明
Novella GameNovella Game—
键文本—The setting, such as version, text_speed, main_menu_music.
值文本—The value as written: 1.2, true, audio/theme.ogg.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置默认值

函数

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

签名
设置默认值(Novella Game: Novella Game, 变量: 文本, 值: 文本)
void SetDefault(
    NovellaGame Novella Game,
    string variable,
    string value)

参数

名称类型默认值说明
Novella GameNovella Game—
变量文本—
值文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置分辨率

函数

Sets the resolution the game is laid out at.

签名
设置分辨率(Novella Game: Novella Game, 宽度: 整数, 高度: 整数)
void SetResolution(
    NovellaGame Novella Game,
    int width = 1920,
    int height = 1080)

参数

名称类型默认值说明
Novella GameNovella Game—
宽度整数1920
高度整数1080
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置结果

函数

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

签名
设置结果(Novella Game: Novella Game, 值: 文本)
void SetResult(NovellaGame Novella Game, string value)

参数

名称类型默认值说明
Novella GameNovella Game—
值文本—The answer, as written: text, a number, true or false.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置主题

函数

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.

签名
设置主题(Novella Game: Novella Game, 键: 文本, 值: 文本)
void SetTheme(
    NovellaGame Novella Game,
    string key,
    string value)

参数

名称类型默认值说明
Novella GameNovella Game—
键文本—The setting, such as text_font, accent_color, textbox_image.
值文本—The value as written: #c0392b, 36, gui/textbox.png; a list as [40, 40, 40, 40].
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置标题

函数

Sets the game's title.

签名
设置标题(Novella Game: Novella Game, 标题: 文本)
void SetTitle(NovellaGame Novella Game, string title)

参数

名称类型默认值说明
Novella GameNovella Game—
标题文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

设置变量

函数

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

签名
设置变量(Novella Game: Novella Game, 名称: 文本, 值: 文本)
void SetVariable(
    NovellaGame Novella Game,
    string name,
    string value)

参数

名称类型默认值说明
Novella GameNovella Game—
名称文本—
值文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

显示

函数

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

签名
显示
    Novella Game: Novella Game
    图像: 文本
    位置: 文本
    转场: 文本
void Show(
    NovellaGame Novella Game,
    string image,
    string at = "",
    string with = "")

参数

名称类型默认值说明
Novella GameNovella Game—
图像文本—An image name: a tag and attributes, such as qinglan smile.
位置文本—A transform: left, center, right, or one the story defines.
转场文本—A transition: dissolve, fade and so on.
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

停止

函数

Live script: stops a channel.

签名
停止(Novella Game: Novella Game, 声道: 文本, 淡出: 数字)
void Stop(
    NovellaGame Novella Game,
    string channel,
    double fadeOut = 0)

参数

名称类型默认值说明
Novella GameNovella Game—
声道文本—
淡出数字0
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

转为文本

函数

此节点没有文档说明。

签名
转为文本(Novella Game: Novella Game) -> 文本
string ToString(NovellaGame Novella Game)

参数

名称类型默认值说明
Novella GameNovella Game—

返回

结果文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

翻译文本

函数

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

签名
翻译文本(Novella Game: Novella Game, 文本: 文本) -> 文本
string TranslateText(NovellaGame Novella Game, string text)

参数

名称类型默认值说明
Novella GameNovella Game—
文本文本—

返回

文本文本
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

验证

函数

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

签名
验证(Novella Game: Novella Game) -> 文本数组
string[] Validate(NovellaGame Novella Game)

参数

名称类型默认值说明
Novella GameNovella Game—

返回

问题文本数组
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说

使用转场

函数

Live script: runs a transition over what changed.

签名
使用转场(Novella Game: Novella Game, 转场: 文本)
void With(NovellaGame Novella Game, string transition)

参数

名称类型默认值说明
Novella GameNovella Game—
转场文本—
所属发行版
元编程(教育版)元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
Novella 游戏
所属包
Novella 视觉小说