元编程参考文档

Novella 视觉小说

可用

视觉小说:角色、场景、选项、音乐和美术

Methodox Wiki 上的使用指南

16 个类别,共 288 个节点

所属发行版
元编程(教育版)元编程(专业版)
支持等级
第 2 级(拟定)
所属包
Novella 视觉小说
Novella 视觉小说

数据驱动的视觉小说框架:用脚本或节点编写故事,用节点配置并运行游戏,并提供游戏预览。

故事编写

获得成就Grants an achievement.添加选项The choices with one more after them.应用效果Changes the story's variables at this point: an effect from the Effects nodes, such as Add To Variable.调用Runs another label and comes back.调用画面Shows a screen and waits for the player to answer it; the answer is in _return afterwards.调用变量指定的标签Runs the label a variable names, then comes back.带参数调用Runs another label with arguments for its parameters, each as typed: a number, true, text.居中文字Text in the middle of the screen with no window, as for a chapter title.拼接One sequence followed by another.续写Continues the line before, as when a thought is finished after a pause.强制暂停Waits for some seconds and cannot be clicked through.隐藏Hides an image.隐藏画面Hides a shown screen.带选项隐藏Hides an image on a layer.如果Runs one sequence or another depending on a condition.输入Asks the player to type into a variable.带选项输入Asks the player to type into a variable, with a length and the characters allowed.跳转Continues at another label.由函数跳转Continues at the label a function of the story's variables names: a Function graph taking Story Variables and answering text.跳转到变量指定的标签Continues at the label a variable names.菜单Offers choices.由选项生成菜单Offers as many choices as Add Choice collected, with a line above them.播放影片Plays a full-screen movie.带选项播放影片A full-screen movie, which may keep the music playing under it.旁白Narration: a line with no speaker.通知Shows a notification.清空 NVLClears the full-screen NVL page.暂停Waits for a click, or for some seconds.播放Plays a file on any channel: music, sound, voice, ambience, or one the story defines.播放音乐Plays music, which loops until stopped or replaced.播放音效Plays a sound once.带选项播放Plays files on a channel with every option a script's play has.Python 代码块Python run against the story's variables where the sequence reaches it; what it sets that the story can hold goes back into the story.加入队列Adds files to a channel's queue, to play when what plays now ends.返回Returns from a called label, or ends the game.返回值Returns from a called label with a value, as typed, which the caller reads as _return.返回变量Returns from a called label with a variable's value.运行命令Runs a command the game implements; its result is in _return afterwards.带值运行命令Runs a command the game implements with arguments, each as typed; its result is in _return afterwards.说话A line of dialogue.以某身份说话A line from someone who is not a defined character, such as a shopkeeper.简短说话A line whose expression change lasts only while it is up.说一句A line with everything a script line can carry: an expression change for the line or after it, a transition, an id for translations.场景Clears the stage and shows a background.带选项的场景Clears the stage (or a layer) and shows a background, which may be placed or animated, such as a slow pan.脚本Adds statements written as script, for anything the other nodes do not cover.序列转为脚本A sequence written as script, to read what a chain of nodes makes.显示Shows an image, or changes one showing.显示画面Shows a screen over the game and carries on: a status bar, a map button.带选项显示Shows an image with everything a script's show can say: where, behind what, how high in the stack, under what name, on which layer, and an animation of its own.开始选项No choices yet, to add to with Add Choice.开始序列An empty sequence to build on.停止Stops a channel.语音Sets the voice file for the next line.持续语音Keeps the voice playing on through the next line.当Repeats a sequence while a condition holds.对话框Shows or hides the dialogue window: show, hide or auto.带转场的对话框Shows or hides the dialogue window with a transition: show, hide or auto.使用转场Runs a transition over what changed since the last line.

Novella 游戏

