Naninovel 中文文档

#API 参考

脚本命令 API 参考。使用侧栏在可用命令之间快速导航。

删除线表示无名参数,粗体表示必填参数;其他参数应该被认为是可选的。如果您不知道这是怎么回事,请查阅naninovel 脚本指南

所有脚本命令都支持以下参数:

IDType描述Description
ifString一个布尔脚本表达式,控制命令是否应该执行。A boolean script expression, controlling whether the command should execute.
waitBoolean脚本播放器是否应该等待异步命令完成执行,然后再执行下一个命令。立即执行命令时无效。Whether the script player should wait for the async command to finish execution before executing the next one. Has no effect when the command is executed instantly.

注意

此 API 参考适用于Naninovel v1.17

#animate

#概括

通过关键帧为具有指定 ID 的演员的属性设置动画。动画参数的关键帧用|文字分隔。

#评论

请注意,此命令在所有参与者管理器中搜索具有提供的 ID 的参与者,并且如果存在具有相同 ID 的多个参与者(例如,一个角色和一个文本打印机),这将只影响第一个找到的参与者。

当并行运行动画命令(wait设置为 false)时,受影响的 Actor 状态可能会发生不可预测的变化。当回滚或执行其他影响actor状态的命令时,这可能会导致意外结果。确保在命令完成后重置动画演员的受影响属性(位置、色调、外观等)或使用@animate CharacterId(不带任何参数)过早停止动画。

#参数
IDType描述Description
actorIdsstring list要设置动画的演员的 ID。IDs of the actors to animate.
loopboolean是否循环动画;wait启用循环时确保设置为 false,否则脚本播放将无限循环。Whether to loop the animation; make sure to set wait to false when loop is enabled, otherwise script playback will loop indefinitely.
appearancestring为动画演员设置的外观。Appearances to set for the animated actors.
transitionstring动画外观更改时使用的过渡效果类型(默认使用交叉淡入淡出)。Type of the transition effect to use when animating appearance change (crossfade is used by default).
visibilitystring为动画演员设置的可见性状态。Visibility status to set for the animated actors.
posXstringX 轴上的位置值(在 0 到 100 范围内,以场景左边界的百分比为单位)为动画演员设置。Position values over X-axis (in 0 to 100 range, in percents from the left border of the scene) to set for the animated actors.
posYstring为动画演员设置 Y 轴上的位置值(范围为 0 到 100,以场景底部边框的百分比表示)。Position values over Y-axis (in 0 to 100 range, in percents from the bottom border of the scene) to set for the animated actors.
posZstring为动画演员设置 Z 轴上的位置值(在世界空间中);在正交模式下,只能用于排序。Position values over Z-axis (in world space) to set for the animated actors; while in ortho mode, can only be used for sorting.
rotationstring为动画演员设置的旋转值(在 Z 轴上)。Rotation values (over Z-axis) to set for the animated actors.
scalestringx,y,z为动画演员设置的比例(或单个统一值)。Scale (x,y,z or a single uniform value) to set for the animated actors.
tintstring为动画演员设置的色调。
以开头的字符串#将按以下方式解析为十六进制:#RGB(变成 RRGGBB), #RRGGBB, #RGBA(变成 RRGGBBAA), #RRGGBBAA; 未指定 alpha 时将默认为 FF。
不以开头的字符串#将被解析为文字颜色,支持以下颜色:红色、青色、蓝色、深蓝色、浅蓝色、紫色、黄色、石灰、紫红色、白色、银色、灰色、黑色、橙色、棕色、栗色、绿色、橄榄色、海军蓝、蓝绿色、浅绿色、洋红色。
Tint colors to set for the animated actors.
Strings that begin with # will be parsed as hexadecimal in the following way: #RGB (becomes RRGGBB), #RRGGBB, #RGBA (becomes RRGGBBAA), #RRGGBBAA; when alpha is not specified will default to FF.
Strings that do not begin with # will be parsed as literal colors, with the following supported: red, cyan, blue, darkblue, lightblue, purple, yellow, lime, fuchsia, white, silver, grey, black, orange, brown, maroon, green, olive, navy, teal, aqua, magenta.
easingstring用于动画的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Names of the easing functions to use for the animations.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timestring每个键的动画持续时间,以秒为单位。当缺少键值时,将使用前一个键中的一个。未分配时,将为所有键使用 0.35 秒的持续时间。Duration of the animations per key, in seconds. When a key value is missing, will use one from a previous key. When not assigned, will use 0.35 seconds duration for all keys.
#例子
; Animate `Kohaku` actor over three animation steps (key frames),
; changing positions: first step will take 1, second — 0.5 and third — 3 seconds.
@animate Kohaku posX:50|0|85 time:1|0.5|3

; Start loop animations of `Yuko` and `Kohaku` actors; notice, that you can skip
; key values indicating that the parameter shouldn't change during the animation step.
@animate Kohaku,Yuko loop:true appearance:Surprise|Sad|Default|Angry transition:DropFade|Ripple|Pixelate posX:15|85|50 posY:0|-25|-85 scale:1|1.25|1.85 tint:#25f1f8|lightblue|#ffffff|olive easing:EaseInBounce|EaseInQuad time:3|2|1|0.5 wait:false
...
; Stop the animations.
@animate Yuko,Kohaku loop:false

; Start a long background animation for `Kohaku`.
@animate Kohaku posX:90|0|90 scale:1|2|1 time:10 wait:false
; Do something else while the animation is running.
...
; Here we're going to set a specific position for the character,
; but the animation could still be running in background, so reset it first.
@animate Kohaku
; Now it's safe to modify previously animated properties.
@char Kohaku pos:50 scale:1

#append

#概括

将提供的文本附加到文本打印机。

#评论

整个文本将立即附加,不会触发显示效果或任何其他副作用。

#参数
IDType描述Description
textstring要附加的文本。The text to append.
printerstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a a default one when not provided.
authorstring演员的 ID,应该与附加的文本相关联。ID of the actor, which should be associated with the appended text.
#例子
; Print first part of the sentence as usual (gradually revealing the message),
; then append the end of the sentence at once.
Lorem ipsum
@append " dolor sit amet."

# arrange

#概括

按 X 轴排列指定字符。未提供参数时,将执行自动排列,按 X 轴均匀分布可见字符。

#参数
IDType描述Description
characterPositionsnamed decimal list角色 ID 到场景 X 轴位置(相对于场景左边界,以百分比为单位)命名值的集合。位置 0 与场景的左边界相关,100 与场景的右边界相关;50是中心。A collection of character ID to scene X-axis position (relative to the left scene border, in percents) named values. Position 0 relates to the left border and 100 to the right border of the scene; 50 is the center.
lookboolean执行自动排列时,控制是否也让角色看着场景原点(默认启用)。When performing auto-arrange, controls whether to also make the characters look at the scene origin (enabled by default).
timedecimal排列动画的持续时间(以秒为单位)。Duration (in seconds) of the arrangement animation.
#例子
; Evenly distribute all the visible characters.
@arrange

; Place character with ID `Jenna` 15%, `Felix` 50% and `Mia` 85% away
; from the left border of the scene.
@arrange Jenna.15,Felix.50,Mia.85

#back

#概括

修改背景演员

#评论

背景的处理与角色略有不同,以更好地适应传统的 VN 游戏流程。大多数时候,场景中可能只有一个背景演员,他们会不断地转换到不同的外观。为了消除在脚本中重复相同演员 ID 的麻烦,可以只提供背景外观和过渡类型(可选)作为无名参数,假设MainBackground演员应该受到影响。如果不是这种情况,则可以通过id参数显式提供后台参与者的 ID 。

#参数
IDType描述Description
appearanceAndTransitionnamed string为修改后的背景和要使用的过渡效果类型设置的外观(或姿势)。当没有提供过渡时,默认使用交叉淡入淡出效果。Appearance (or pose) to set for the modified background and type of a transition effect to use. When transition is not provided, a cross-fade effect will be used by default.
posdecimal list为修改后的actor设置的位置(相对于场景边界,以百分比为单位)。位置描述如下:0,0是左下角,50,50是中心,100,100是场景的右上角。,10在正交模式下,使用 Z 分量(第三个成员,例如)按深度移动(排序)。Position (relative to the scene borders, in percents) to set for the modified actor. Position is described as follows: 0,0 is the bottom left, 50,50 is the center and 100,100 is the top right corner of the scene. Use Z-component (third member, eg ,10) to move (sort) by depth while in ortho mode.
idstring要修改的actor的ID;指定*影响所有可见的演员。ID of the actor to modify; specify * to affect all visible actors.
appearancestring为修改后的演员设置外观。Appearance to set for the modified actor.
posestring为修改后的演员设置姿势。Pose to set for the modified actor.
transitionstring要使用的过渡效果类型(默认使用交叉淡入淡出)。Type of the transition effect to use (crossfade is used by default).
paramsdecimal list过渡效果的参数。Parameters of the transition effect.
dissolvestring路径的自定义溶解质地(路径应该是相对于Resources文件夹)。仅当转换设置为Custom模式时才有效。Path to the custom dissolve texture (path should be relative to a Resources folder). Has effect only when the transition is set to Custom mode.
visibleboolean为修改后的actor设置的可见性状态。Visibility status to set for the modified actor.
positiondecimal list为修改后的actor设置的位置(在世界空间中)。在正交模式下,使用 Z 分量(第三个成员)按深度移动(排序)。Position (in world space) to set for the modified actor. Use Z-component (third member) to move (sort) by depth while in ortho mode.
rotationdecimal list为修改后的actor设置的旋转。Rotation to set for the modified actor.
scaledecimal list为修改后的actor设置缩放。Scale to set for the modified actor.
tintstring为修改后的actor设置的色调。
以 开头的字符串#将按以下方式解析为十六进制:#RGB(变成 RRGGBB), #RRGGBB, #RGBA(变成 RRGGBBAA), #RRGGBBAA; 未指定 alpha 时将默认为 FF。
不以开头的字符串#将被解析为文字颜色,支持以下颜色:红色、青色、蓝色、深蓝色、浅蓝色、紫色、黄色、石灰、紫红色、白色、银色、灰色、黑色、橙色、棕色、栗色、绿色、橄榄色、海军蓝、蓝绿色、浅绿色、洋红色。
Tint color to set for the modified actor.
Strings that begin with # will be parsed as hexadecimal in the following way: #RGB (becomes RRGGBB), #RRGGBB, #RGBA (becomes RRGGBBAA), #RRGGBBAA; when alpha is not specified will default to FF.
Strings that do not begin with # will be parsed as literal colors, with the following supported: red, cyan, blue, darkblue, lightblue, purple, yellow, lime, fuchsia, white, silver, grey, black, orange, brown, maroon, green, olive, navy, teal, aqua, magenta.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Name of the easing function to use for the modification.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Set `River` as the appearance of the main background.
@back River

