元編程參考文件

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 應用

樣式

角色