选项变量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.无界面变量The environment variable that makes NovellaGame.Run play headless: its value is how many interactions to play.截图变量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.创建 Novella 游戏Makes a game with a title and a resolution.从定义创建 Novella 游戏Makes a game from a definition built elsewhere, such as by a functional graph.获得成就Live script: grants an achievement.添加素材Adds one file from memory, under a path scripts refer to it by.添加素材文件夹Adds a folder of game files: images, audio, video, fonts, scripts.添加库素材Adds the files embedded in this Divooka document's library: its images, sounds, fonts and scripts.添加场景Adds a scene: a label made from a scene's background, music, lines and ending.添加故事Adds a story built elsewhere (from nodes or code).调用标签Live script: runs a story label to its return, then comes back here.定义角色Defines a character.定义图像Defines an image by name from a file among the assets (or a colour such as #000).获取数字Reads a story variable as a number.获取变量Reads a story variable as text.隐藏Live script: hides an image.输入Live script: asks the player to type something and returns it.加载脚本Adds a script, given as text.加载脚本文件Adds a script file from disk.从素材加载脚本Adds every script (.novella) among the game's files, under a folder or everywhere.菜单Live script: offers choices and returns the index of the one chosen.旁白Live script: narration.通知Live script: shows a notification.暂停Live script: waits for a time, or for a click when the time is zero.播放Live script: plays a file on a channel (music loops, sound plays once).随机整数A random whole number from the story's own generator, so rolling back and choosing again draws the same one.注册命令Registers a command that takes no arguments and returns nothing, the shape a Divooka function graph has most often.注册命令函数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).注册表达式函数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.运行Opens the game in a window and plays until the player quits.说话Live script: a character says a line, and the call returns when the player continues.场景Live script: clears the stage and shows a background.设置配置项Sets a configuration value, as define config.name = value does in a script: text, a number, true or false.设置默认值Sets a variable's initial value, as default does.设置分辨率Sets the resolution the game is laid out at.设置结果Answers the run command being handled: the story reads this as _return.设置主题Sets a theme value, as define theme.name = value does: a colour, a size, an image file, a font.设置标题Sets the game's title.设置变量Sets a story variable (in a live script, or from a command).显示Live script: shows an image, optionally at a position and with a transition.停止Live script: stops a channel.转为文本翻译文本Text in the player's language, through the story's string translations (translate ... strings).验证Checks the story: undefined labels, characters, images, files, commands.使用转场Live script: runs a transition over what changed.

画面

添加框A box of elements, laid out by its kind: vbox one under another, hbox side by side, grid in rows of columns, frame a panel with them placed over it, fixed each where its position puts it, viewport one under another and scrolled with the wheel.添加遍历Elements once for every item of a list, with the item in a variable: a row for every gift in the bag.添加条件Some elements while a condition holds and, optionally, others while it does not.添加图片按钮A picture to press, such as a place on a map, with another picture under the pointer.添加屏幕进度条A bar showing a variable against a maximum, such as trust out of ten.添加屏幕按钮A button with text on it.添加屏幕图像A picture on the screen: an image name or a file.添加屏幕输入框A text field that types into a variable, such as a name.添加屏幕按键Acts when a key is pressed while the screen is up: escape, enter, space, left, a letter, f1...添加屏幕空白Empty space of a size, to hold things apart in a box.添加屏幕文本Text on the screen; it may show variables with [name].添加屏幕计时器Acts when some seconds have passed, as a timed choice runs out; again every time they pass, when repeating.添加屏幕变量A variable of the screen's own with its first value, as typed; its buttons can change it, and it lasts as long as the screen.添加引用画面Another screen's elements in place, such as a status bar several screens share.锚定最后一个元素Puts the element added last at a point of itself other than its centre: (0, 0) puts its top left corner at its position, (1, 1) its bottom right, so (1, 1) at (1, 1) sits it in the stage's corner.回答Answers a called screen with a value, as typed, which the story reads as _return.关闭画面Closes the screen; a called one answers nothing.前往标签Leaves the screen and continues the story at a label.隐藏画面操作Hides another screen.通知操作Shows a notification.打开菜单操作Opens one of the game's menus: save, load, preferences, history, gallery, music_room, achievements or main_menu.播放声音操作Plays a sound once.运行命令操作Runs a command the game registers.画面转为脚本A screen as a script writes it.设置最后一个元素的样式属性Sets a style property on the element added last itself, laid over its style: outline_width2; on a button, a property starting text_ styles its label.设置画面样式前缀A prefix for the styles of everything on the screen: with gold, its buttons draw with gold_button when there is one.设置变量操作Sets a variable to a value, as typed.把变量设为某值操作Sets a variable to what an expression gives when the button is pressed, such as the item of a For Each row: item.显示画面操作Shows another screen.开始内容A set of elements with no screen of its own yet, to fill a box, a branch or a loop with; build it with the Add nodes as a screen is built.开始画面A screen with nothing on it yet.最后一个元素的样式Gives the element added last a style of its own (style), and for a box, a prefix for the styles of what it holds (style_prefix).然后执行操作One action and then another: set a variable, then go to a label.切换变量操作Turns a true variable false and a false one true.

故事

添加成就A story with an achievement, which Achieve grants and the Achievements screen lists.添加音频名称A story with a name for an audio file, so lines can play theme rather than its path.添加声道A story with an audio channel of its own, beside music, sound, voice and ambience.添加角色A story with a character added.添加常量A story with a constant, set when a game starts and again after a load so a changed value reaches old saves.添加默认值A story with a variable's starting value: affection and 0.添加画廊条目A story with a gallery entry, unlocked once its pictures have been seen.条件添加画廊条目A story with a gallery entry unlocked when a condition holds, rather than when its pictures have been seen.添加图像A story with an image defined: a name and a file (or a colour such as #000).从源添加图像A story with an image from a source made by the Images nodes: a movie, a filtered or composite picture, a switch.添加标签A story with a label added, replacing one of the same name.添加分层图像A story with a layered image, assembled with Start Layered Image and the layer nodes.添加音乐曲目A story with a track for the music room, unlocked once heard, or when a condition holds.添加 Python 定义A story with Python run once when a game starts: the functions it defines can be called from any condition, text or effect, as [title_for(trust)].添加画面A story with a screen laid out by the Screens nodes, which Show Screen and Call Screen find by its name.添加样式A story with a style made by the Styles nodes: a look of its own, or, under one of Novella's own names, a restyling of that part of the game.添加转场A story with a named transition, made from a built-in one: slow as dissolve(2).检查故事Checks a story without its files: undefined labels, characters, transforms and transitions.合并故事Two stories as one: the second's labels and definitions added to the first's.标签名称The labels a story has, in order.创建标签A label: a named place in the story, holding a sequence.创建带参数的标签A label that takes arguments, which Call With Arguments passes and the label reads as variables.开始故事An empty story to add labels and characters to.从库加载故事Reads a story from a script file in the document's library.从脚本生成故事Reads a story from script text.故事转为脚本A story written as script.翻译台词A story with a line translated, found by the label it is in, who says it and what it says.按 ID 翻译台词A story with a line translated by the id Say Line gave it.翻译文本A story with any other text translated: a choice, a name, a prompt, a notification.

条件

动画

添加动画图像A story with an image that is an animation: picture lines and pauses that animate it wherever it is shown.同时更改Changes another property in the step before, so the two change together: a move and a fade at once.属性动画Animates a property to a value over some seconds, eased by a warper.动画块A timeline nested in this one, so a repeat inside it loops only that part.从脚本生成动画An animation written as a script's animation block, one statement per line.动画转为脚本An animation as a script writes it.在指定时间What follows starts this many seconds after the animation began, cutting short what was running.调用变换函数Hands the image to a function the game registers for animations, for as long as the function lasts.从中随机选择One of two or three timelines, picked at random by weight each time the animation gets here; the same moment of the same shown image always picks the same.包含图片A picture drawn inside this one with a timeline of its own, placed within it: sparkles over a lantern.定义变换A story with a transform: an animation a show's at can name, which may take parameters.包含变换Runs another transform in place, such as left or one the story defines.并行Timelines that run at the same time, each animating its own properties: a bob while fading in.响应事件What the image does when it is shown, replaced or hidden.重复Starts the timeline (or the block it is in) again: a number of times, or forever when 0.设置属性Sets a property at once.显示图片From here on the image shows this picture, cross-fading over a transition's length if one is given: frames of a blink, a candle, a waving flag.开始动画An empty timeline to build on.等待Waits before the next step.

效果

故事变量

图像

游戏定义

选项

场景

转场

Novella 应用

样式

角色