; Same as above, but also use a `RadialBlur` transition effect.
@back River.RadialBlur

; Position `Smoke` background at the center of the screen
; and scale it 50% of the original size.
@back id:Smoke pos:50,50 scale:0.5

; Tint all visible backgrounds on scene.
@back id:* tint:#ffdc22

#bgm

#概括

使用提供的名称播放或修改当前播放的BGM(背景音乐)曲目。

#评论

音乐曲目默认循环播放。未指定音乐曲目名称(BgmPath)时,将影响当前播放的所有曲目。当为已经播放的曲目调用时,播放不会受到影响(曲目不会从头开始播放),但会应用指定的参数(音量和曲目是否循环播放)。

#参数
IDType描述Description
bgmPathstring要播放的音乐曲目的路径。Path to the music track to play.
introstring在主曲目之前播放一次的介绍音乐曲目的路径(不受循环参数的影响)。Path to the intro music track to play once before the main track (not affected by the loop parameter).
volumedecimal音乐曲目的音量。Volume of the music track.
loopboolean曲目结束时是否从头开始播放。Whether to play the track from beginning when it finishes.
fadedecimal开始播放时音量淡入的持续时间,以秒为单位(默认为 0.0);修改播放曲目时无效。Duration of the volume fade-in when starting playback, in seconds (0.0 by default); doesn’t have effect when modifying a playing track.
groupstring播放音频时应使用的混音器组路径。Audio mixer group path that should be used when playing the audio.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Starts playing a music track with the name `Sanctuary` in a loop.
@bgm Sanctuary

; Same as above, but fades-in the volume over 10 seconds and plays only once.
@bgm Sanctuary fade:10 loop:false

; Changes volume of all the played music tracks to 50% over 2.5 seconds
; and makes them play in a loop.
@bgm volume:0.5 loop:true time:2.5

; Plays `BattleThemeIntro` once and then immediately `BattleThemeMain` in a loop.
@bgm BattleThemeMain intro:BattleThemeIntro

#br

#概括

向文本打印机添加换行符。

#评论

考虑使用<br>标签代替TMPro 打印机

#参数
IDType描述Description
countinteger要添加的换行符数。Number of line breaks to add.
printerstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
authorstring演员的 ID,应该与附加的换行符相关联。ID of the actor, which should be associated with the appended line break.
#例子
; Second sentence will be printed on a new line.
Lorem ipsum dolor sit amet.[br]Consectetur adipiscing elit.

; Second sentence will be printer two lines under the first one.
Lorem ipsum dolor sit amet.[br 2]Consectetur adipiscing elit.

#camera

#概括

修改主摄像机,随时间改变偏移、缩放级别和旋转。查看此视频以快速演示命令效果。

#参数
IDType描述Description
offsetdecimal list以 X、Y、Z 轴为单位的本地摄像机位置偏移量。Local camera position offset in units by X,Y,Z axes.
rolldecimalZ 轴的局部相机旋转角度(0.0 到 360.0 或 -180.0 到 180.0)。同rotation参数第三部分;rotation指定时忽略。Local camera rotation by Z-axis in angle degrees (0.0 to 360.0 or -180.0 to 180.0). The same as third component of rotation parameter; ignored when rotation is specified.
rotationdecimal listX、Y、Z 轴上的局部相机旋转角度(0.0 到 360.0 或 -180.0 到 180.0)。Local camera rotation over X,Y,Z-axes in angle degrees (0.0 to 360.0 or -180.0 to 180.0).
zoomdecimal相对相机缩放(正交大小或视野,取决于渲染模式),在 0.0(无缩放)到 1.0(完全缩放)范围内。Relative camera zoom (orthographic size or field of view, depending on the render mode), in 0.0 (no zoom) to 1.0 (full zoom) range.
orthoboolean相机应该以正交(true)还是透视(false)模式渲染。Whether the camera should render in orthographic (true) or perspective (false) mode.
togglestring list要切换的组件的名称(如果禁用则启用,反之亦然)。组件应附加到与相机相同的游戏对象。这可用于切换自定义后处理效果。使用*影响到所有连接到相机对象的组件。Names of the components to toggle (enable if disabled and vice-versa). The components should be attached to the same game object as the camera. This can be used to toggle custom post-processing effects. Use * to affect all the components attached to the camera object.
setnamed boolean list要启用或禁用的组件的名称。组件应附加到与相机相同的游戏对象。这可用于显式启用或禁用自定义后处理效果。指定的组件启用状态将覆盖toggle参数的影响。使用*影响到所有连接到相机对象的组件。Names of the components to enable or disable. The components should be attached to the same game object as the camera. This can be used to explicitly enable or disable custom post-processing effects. Specified components enabled state will override effect of toggle parameter. Use * to affect all the components attached to the camera object.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
未指定时,将使用在相机配置设置中设置的默认缓动功能。
Name of the easing function to use for the modification.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the camera configuration settings.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Offset over X-axis (pan) the camera by -3 units and offset over Y-axis by 1.5 units.
@camera offset:-3,1.5

; Set camera in perspective mode, zoom-in by 50% and move back by 5 units.
@camera ortho:false offset:,,-5 zoom:0.5

; Set camera in orthographic mode and roll by 10 degrees clock-wise.
@camera ortho:true roll:10

; Offset, zoom and roll simultaneously animated over 5 seconds.
@camera offset:-3,1.5 zoom:0.5 roll:10 time:5

; Instantly reset camera to the default state.
@camera offset:0,0 zoom:0 rotation:0,0,0 time:0

; Toggle `FancyCameraFilter` and `Bloom` components attached to the camera.
@camera toggle:FancyCameraFilter,Bloom

; Set `FancyCameraFilter` component enabled and `Bloom` disabled.
@camera set:FancyCameraFilter.true,Bloom.false

; Disable all components attached to the camera object.
@camera set:*.false

#char

#概括

修改角色 actor

#参数
IDType描述Description
idAndAppearancenamed string要修改的角色 ID(指定*影响所有可见角色)和要设置的外观(或姿势)。当没有提供外观时,将使用Default(存在)或随机的。ID of the character to modify (specify * to affect all visible characters) and an appearance (or pose) to set. When appearance is not provided, will use either a Default (is exists) or a random one.
lookstring看演员的方向;支持的值:左、右、中。Look direction of the actor; supported values: left, right, center.
avatarstring要为角色指定的头像纹理的名称(路径)。用于none从角色中移除(取消分配)头像纹理。Name (path) of the avatar texture to assign for the character. Use none to remove (un-assign) avatar texture from the character.
posdecimal list为修改后的actor设置的位置(相对于场景边界,以百分比为单位)。位置描述如下:0,0是左下角,50,50是中心,100,100是场景的右上角。,10在正交模式下,使用 Z 分量(第三个成员,例如)按深度移动(排序)。Position (relative to the scene borders, in percents) to set for the modified actor. Position is described as follows: 0,0 is the bottom left, 50,50 is the center and 100,100 is the top right corner of the scene. Use Z-component (third member, eg ,10) to move (sort) by depth while in ortho mode.
idstring要修改的actor的ID;指定*影响所有可见的演员。ID of the actor to modify; specify * to affect all visible actors.
appearancestring为修改后的演员设置外观。Appearance to set for the modified actor.
posestring为修改后的演员设置姿势。Pose to set for the modified actor.
transitionstring要使用的过渡效果类型(默认使用交叉淡入淡出)。Type of the transition effect to use (crossfade is used by default).
paramsdecimal list过渡效果的参数。Parameters of the transition effect.
dissolvestring路径的自定义溶解质地(路径应该是相对于Resources文件夹)。仅当转换设置为Custom模式时才有效。Path to the custom dissolve texture (path should be relative to a Resources folder). Has effect only when the transition is set to Custom mode.
visibleboolean为修改后的actor设置的可见性状态。Visibility status to set for the modified actor.
positiondecimal list为修改后的actor设置的位置(在世界空间中)。在正交模式下,使用 Z 分量(第三个成员)按深度移动(排序)。Position (in world space) to set for the modified actor. Use Z-component (third member) to move (sort) by depth while in ortho mode.
rotationdecimal list为修改后的actor设置的旋转。Rotation to set for the modified actor.
scaledecimal list为修改后的actor设置缩放。Scale to set for the modified actor.
tintstring为修改后的actor设置的色调。
以 开头的字符串#将按以下方式解析为十六进制:#RGB(变成 RRGGBB), #RRGGBB, #RGBA(变成 RRGGBBAA), #RRGGBBAA; 未指定 alpha 时将默认为 FF。
不以开头的字符串#将被解析为文字颜色,支持以下颜色:红色、青色、蓝色、深蓝色、浅蓝色、紫色、黄色、石灰、紫红色、白色、银色、灰色、黑色、橙色、棕色、栗色、绿色、橄榄色、海军蓝、蓝绿色、浅绿色、洋红色。
Tint color to set for the modified actor.
Strings that begin with # will be parsed as hexadecimal in the following way: #RGB (becomes RRGGBB), #RRGGBB, #RGBA (becomes RRGGBBAA), #RRGGBBAA; when alpha is not specified will default to FF.
Strings that do not begin with # will be parsed as literal colors, with the following supported: red, cyan, blue, darkblue, lightblue, purple, yellow, lime, fuchsia, white, silver, grey, black, orange, brown, maroon, green, olive, navy, teal, aqua, magenta.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Name of the easing function to use for the modification.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Shows character with ID `Sora` with a default appearance.
@char Sora

; Same as above, but sets appearance to `Happy`.
@char Sora.Happy

; Same as above, but also positions the character 45% away from the left border
; of the scene and 10% away from the bottom border; also makes him look to the left.
@char Sora.Happy look:left pos:45,10

; Make Sora appear at the bottom-center and in front of Felix.
@char Sora pos:50,0,-1
@char Felix pos:,,0

; Tint all visible characters on scene.
@char * tint:#ffdc22

#choice

#概括

增加了选择选项,以与指定的ID(或默认的一个)一个选择处理程序。

#评论

goto,gosubdo参数未指定时,将从下一个脚本行继续执行脚本。

#参数
IDType描述Description
choiceSummarystring为选择显示的文本。当文本包含空格时,将其用双引号 ( ")括起来。如果您希望在文本本身中包含双引号,请将它们转义。Text to show for the choice. When the text contain spaces, wrap it in double quotes ("). In case you wish to include the double quotes in the text itself, escape them.
buttonstring表示选择Resources的按钮预制的路径(相对于文件夹)。预制件应该有一个ChoiceHandlerButton附加到根对象的组件。未提供时将使用默认按钮。Path (relative to a Resources folder) to a button prefab representing the choice. The prefab should have a ChoiceHandlerButton component attached to the root object. Will use a default button when not provided.
posdecimal list选择处理程序中选择按钮的本地位置(如果处理程序实现支持)。Local position of the choice button inside the choice handler (if supported by the handler implementation).
handlerstring要为其添加选项的选项处理程序的 ID。如果未提供,将使用默认处理程序。ID of the choice handler to add choice for. Will use a default handler if not provided.
gotonamed string用户选择选项时要走的路径;@goto有关路径格式,请参见命令。Path to go when the choice is selected by user; see @goto command for the path format.
gosubnamed string用户选择选项时要执行的子程序的路径;@gosub有关路径格式,请参见命令。何时goto分配此参数将被忽略。Path to a subroutine to go when the choice is selected by user; see @gosub command for the path format. When goto is assigned this parameter will be ignored.
setstring设置用户选择选项时执行的表达式;@set有关语法参考,请参见命令。Set expression to execute when the choice is selected by user; see @set command for syntax reference.
dostring list当用户选择选项时执行脚本命令。在列表值中转义逗号以防止它们被视为分隔符。这些命令将在 之后按顺序调用set,goto并被gosub处理(如果已分配)。Script commands to execute when the choice is selected by user. Escape commas inside list values to prevent them being treated as delimiters. The commands will be invoked in order after set, goto and gosub are handled (if assigned).
playboolean不指定goto或gosub不指定参数时,是否自动从下一行继续播放脚本。如果在处理选择时脚本已经在播放,则无效。Whether to automatically continue playing script from the next line, when neither goto nor gosub parameters are specified. Has no effect in case the script is already playing when the choice is processed.
showboolean是否还显示添加选项的选项处理程序;默认启用。Whether to also show choice handler the choice is added for; enabled by default.
timedecimal淡入(显示)动画的持续时间(以秒为单位)。Duration (in seconds) of the fade-in (reveal) animation.
#例子
; Print the text, then immediately show choices and stop script execution.
Continue executing this script or ...?[skipInput]
@choice "Continue"
@choice "Load another script from start" goto:AnotherScript
@choice "Load another script from \"MyLabel\" label" goto:AnotherScript.MyLabel
@choice "Goto to \"MySub\" subroutine in another script" gosub:AnotherScript.MySub
@stop

; You can also set custom variables based on choices.
@choice "I'm humble, one is enough..." set:score++
@choice "Two, please." set:score=score+2
@choice "I'll take the entire stock!" set:karma--;score=999

; Play a sound effect and arrange characters when choice is picked.
@choice Arrange do:"@sfx Click, @arrange k.10\,y.55"

; Print a text line corresponding to the picked choice.
@choice "Ask about color" do:"What's your favorite color?"
@choice "Ask about age" do:"How old are you?"
@choice "Keep silent" do:"..."
@stop

#clearBacklog

#概括

打印机积压中删除所有消息。

#例子
; Even though we're going to print some text, it will then be removed from the backlog.
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
@clearBacklog

#clearChoice

#概括

使用提供的 ID 删除选项处理程序中的所有选项选项(或在默认选项中,当未指定 ID 时;或在所有现有处理程序中,当*指定为 ID 时)并(可选)隐藏它(它们)。

#参数
IDType描述Description
handlerIdstring要清除的选择处理程序的 ID。如果未提供,将使用默认处理程序。指定*清除所有现有的处理程序。ID of the choice handler to clear. Will use a default handler if not provided. Specify * to clear all the existing handlers.
hideboolean是否也隐藏受影响的选择处理程序。Whether to also hide the affected choice handlers.
#例子
; Give the player 2 seconds to pick a choice.
# Start
You have 2 seconds to respond![skipInput]
@choice Cats goto:.PickedChoice
@choice Dogs goto:.PickedChoice
@wait 2
@clearChoice
Too late!
@stop
# PickedChoice
Good!

#despawn

#概括

销毁使用@spawn命令生成的对象。

#评论

如果 prefab 有一个MonoBehaviour组件附加了根对象,并且该组件实现了一个IParameterized接口,将params在销毁该对象之前传递指定的值;如果组件实现了IAwaitable接口,命令执行将在销毁对象之前等待实现返回的异步完成任务。

#参数
IDType描述Description
pathstring要销毁的预制资源的名称(路径)。阿@spawn具有相同参数的命令预期之前被执行。Name (path) of the prefab resource to destroy. A @spawn command with the same parameter is expected to be executed before.
paramsstring list销毁预制件之前要设置的参数。要求预制件有一个IParameterized附加到根对象的组件。Parameters to set before destroying the prefab. Requires the prefab to have a IParameterized component attached the root object.
#例子
; Given a `@spawn Rainbow` command was executed before.
@despawn Rainbow

#else

#概括

标记条件执行块的一个分支,它总是在打开条件@if和所有前面的@elseif(如果有的话)命令不满足的情况下执行。有关使用示例,请参阅条件执行指南。

#elseIf

#概括

标记条件执行块的分支,在满足自身条件(表达式被评估为真)的情况下执行,而打开条件@if和所有前面的@elseif(如果有的话)命令不满足。有关使用示例,请参阅条件执行指南。

#参数
IDType描述Description
expressionstring一个脚本表达式,它应该返回一个布尔值。A script expression, which should return a boolean value.

#endIf

#概括

关闭@if条件执行块。有关使用示例,请参阅条件执行指南。

#finishTrans

#概括

完成以@startTrans命令开始的场景转换;有关更多信息和使用示例,请参阅启动命令参考。

#参数
IDType描述Description
transitionstring要使用的过渡效果类型(默认使用交叉淡入淡出)。Type of the transition effect to use (crossfade is used by default).
paramsdecimal list过渡效果的参数。Parameters of the transition effect.
dissolvestring路径的自定义溶解质地(路径应该是相对于Resources文件夹)。仅当转换设置为Custom模式时才有效。Path to the custom dissolve texture (path should be relative to a Resources folder). Has effect only when the transition is set to Custom mode.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Name of the easing function to use for the modification.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timedecimal过渡的持续时间(以秒为单位)。Duration (in seconds) of the transition.

#gosub

#概括

将 naninovel 脚本播放导航到提供的路径并将该路径保存到全局状态;@return在最后一次调用 gosub 命令之后,命令使用此信息重定向到命令。

#评论

设计用作编程语言中的函数(子例程),允许重用一段 naninovel 脚本。可以在当前播放的脚本之外声明一个 gosub 并从任何其他脚本中使用它,这对于多次调用一组重复的命令很有用。

#参数
IDType描述Description
pathnamed string以以下格式导航到的路径:ScriptName.LabelName. 省略标签名称时,将从头开始播放提供的脚本。当省略脚本名称时,将尝试在当前播放的脚本中查找标签。Path to navigate into in the following format: ScriptName.LabelName. When label name is omitted, will play provided script from the start. When script name is omitted, will attempt to find a label in the currently played script.
resetstring list指定后,将在加载脚本之前重置引擎服务状态(以防路径指向另一个脚本)。指定*重置所有服务,或指定要从重置中排除的服务名称。默认情况下,状态不会重置。When specified, will reset the engine services state before loading a script (in case the path is leading to another script). Specify * to reset all the services, or specify service names to exclude from reset. By default, the state does not reset.
#例子
; Navigate the playback to the label `VictoryScene` in the currently played script,
; executes the commands and navigates back to the command after the `gosub`.
@gosub .VictoryScene
...
@stop
# VictoryScene
@back Victory
@sfx Fireworks
@bgm Fanfares
You are victorious!
@return

; Another example with some branching inside the subroutine.
@set time=10
; Here we get one result.
@gosub .Room
...
@set time=3
; And here we get another.
@gosub .Room
@stop
# Room
@print "It's too early, I should visit this place when it's dark." if:time<21&time>6
@print "I can sense an ominous presence!" if:time>21|time<6
@return

#goto

#概括

将 naninovel 脚本播放导航到提供的路径。

#参数
IDType描述Description
pathnamed string以以下格式导航到的路径:ScriptName.LabelName. 省略标签名称时,将从头开始播放提供的脚本。当省略脚本名称时,将尝试在当前播放的脚本中查找标签。Path to navigate into in the following format: ScriptName.LabelName. When label name is omitted, will play provided script from the start. When script name is omitted, will attempt to find a label in the currently played script.
resetstring list指定时,将控制是否在加载脚本之前重置引擎服务状态(如果路径通向另一个脚本):
- 指定*重置所有服务,除了具有Goto.DontReset属性的服务。
- 指定要从重置中排除的服务类型名称(以逗号分隔);所有其他服务将被重置,包括具有Goto.DontReset属性的服务。
- 指定-强制不重置(即使它在配置中默认启用)。
请注意,虽然某些服务已Goto.DontReset应用属性并且默认情况下不会重置,但在从重置中排除特定服务时仍应指定它们。
When specified, will control whether to reset the engine services state before loading a script (in case the path is leading to another script):
- Specify * to reset all the services, except the ones with Goto.DontReset attribute.
- Specify service type names (separated by comma) to exclude from reset; all the other services will be reset, including the ones with Goto.DontReset attribute.
- Specify - to force no reset (even if it’s enabled by default in the configuration).
Notice, that while some services have Goto.DontReset attribute applied and are not reset by default, they should still be specified when excluding specific services from reset.
#例子
; Loads and starts playing a naninovel script with the name `Script001` from the start.
@goto Script001

; Save as above, but start playing from the label `AfterStorm`.
@goto Script001.AfterStorm

; Navigates the playback to the label `Epilogue` in the currently played script.
@goto .Epilogue
...
# Epilogue
...

#hide

#概括

隐藏(移除)具有指定 ID 的参与者(角色、背景、文本打印机、选择处理程序)。如果找到具有相同 ID 的多个参与者(例如,角色和打印机),将仅影响找到的第一个参与者。

#参数
IDType描述Description
actorIdsstring list要隐藏的演员的 ID。IDs of the actors to hide.
timedecimal淡入淡出动画的持续时间(以秒为单位)。Duration (in seconds) of the fade animation.
removeboolean隐藏后是否移除(销毁)actor。用于卸载与参与者关联的资源并防止内存泄漏。Whether to remove (destroy) the actor after it’s hidden. Use to unload resources associated with the actor and prevent memory leaks.
#例子
; Given an actor with ID `Smoke` is visible, hide (fade-out) it over 3 seconds.
@hide Smoke time:3

; Hide `Kohaku` and `Yuko` actors.
@hide Kohaku,Yuko

; Hide and remove `Kohaku` actor.
@hide Kohaku remove:true

#hideAll

#概括

隐藏(移除)场景中的所有演员(角色、背景、文本打印机、选择处理程序)。

#参数
IDType描述Description
timedecimal淡入淡出动画的持续时间(以秒为单位)。Duration (in seconds) of the fade animation.
removeboolean隐藏后是否移除(销毁)actor。用于卸载与参与者相关的资源并防止内存泄漏。Whether to remove (destroy) the actors after they are hidden. Use to unload resources associated with the actors and prevent memory leaks.
#例子
; Hide all the visible actors (chars, backs, printers, choice handlers) on scene.
@hideAll

; Same as above, but also remove all the actors after they're hidden.
@hideAll remove:true

#hideChars

#概括

隐藏(移除)场景中所有可见的角色。

#参数
IDType描述Description
timedecimal淡入淡出动画的持续时间(以秒为单位)。Duration (in seconds) of the fade animation.
removeboolean隐藏后是否移除(销毁)角色。用于卸载与字符相关的资源并防止内存泄漏。Whether to remove (destroy) the characters after they are hidden. Use to unload resources associated with the characters and prevent memory leaks.
#例子
; Hide all the visible character actors on scene.
@hideChars

#hidePrinter

#概括

隐藏文本打印机。

#参数
IDType描述Description
printerIdstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
timedecimal隐藏动画的持续时间(以秒为单位)。每个打印机的默认值在参与者配置中设置。Duration (in seconds) of the hide animation. Default value for each printer is set in the actor configuration.
#例子
; Hide a default printer.
@hidePrinter

; Hide printer with ID `Wide`.
@hidePrinter Wide

#hideUI

#概括

使具有指定名称的UI 元素不可见。当未指定名称时,将停止渲染(隐藏)整个 UI(包括所有内置 UI)。

#评论

当使用此命令和allowToggle参数隐藏整个 UI为 false(默认)时,用户将无法使用热键或单击屏幕上的任意位置重新显示 UI;使用@showUI命令使 UI 再次可见。

#参数
IDType描述Description
uINamesstring list要隐藏的 UI 元素的名称。Name of the UI elements to hide.
allowToggleboolean隐藏整个 UI 时,控制是否允许用户使用热键或单击屏幕上的任意位置重新显示 UI(默认为 false)。隐藏特定 UI 时无效。When hiding the entire UI, controls whether to allow the user to re-show the UI with hotkeys or by clicking anywhere on the screen (false by default). Has no effect when hiding a particular UI.
timedecimal隐藏动画的持续时间(以秒为单位)。未指定时,将使用特定于 UI 的持续时间。Duration (in seconds) of the hide animation. When not specified, will use UI-specific duration.
#例子
; Given a custom `Calendar` UI, the following command will hide it.
@hideUI Calendar

; Hide the entire UI, won't allow user to re-show it.
@hideUI
...
; Make the UI visible again.
@showUI

; Hide the entire UI, but allow the user to toggle it back.
@hideUI allowToggle:true

; Simultaneously hide built-in `TipsUI` and custom `Calendar` UIs.
@hideUI TipsUI,Calendar

#i

#概括

保持脚本执行,直到用户激活continue输入。的快捷方式@wait i

#例子
; User will have to activate a `continue` input after the first sentence
; for the printer to continue printing out the following text.
Lorem ipsum dolor sit amet.[i] Consectetur adipiscing elit.

#if

#概括

标记条件执行块的开始。应始终使用@endif命令关闭。有关使用示例,请参阅条件执行指南。

#参数
IDType描述Description
expressionstring一个脚本表达式,它应该返回一个布尔值。A script expression, which should return a boolean value.

#input

#概括

显示一个输入字段 UI,用户可以在其中输入任意文本。提交后,输入的文本将分配给指定的自定义变量。

#评论

查看有关使用示例的视频指南

要使用此命令为字符分配显示名称,请考虑将名称绑定到自定义变量

#参数
IDType描述Description
variableNamestring将分配输入文本的自定义变量的名称。Name of a custom variable to which the entered text will be assigned.
summarystring与输入字段一起显示的可选摘要文本。当文本包含空格时,将其用双引号 ( ")括起来。如果您希望在文本本身中包含双引号,请将它们转义。An optional summary text to show along with input field. When the text contain spaces, wrap it in double quotes ("). In case you wish to include the double quotes in the text itself, escape them.
valuestring为输入字段设置的预定义值。A predefined value to set for the input field.
playboolean用户提交输入表单时是否自动恢复脚本播放。Whether to automatically resume script playback when user submits the input form.
#例子
; Allow player to enter an arbitrary text and assign it to `name` custom state variable.
@input name summary:"Choose your name."
; Stop command is required to halt script execution until user submits the input.
@stop

; You can then inject the assigned `name` variable in naninovel scripts.
Archibald: Greetings, {name}!
{name}: Yo!

; ...or use it inside set and conditional expressions.
@set score=score+1 if:name=="Felix"

#lipSync

#概括

允许为具有提供的 ID 的角色强制停止口型同步动画;停止时,动画不会再次开始,直到再次使用此命令允许它。角色应该能够接收口型同步事件(目前仅通用、分层和 Live2D 实现)。有关唇形同步功能的更多信息,请参阅字符指南

#参数
IDType描述Description
charIdAndAllownamed boolean角色 ID 后跟一个布尔值(true 或 false),决定是否停止或允许对口型动画。Character ID followed by a boolean (true or false) on whether to halt or allow the lip sync animation.
#例子
; Given auto voicing is disabled and lip sync is driven by text messages,
; exclude punctuation from the mouth animation.
Kohaku: Lorem ipsum dolor sit amet[lipSync Kohaku.false]... [lipSync Kohaku.true]Consectetur adipiscing elit.

#loadScene

#概括

使用提供的名称加载Unity 场景。不要忘记将所需的场景添加到构建设置中以使它们可用于加载。

#参数
IDType描述Description
sceneNamestring要加载的场景的名称。Name of the scene to load.
additiveboolean是否添加加载场景,或者在加载新场景之前卸载任何当前加载的场景(默认)。有关详细信息,请参阅加载场景文档。Whether to load the scene additively, or unload any currently loaded scenes before loading the new one (default). See the load scene documentation for more information.
#例子
; Load scene `TestScene1` in single mode.
@loadScene TestScene1

; Load scene `TestScene2` in additive mode.
@loadScene TestScene2 additive:true

#lock

#概括

将具有提供的 ID的可解锁项目设置为locked状态。

#评论

项目的解锁状态存储在全局范围内
如果提供 ID 的 item 没有在全局状态图中注册,则会自动添加相应的记录。

#参数
IDType描述Description
idstring可解锁项目的 ID。使用*锁定所有已注册的解锁项目。ID of the unlockable item. Use * to lock all the registered unlockable items.
#例子
; Lock an unlockable CG record with ID `FightScene1`.
@lock CG/FightScene1

#look

#概括

当玩家可以使用输入设备(例如,通过移动鼠标或使用游戏手柄模拟摇杆)偏移主相机时,激活/禁用相机外观模式。查看此视频以快速演示该命令。

#评论

也可以通过旋转移动设备来控制外观(如果它有陀螺仪)。这需要使用 Unity 的新输入系统并手动启用陀螺仪设备。查看输入示例项目以获取有关如何使用陀螺仪设置相机外观的参考。

#参数
IDType描述Description
enableboolean是否启用或禁用相机外观模式。默认值:真。Whether to enable or disable the camera look mode. Default: true.
zonedecimal listX,Y 大小的边界框,以初始相机位置为单位,描述相机可以移动的距离。默认值:5,3。A bound box with X,Y sizes in units from the initial camera position, describing how far the camera can be moved. Default: 5,3.
speeddecimal listX、Y 轴的相机移动速度(灵敏度)。默认值:1.5,1。Camera movement speed (sensitivity) by X,Y axes. Default: 1.5,1.
gravityboolean是否在外观输入未激活时(例如,鼠标未移动或模拟摇杆处于默认位置)时自动将相机移动到初始位置。默认值:假。Whether to automatically move camera to the initial position when the look input is not active (eg, mouse is not moving or analog stick is in default position). Default: false.
#例子
; Activate camera look mode with default parameters.
@look

; Activate camera look mode with custom parameters.
@look zone:6.5,4 speed:3,2.5 gravity:true

; Disable look mode and instantly reset the offset.
@look false

; Disable look, but reset gradually, with 0.25 speed.
@look false gravity:true speed:0.25

#movie

#概括

使用提供的名称(路径)播放电影。

#评论

将在播放电影之前淡出屏幕并在播放后淡入。可以通过激活cancel输入来取消播放(Esc默认为键)。

#参数
IDType描述Description
movieNamestring要播放的电影资源的名称。Name of the movie resource to play.
timedecimal淡入淡出动画的持续时间(以秒为单位)。如果未指定,将使用电影配置中设置的淡入淡出持续时间。Duration (in seconds) of the fade animation. When not specified, will use fade duration set in the movie configuration.
#例子
; Given an `Opening` video clip is added to the movie resources, plays it.
@movie Opening

#openURL

#概括

使用默认 Web 浏览器打开指定的 URL(Web 地址)。

#评论

Unity的Application.OpenURL方法用于处理命令;有关行为详细信息和限制,请参阅文档

#参数
IDType描述Description
uRLstring要打开的网址。URL to open.
#例子
; Open Naninovel website.
@openURL "https://naninovel.com"

#print

#概括

使用文本打印机actor打印(随着时间的推移显示)指定的文本消息。

#评论

该命令在处理通用文本行时在后台使用,例如,在解析 naninovel 脚本时,通用行将Kohaku: Hello World!自动转换为@print "Hello World!" author:Kohaku
默认情况下会在打印新消息之前重置(清除)打印机;在打印机参与者配置中将reset参数设置为false或禁用Auto Reset以防止发生这种情况并改为附加文本。
将打印机设为默认,默认隐藏其他打印机;在打印机参与者配置中将default参数设置为false或禁用Auto Default以防止这种情况发生。
默认会等待用户输入完成任务;将waitInput参数设置为false或禁用Auto Wait 在打印机参与者配置中,一旦文本完全显示就返回。

#参数
IDType描述Description
textstring要打印的消息文本。当文本包含空格时,将其用双引号 ( ")括起来。如果您希望在文本本身中包含双引号,请将它们转义。Text of the message to print. When the text contain spaces, wrap it in double quotes ("). In case you wish to include the double quotes in the text itself, escape them.
printerstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
authorstring演员的 ID,应该与打印的消息相关联。ID of the actor, which should be associated with the printed message.
speeddecimal文字显示速度倍数;应该是正数或零。设置为 1 将产生默认速度。Text reveal speed multiplier; should be positive or zero. Setting to one will yield the default speed.
resetboolean执行打印任务前是否重置打印机文本。默认值Auto Reset由打印机参与者配置菜单中的属性控制。Whether to reset text of the printer before executing the printing task. Default value is controlled via Auto Reset property in the printer actor configuration menu.
defaultboolean执行打印任务前是否将打印机设为默认并隐藏其他打印机。默认值Auto Default由打印机参与者配置菜单中的属性控制。Whether to make the printer default and hide other printers before executing the printing task. Default value is controlled via Auto Default property in the printer actor configuration menu.
waitInputboolean打印任务完成后是否等待用户输入。默认值Auto Wait由打印机参与者配置菜单中的属性控制。Whether to wait for user input after finishing the printing task. Default value is controlled via Auto Wait property in the printer actor configuration menu.
brinteger在打印文本之前添加的换行符数。默认值Auto Line Break由打印机参与者配置菜单中的属性控制。Number of line breaks to prepend before the printed text. Default value is controlled via Auto Line Break property in the printer actor configuration menu.
fadeTimedecimal控制打印机显示和隐藏与此命令关联的动画的持续时间(以秒为单位)。每个打印机的默认值在参与者配置中设置。Controls duration (in seconds) of the printers show and hide animations associated with this command. Default value for each printer is set in the actor configuration.
voiceIdstring由语音映射实用程序用于区分同一脚本中具有相同文本的打印命令。Used by voice map utility to differentiate print commands with equal text within the same script.
#例子
; Will print the phrase with a default printer.
@print "Lorem ipsum dolor sit amet."

; To include quotes in the text itself, escape them.
@print "Shouting \"Stop the car!\" was a mistake."

; Reveal message with half of the normal speed and
; don't wait for user input to continue.
@print "Lorem ipsum dolor sit amet." speed:0.5 waitInput:false

#printer

#概括

修改文本打印机actor

#评论

请注意,文本显示效果不支持旋转;rotation仅对不使用效果的打印机使用参数(例如,聊天或自定义效果)。

#参数
IDType描述Description
idAndAppearancenamed string要修改的打印机 ID 和要设置的外观。未提供 ID 或外观时,将使用默认值。ID of the printer to modify and the appearance to set. When ID or appearance are not provided, will use default ones.
defaultboolean是否将打印机设为默认打印机。printer未指定参数时,默认打印机将服从所有与打印机相关的命令。Whether to make the printer the default one. Default printer will be subject of all the printer-related commands when printer parameter is not specified.
hideOtherboolean是否隐藏所有其他打印机。Whether to hide all the other printers.
posdecimal list为修改后的actor设置的位置(相对于场景边界,以百分比为单位)。位置描述如下:0,0是左下角,50,50是中心,100,100是场景的右上角。,10在正交模式下,使用 Z 分量(第三个成员,例如)按深度移动(排序)。Position (relative to the scene borders, in percents) to set for the modified actor. Position is described as follows: 0,0 is the bottom left, 50,50 is the center and 100,100 is the top right corner of the scene. Use Z-component (third member, eg ,10) to move (sort) by depth while in ortho mode.
idstring要修改的actor的ID;指定*影响所有可见的演员。ID of the actor to modify; specify * to affect all visible actors.
appearancestring为修改后的演员设置外观。Appearance to set for the modified actor.
posestring为修改后的演员设置姿势。Pose to set for the modified actor.
transitionstring要使用的过渡效果类型(默认使用交叉淡入淡出)。Type of the transition effect to use (crossfade is used by default).
paramsdecimal list过渡效果的参数。Parameters of the transition effect.
dissolvestring路径的自定义溶解质地(路径应该是相对于Resources文件夹)。仅当转换设置为Custom模式时才有效。Path to the custom dissolve texture (path should be relative to a Resources folder). Has effect only when the transition is set to Custom mode.
visibleboolean为修改后的actor设置的可见性状态。Visibility status to set for the modified actor.
positiondecimal list为修改后的actor设置的位置(在世界空间中)。在正交模式下,使用 Z 分量(第三个成员)按深度移动(排序)。Position (in world space) to set for the modified actor. Use Z-component (third member) to move (sort) by depth while in ortho mode.
rotationdecimal list为修改后的actor设置的旋转。Rotation to set for the modified actor.
scaledecimal list为修改后的actor设置缩放。Scale to set for the modified actor.
tintstring为修改后的actor设置的色调。
以 开头的字符串#将按以下方式解析为十六进制:#RGB(变成 RRGGBB), #RRGGBB, #RGBA(变成 RRGGBBAA), #RRGGBBAA; 未指定 alpha 时将默认为 FF。
不以开头的字符串#将被解析为文字颜色,支持以下颜色:红色、青色、蓝色、深蓝色、浅蓝色、紫色、黄色、石灰、紫红色、白色、银色、灰色、黑色、橙色、棕色、栗色、绿色、橄榄色、海军蓝、蓝绿色、浅绿色、洋红色。
Tint color to set for the modified actor.
Strings that begin with # will be parsed as hexadecimal in the following way: #RGB (becomes RRGGBB), #RRGGBB, #RGBA (becomes RRGGBBAA), #RRGGBBAA; when alpha is not specified will default to FF.
Strings that do not begin with # will be parsed as literal colors, with the following supported: red, cyan, blue, darkblue, lightblue, purple, yellow, lime, fuchsia, white, silver, grey, black, orange, brown, maroon, green, olive, navy, teal, aqua, magenta.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Name of the easing function to use for the modification.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Will make `Wide` printer default and hide any other visible printers.
@printer Wide

; Will assign `Right` appearance to `Bubble` printer, make is default,
; position at the center of the scene and won't hide other printers.
@printer Bubble.Right pos:50,50 hideOther:false

#processInput

#概括

允许暂停和恢复用户输入处理(例如,对按下键盘键的反应)。动作的效果是持久的,并与游戏一起保存。

#参数
IDType描述Description
inputEnabledboolean是否启用所有采样器的输入处理。Whether to enable input processing of all the samplers.
setnamed boolean list允许静音和取消静音单个输入采样器。Allows muting and un-muting individual input samplers.
#例子
; Halt input processing of all the samplers.
@processInput false

; Resume input processing of all the samplers.
@processInput true

; Mute `Rollback` and `Pause` inputs and un-mute `Continue` input.
@processInput set:Rollback.false,Pause.false,Continue.true

#purgeRollback

#概括

防止玩家回滚到之前的状态快照。

#例子
; Prevent player from rolling back to try picking another choice.

Pick a choice. You won't be able to rollback.
@choice One goto:.One
@choice Two goto:.Two
@stop

# One
@purgeRollback
You've picked one.
@stop

# Two
@purgeRollback
You've picked two.
@stop

#resetState

#概括

重置引擎服务的状态并卸载(处置)Naninovel 加载的所有资源(纹理、音频、视频等);基本上将恢复为空的初始引擎状态。

#评论

该过程是异步的,并被加载屏幕 ( ILoadingUI )屏蔽。

请注意,此命令无法撤消(倒回)。

#参数
IDType描述Description
excludestring list要从重置中排除的引擎服务(接口)的名称。考虑添加ICustomVariableManager以保留局部变量。Names of the engine services (interfaces) to exclude from reset. Consider adding ICustomVariableManager to preserve the local variables.
onlystring list要重置的引擎服务(接口)的名称;其他服务不受影响。分配无名(排除)参数时无效。Names of the engine services (interfaces) to reset; other services won’t be affected. Doesn’t have effect when the nameless (exclude) parameter is assigned.
#例子
; Reset all the services (script will stop playing).
@resetState

; Reset all the services except script player, custom variable and
; audio managers, allowing current script and audio tracks
; continue playing and preserving values of the custom variables.
@resetState IScriptPlayer,ICustomVariableManager,IAudioManager

; Reset only `ICharacterManager` and `IBackgroundManager` services
; removing all the character and background actors from scene
; and unloading associated resources from memory.
@resetState only:ICharacterManager,IBackgroundManager

#resetText

#概括

重置(清除)文本打印机的内容。

#参数
IDType描述Description
printerIdstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
#例子
; Print and then clear contents of the default printer.
This line will disappear.
@resetText

; Same as above, but with `Wide` printer.
@print "This line will disappear." printer:Wide
@resetText Wide

#return

#概括

尝试将 naninovel 脚本播放导航到上次使用后的命令@gosub。有关@gosub更多信息和使用示例,请参阅命令摘要。

#参数
IDType描述Description
resetstring list指定后,将在返回到输入 gosub 的初始脚本之前重置引擎服务状态(以防它不是当前播放的脚本)。指定*重置所有服务,或指定要从重置中排除的服务名称。默认情况下,状态不会重置。When specified, will reset the engine services state before returning to the initial script from which the gosub was entered (in case it’s not the currently played script). Specify * to reset all the services, or specify service names to exclude from reset. By default, the state does not reset.

#save

#概括

自动将游戏保存到快速保存槽。

#set

#概括

脚本表达式的结果分配给自定义变量

#评论

如果具有提供名称的变量不存在,它将自动创建。

可以在一行中定义多个集合表达式,用;.分隔它们。表达式将按照声明的顺序依次执行。

如果变量名称以T_或被t_认为是对存储在“脚本”托管文本文档中的值的引用。此类变量无法赋值,主要用于引用可本地化的文本值。

#参数
IDType描述Description
expressionstring设置表达式。
表达式应采用以下格式:VariableName=ExpressionBody,其中VariableName是要分配的自定义变量的名称,并且ExpressionBody是脚本表达式,其结果应分配给变量。
也可以使用递增和递减一元运算符 ( @set foo++, @set foo–) 和复合赋值 ( @set foo+=10, @set foo-=3, @set foo*=0.1, @set foo/=2)。
Set expression.
The expression should be in the following format: VariableName=ExpressionBody, where VariableName is the name of the custom variable to assign and ExpressionBody is a script expression, the result of which should be assigned to the variable.
It’s also possible to use increment and decrement unary operators (@set foo++, @set foo–) and compound assignment (@set foo+=10, @set foo-=3, @set foo*=0.1, @set foo/=2).
#例子
; Assign `foo` variable a `bar` string value.
@set foo="bar"

; Assign `foo` variable a 1 number value.
@set foo=1

; Assign `foo` variable a `true` boolean value.
@set foo=true

; If `foo` is a number, add 0.5 to its value.
@set foo+=0.5

; If `angle` is a number, assign its cosine to `foo` variable.
@set foo=Cos(angle)

; Get a random integer between -100 and 100, then raise to power of 4 and assign to 
; `foo` variable. Quotes required when whitespace is present inside the expression.
@set "foo = Pow(Random(-100, 100), 4)"

; If `foo` is a number, add 1 to its value (increment).
@set foo++

; If `foo` is a number, subtract 1 from its value (decrement).
@set foo--

; Assign `foo` variable value of the `bar` variable, which is `Hello World!` string.
@set bar="Hello World!"
@set foo=bar

; Defining multiple set expressions in one line (the result will be the same as above).
@set bar="Hello World!";foo=bar

; It's possible to inject variables to naninovel script command parameters.
@set scale=0
# EnlargeLoop
@char Kohaku.Default scale:{scale}
@set scale+=0.1
@goto .EnlargeLoop if:scale<1

; ...and generic text lines.
@set name="Dr. Stein";drink="Dr. Pepper"
{name}: My favourite drink is {drink}!

; When using double quotes inside the expression itself, 
; don't forget to double-escape them.
@set remark="Shouting \\"Stop the car!\\" was a mistake."

; Use global variable to indicate player reaching `Ending 001`.
; The variable will remain true even when the game is restarted.
@set g_Ending001Reached=true

; Increment the global variable only once, even when re-played.
@set g_GlobalCounter++ if:!HasPlayed()

#sfx

#概括

使用提供的名称播放或修改当前播放的SFX(音效)轨道。

#评论

音效轨道默认不循环播放。当未指定 sfx 曲目名称(SfxPath)时,将影响当前播放的所有曲目。当为已经播放的曲目调用时,播放不会受到影响(曲目不会从头开始播放),但会应用指定的参数(音量和曲目是否循环播放)。

#参数
IDType描述Description
sfxPathstring要播放的音效资源的路径。Path to the sound effect asset to play.
volumedecimal音效的音量。Volume of the sound effect.
loopboolean是否循环播放音效。Whether to play the sound effect in a loop.
fadedecimal开始播放时音量淡入的持续时间,以秒为单位(默认为 0.0);修改播放曲目时无效。Duration of the volume fade-in when starting playback, in seconds (0.0 by default); doesn’t have effect when modifying a playing track.
groupstring播放音频时应使用的混音器组路径。Audio mixer group path that should be used when playing the audio.
timedecimal修改的持续时间(以秒为单位)。Duration (in seconds) of the modification.
#例子
; Plays an SFX with the name `Explosion` once.
@sfx Explosion

; Plays an SFX with the name `Rain` in a loop and fades-in over 30 seconds.
@sfx Rain loop:true fade:30

; Changes volume of all the played SFX tracks to 75% over 2.5 seconds
; and disables looping for all of them.
@sfx volume:0.75 loop:false time:2.5

#sfxFast

#概括

使用提供的名称播放SFX(音效)轨道。与@sfx命令不同,剪辑以最小延迟播放,并且不与游戏状态序列化(加载游戏后不会播放,即使保存时播放也是如此)。该命令可用于播放各种瞬态音频剪辑,例如与 UI 相关的声音(例如,使用Play Script组件单击按钮时)。

#参数
IDType描述Description
sfxPathstring要播放的音效资源的路径。Path to the sound effect asset to play.
volumedecimal音效的音量。Volume of the sound effect.
restartboolean是否从头开始播放音频,以防它已经在播放。Whether to start playing the audio from start in case it’s already playing.
additiveboolean是否允许播放同一剪辑的多个实例;restart启用时无效。Whether to allow playing multiple instances of the same clip; has no effect when restart is enabled.
groupstring播放音频时应使用的混音器组路径。Audio mixer group path that should be used when playing the audio.
#例子
; Plays an SFX with the name `Click` once.
@sfxFast Click

; Same as above, but allow concurrent playbacks of the same clip.
@sfxFast Click restart:false

#show

#概括

显示(使可见)具有指定 ID 的演员(角色、背景、文本打印机、选择处理程序等)。如果找到具有相同 ID 的多个参与者(例如,角色和打印机),将仅影响找到的第一个参与者。

#参数
IDType描述Description
actorIdsstring list要显示的演员的 ID。IDs of the actors to show.
timedecimal淡入淡出动画的持续时间(以秒为单位)。Duration (in seconds) of the fade animation.
#例子
; Given an actor with ID `Smoke` is hidden, reveal (fade-in) it over 3 seconds.
@show Smoke time:3

; Show `Kohaku` and `Yuko` actors.
@show Kohaku,Yuko

#showPrinter

#概括

显示文本打印机。

#参数
IDType描述Description
printerIdstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
timedecimal节目动画的持续时间(以秒为单位)。每个打印机的默认值在参与者配置中设置。Duration (in seconds) of the show animation. Default value for each printer is set in the actor configuration.
#例子
; Show a default printer.
@showPrinter

; Show printer with ID `Wide`.
@showPrinter Wide

#showUI

#概括

使具有指定资源名称的UI 元素可见。未指定名称时,将显示整个 UI(以防它被 隐藏@hideUI)。

#参数
IDType描述Description
uINamesstring list要使其可见的 UI 资源的名称。Name of the UI resource to make visible.
timedecimal节目动画的持续时间(以秒为单位)。未指定时,将使用特定于 UI 的持续时间。Duration (in seconds) of the show animation. When not specified, will use UI-specific duration.
#例子
; Given you've added a custom UI with `Calendar` name,
; the following will make it visible on the scene.
@showUI Calendar

; Given you've hidden the entire UI with @hideUI, show it back.
@showUI

; Simultaneously reveal built-in `TipsUI` and custom `Calendar` UIs.
@showUI TipsUI,Calendar

#skip

#概括

允许启用或禁用脚本播放器“跳过”模式。

#参数
IDType描述Description
enableboolean是否启用(默认)或禁用跳过模式。Whether to enable (default) or disable the skip mode.
#例子
; Enable skip mode.
@skip

; Disable skip mode.
@skip false

#skipInput

#概括

可用于通用文本行以防止wait for input在打印文本时激活模式。

#例子
; Script player won't wait for `continue` input before executing the `@sfx` command.
And the rain starts.[skipInput]
@sfx Rain

#slide

#概括

使用提供的 ID 滑动(在两个位置之间移动)演员(角色、背景、文本打印机或选择处理程序),并可选择更改演员的可见性和外观。可以代替多个@charor@back命令使用幻灯片动画来显示或隐藏演员。

#评论

请注意,此命令在所有参与者管理器中搜索具有提供的 ID 的现有参与者,并且如果存在具有相同 ID 的多个参与者(例如,角色和文本打印机),这将只影响第一个找到的参与者. 在使用此命令引用之前,请确保演员存在于场景中;例如,如果它是一个角色,你可以用@char CharID visible:false time:0.

#参数
IDType描述Description
idAndAppearancenamed string要滑动的演员的 ID 和(可选)要设置的外观。ID of the actor to slide and (optionally) appearance to set.
fromdecimal list场景空间中的位置,以从(幻灯片开始位置)滑动演员。描述如下:0,0是左下角,50,50是中心,100,100是场景的右上角;Z 分量(深度)位于世界空间中。如果未提供,将使用当前演员位置以防它可见,否则将使用随机场外位置(可以从左侧或右侧边框滑入)。Position in scene space to slide the actor from (slide start position). Described as follows: 0,0 is the bottom left, 50,50 is the center and 100,100 is the top right corner of the scene; Z-component (depth) is in world space. When not provided, will use current actor position in case it’s visible and a random off-scene position otherwise (could slide-in from left or right borders).
todecimal list将演员滑到场景空间中的位置(滑动完成位置)。Position in scene space to slide the actor to (slide finish position).
visibleboolean更改演员的可见性状态(显示或隐藏)。未设置且目标actor隐藏时,仍会自动显示。Change visibility status of the actor (show or hide). When not set and target actor is hidden, will still automatically show it.
easingstring用于修改的缓动函数的名称。
可用选项:Linear、SmoothStep、Spring、EaseInQuad、EaseOutQuad、EaseInOutQuad、EaseInCubic、EaseOutCubic、EaseInOutCubic、EaseInQuart、EaseOutQuart、EaseInOutQuart、EaseInQuint、EaseOutQuint、EaseInOutQuint、EaseInSine、EaseOutSine、EaseInOutSine、EaseInExpo、EaseOutExpo、EaseInOutExpo、Ease , EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic。
如果未指定,将使用在 actor 的管理器配置设置中设置的默认缓动函数。
Name of the easing function to use for the modifications.
Available options: Linear, SmoothStep, Spring, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc, EaseInBounce, EaseOutBounce, EaseInOutBounce, EaseInBack, EaseOutBack, EaseInOutBack, EaseInElastic, EaseOutElastic, EaseInOutElastic.
When not specified, will use a default easing function set in the actor’s manager configuration settings.
timedecimal幻灯片动画的持续时间(以秒为单位)。Duration (in seconds) of the slide animation.
#例子
; Given `Jenna` actor is not currently visible, reveal it with an `Angry` appearance
; and slide to the center of the scene from either left or right border of the scene.
@slide Jenna.Angry to:50

; Given `Sheba` actor is currently visible,
; hide and slide it out of the scene over the left border.
@slide Sheba to:-10 visible:false


; Slide `Mia` actor from left-center side of the scene to the right-bottom
; over 5 seconds using `EaseOutBounce` animation easing.
@slide Sheba from:15,50 to:85,0 time:5 easing:EaseOutBounce

#spawn

#概括

实例化预制件或特殊效果;在已经生成的对象上执行时,将改为更新生成参数。

#评论

如果 prefab 有一个MonoBehaviour组件附加了根对象,并且该组件实现了一个IParameterized接口,将params在 spawn 之后传递指定的值;如果组件实现了IAwaitable接口,命令执行将等待实现返回的异步完成任务。

#参数
IDType描述Description
pathstring要生成的预制资源的名称(路径)。Name (path) of the prefab resource to spawn.
paramsstring list生成预制件时要设置的参数。要求预制件有一个IParameterized附加到根对象的组件。Parameters to set when spawning the prefab. Requires the prefab to have a IParameterized component attached the root object.
posdecimal list为生成的对象设置的位置(相对于场景边界,以百分比为单位)。位置描述如下:0,0是左下角,50,50是中心,100,100是场景的右上角。,10在正交模式下,使用 Z 分量(第三个成员,例如)按深度移动(排序)。Position (relative to the scene borders, in percents) to set for the spawned object. Position is described as follows: 0,0 is the bottom left, 50,50 is the center and 100,100 is the top right corner of the scene. Use Z-component (third member, eg ,10) to move (sort) by depth while in ortho mode.
positiondecimal list为生成的对象设置的位置(在世界空间中)。Position (in world space) to set for the spawned object.
rotationdecimal list为生成的对象设置的旋转。Rotation to set for the spawned object.
scaledecimal list缩放以设置生成的对象。Scale to set for the spawned object.
#例子
; Given a `Rainbow` prefab is assigned in spawn resources, instantiate it.
@spawn Rainbow

#startTrans

#概括

开始使用当前可见的任何内容(UI 除外)掩盖真实场景内容的场景过渡。新场景准备好后,以@finishTrans命令结束。

#评论

在过渡过程中,UI 将被隐藏并阻止用户输入。您可以通过覆盖ISceneTransitionUI处理转换过程的来更改它。

有关可用过渡效果选项的列表,请参阅过渡效果指南。

#例子
; Transition Felix on sunny day with Jenna on rainy day.
@char Felix
@back SunnyDay
@spawn SunShafts
@startTrans
; The following modifications won't be visible until we finish the transition.
@hideChars time:0
@char Jenna time:0
@back RainyDay time:0
@despawn SunShafts params:0
@spawn Rain params:,0
; Transition the initially captured scene to the new one
; with `DropFade` effect over 3 seconds.
@finishTrans DropFade time:3

#stop

#概括

停止 naninovel 脚本执行。

#例子
Show the choices and halt script execution until the player picks one.
@choice "Choice 1"
@choice "Choice 2"
@stop
We'll get here after player will make a choice.

#stopBgm

#概括

停止播放具有所提供名称的 BGM(背景音乐)曲目。

#评论

当未指定音乐曲目名称(BgmPath)时,将停止所有当前播放的曲目。

#参数
IDType描述Description
bgmPathstring要停止的音乐曲目的路径。Path to the music track to stop.
fadedecimal停止播放前音量淡出的持续时间,以秒为单位(默认为 0.35)。Duration of the volume fade-out before stopping playback, in seconds (0.35 by default).
#例子
; Fades-out the `Sanctuary` music track over 10 seconds and stops the playback.
@stopBgm Sanctuary fade:10

; Stops all the currently played music tracks.
@stopBgm

#stopSfx

#概括

停止播放具有提供名称的 SFX(音效)轨道。

#评论

当未指定音效曲目名称(SfxPath)时,将停止所有当前播放的曲目。

#参数
IDType描述Description
sfxPathstring音效停止的路径。Path to the sound effect to stop.
fadedecimal停止播放前音量淡出的持续时间,以秒为单位(默认为 0.35)。Duration of the volume fade-out before stopping playback, in seconds (0.35 by default).
#例子
; Stop playing an SFX with the name `Rain`, fading-out for 15 seconds.
@stopSfx Rain fade:15

; Stops all the currently played sound effect tracks.
@stopSfx

#stopVoice

#概括

停止播放当前播放的语音片段。

#例子
; Given a voice is being played, stop it.
@stopVoice

#style

#概括

文本样式永久应用于文本打印机的内容。

#评论

您还可以在文本消息中使用富文本标签来选择性地应用样式。

#参数
IDType描述Description
textStylesstring list要应用的文本格式标记。尖括号应省略,例如使用bfor和size=100for <size=100>。使用default关键字重置样式。Text formatting tags to apply. Angle brackets should be omitted, eg use b for and size=100 for <size=100>. Use default keyword to reset the style.
printerstring要使用的打印机参与者的 ID。未提供时将使用默认值。ID of the printer actor to use. Will use a default one when not provided.
#例子
; Print first two sentences in bold red text with 45px size,
; then reset the style and print the last sentence using default style.
@style color=#ff0000,b,size=45
Lorem ipsum dolor sit amet.
Cras ut nisi eget ex viverra egestas in nec magna.
@style default
Consectetur adipiscing elit.

; Print starting part of the sentence normally, but the last one in bold.
Lorem ipsum sit amet. <b>Consectetur adipiscing elit.</b>

#title

#概括

重置引擎状态并显示ITitleUIUI(主菜单)。

#例子
; Exit to title UI, no matter which script is playing.
@title

#toast

#概括

使用提供的文本和(可选)外观和持续时间显示用于通用自隐藏弹出通知(又名“toast”)的 UI。UI 在指定(或默认)持续时间后自动隐藏。

#评论

外观名称是UI 预制Toast Appearance件内带有组件的游戏对象的名称ToastUI(不区分大小写)。

#参数
IDType描述Description
textstring为 toast 设置的文本内容。The text content to set for the toast.
appearancestringtoast 的外观变体(游戏对象名称)。未指定时,将使用 Toast UI 预制件中设置的默认外观。Appearance variant (game object name) of the toast. When not specified, will use default appearance set in Toast UI prefab.
timedecimal在隐藏吐司之前等待几秒钟。如果未指定,将使用 Toast UI 预制件中默认设置的持续时间。Seconds to wait before hiding the toast. When not specified, will use duration set by default in Toast UI prefab.
#例子
; Shows a default toast with `Hello World!` content.
@toast "Hello World!"

; Shows a toast with a `warning` appearance.
@toast "You're in danger!" appearance:warning

; The toast will disappear in one second.
@toast "I'll disappear in 1 second." time:1

#unloadScene

#概括

使用提供的名称卸载Unity 场景。不要忘记将所需的场景添加到构建设置中以使它们可用于加载。请注意,只有附加加载的场景才能被卸载(至少一个场景应始终保持加载状态)。

#参数
IDType描述Description
sceneNamestring要卸载的场景名称。Name of the scene to unload.
#例子
; Load scene `TestScene2` in additive mode and then unload it.
@loadScene TestScene2 additive:true
@unloadScene TestScene2

#unlock

#概括

将具有提供的 ID的可解锁项目设置为unlocked状态。

#评论

项目的解锁状态存储在全局范围内
如果提供 ID 的 item 没有在全局状态图中注册,则会自动添加相应的记录。

#参数
IDType描述Description
idstring可解锁项目的 ID。使用*解锁所有已注册的解锁项目。ID of the unlockable item. Use * to unlock all the registered unlockable items.
#例子
; Unlocks an unlockable CG record with ID `FightScene1`.
@unlock CG/FightScene1

#voice

#概括

在提供的路径播放语音剪辑。

#参数
IDType描述Description
voicePathstring要播放的语音剪辑的路径。Path to the voice clip to play.
volumedecimal播放的音量。Volume of the playback.
groupstring播放音频时应使用的混音器组路径。Audio mixer group path that should be used when playing the audio.
authorIdstring此声音所属的角色演员的 ID。当提供并使用每个作者的体积时,体积将相应调整。ID of the character actor this voice belongs to. When provided and per-author volume is used, volume will be adjusted accordingly.
#例子
; Given a `Rawr` voice resource is available, play it.
@voice Rawr

#wait

#概括

保持脚本执行直到指定的等待条件。

#参数
IDType描述Description
waitModestring等待条件:
-i用户按下继续或跳过输入键;
-0.0计时器(秒);
-i0.0计时器,可以通过继续或跳过输入键跳过。
Wait conditions:
- i user press continue or skip input key;
- 0.0 timer (seconds);
- i0.0 timer, that is skip-able by continue or skip input keys.
dostring list等待结束时执行的脚本命令。在列表值中转义逗号以防止它们被视为分隔符。Script commands to execute when the wait is over. Escape commas inside list values to prevent them being treated as delimiters.
#例子
; `Thunder` SFX will play 0.5 seconds after the shake background effect finishes.
@spawn ShakeBackground
@wait 0.5
@sfx Thunder

; Print first two words, then wait for user input before printing the remaining phrase.
Lorem ipsum[wait i] dolor sit amet.
; You can also use the following shortcut (@i command) for this wait mode.
Lorem ipsum[i] dolor sit amet.

; Start a looped SFX, print a message and wait for a skippable 5 seconds delay,
; then stop the SFX.
@sfx Noise loop:true
Jeez, what a disgusting noise. Shut it down![wait i5][skipInput]
@stopSfx Noise

; The text is printed without delay, as the `wait` command is not awaited (wait:false).
; The thunder effects are played after a random delay of 3 to 8 seconds.
@wait {Random(3,8)} do:"@sfx Thunder, @spawn ShakeBackground params:\,1" wait:false
The thunder might go off any second...

翻译自官方文档

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
### 回答1: 要下载naninovel,首先需要找到naninovel的官方网站或是可信的下载资源。可以在搜索引擎中输入naninovel关键词,然后选择官方网站进行下载。 在官方网站上,通常会提供naninovel的最新版本以及相关的下载链接。点击相应的链接,将开始下载naninovel的安装文件。下载过程可能需要一些时间,取决于网络连接的速度和文件大小。 下载完成后,双击安装文件,按照安装向导的指示逐步完成安装过程。可能会要求选择安装位置和其他一些选项,按需进行设置。 安装完成后,就可以开始使用naninovel了。打开naninovel软件,可以看到一个简单的用户界面,提供了创建、编辑和运行交互式小说的功能。可以根据自己的需求和创作目的,使用软件提供的功能进行创作和编辑。 在使用naninovel的过程中,可能会遇到一些问题或需要参考相关的文档和教程。可以在官方网站或网络上搜索naninovel的使用技巧和帮助资源,以便更好地理解和使用该软件。 总之,naninovel是一款用于创建交互式小说的软件,通过官方网站下载并按照安装过程安装即可开始使用。希望以上回答能对您有所帮助。 ### 回答2: Naninovel是一款开源的可视化小说创作工具,用户可以用它来制作自己的交互式小说游戏。要下载Naninovel,可以按照以下步骤进行操作: 首先,打开Naninovel的官方网站,可以在搜索引擎中输入"Naninovel"关键词,找到官方网站的链接。进入官方网站后,找到下载页面。 在下载页面上,可以找到最新版本的Naninovel软件。通常会提供针对不同操作系统的下载选项,比如Windows、macOS或Linux。根据自己的操作系统选择适合自己的版本,然后点击下载按钮。 下载完成后,会得到一个安装文件。双击该文件运行安装程序。跟随安装向导的指示完成安装过程,可以选择安装位置和其他选项,也可以保持默认设置。 安装完成后,就可以开始使用Naninovel了。打开Naninovel软件,就可以开始创作自己的交互式小说游戏了。Naninovel提供了丰富的工具和功能,可以让用户轻松地设计情节、角色和对话等,还可以添加音频、图像和视频等多媒体元素,使游戏更加丰富和生动。 总之,要下载Naninovel,只需前往官方网站,选择合适的版本进行下载,然后按照安装向导完成安装过程,最后就可以开始使用这个强大的创作工具来打造自己的交互式小说游戏了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值