Command Reference
This document lists all commands supported by NovaMark.
Comments
NovaMark supports // single-line comments:
// This is a full-line comment
林晓: Hello! // This is an end-of-line commentComments are not executed and are for code documentation only.
Definition Commands
@char - Character Definition
Define a character in the game.
@char CharacterName
color: #RRGGBB
description: Character description
sprite_default: default_sprite.png
sprite_happy: happy_sprite.png
@endProperties:
| Property | Type | Description |
|---|---|---|
color | Color | Character name color in dialogue box |
description | String | Character description |
sprite_default | Filename | Default sprite file |
sprite_* | Filename | Emotion sprite convention such as sprite_happy |
@item - Item Definition
Define an item in the game.
@item item_id
name: Display Name
description: Item description
icon: icon_file.png
@endProperties:
| Property | Type | Description |
|---|---|---|
name | String | Item display name |
description | String | Item description |
icon | Filename | Item icon file |
@var - Variable Definition
Define a game variable.
@var variable_name = initial_valueSupported Types:
- Number:
@var hp = 100 - String:
@var name = "Alice" - Boolean:
@var is_alive = true
@theme - Theme Definition
Define UI theme styles.
@var theme_name
dialog_bg: #000000
text_color: #FFFFFF
@endScene Control
#scene - Scene Definition
Define a scene.
#scene_id "Scene Title"Example:
#scene_forest "Dark Forest"
#scene_tower "Tower of Stars"-> - Jump
Jump to a scene or label.
-> scene_name // Jump to scene
-> .label_name // Jump to label within current scene@call - Call Scene
Call a scene and return after completion.
@call shop_sceneUse @return in the called scene to return.
@return - Return
Return from a @call invocation.
@return.label - Label Definition
Define a label within a scene.
.look_around
> You look around.Label names start with ..
Display Commands
@bg - Background Image
Display or switch background image.
@bg image.png
@bg image.png transition:fadeParameters:
| Parameter | Type | Description |
|---|---|---|
transition | String | Transition effect (fade/slide/none) |
@sprite - Sprite/Portrait
Display or switch character sprites.
@sprite CharacterName show url:sprite.png position:left
@sprite CharacterName show position:left
@sprite CharacterName show url:sprite.png x:70 y:100
@sprite CharacterName hideParameters:
| Parameter | Type | Description |
|---|---|---|
show | - | Show sprite; if url is omitted, NovaMark tries sprite_default from the character definition |
hide | - | Hide sprite |
url | Filename | Sprite image |
position | String | Recommended left / right, passed through as-is |
x | String/Number | Passed through to the host as-is |
y | String/Number | Passed through to the host as-is |
opacity | Number | Opacity (0-1) |
When switching to a new scene, sprites from the previous scene are cleared automatically. Within the same scene, use hide when you want a portrait to leave.
NovaMark only exports sprite fields that were explicitly set in script. Unspecified fields remain empty, and the host decides how to apply its own default layout or rendering fallback.
@bgm - Background Music
Play or stop background music.
@bgm music.mp3
@bgm music.mp3 loop:true volume:0.8
@bgm stopParameters:
| Parameter | Type | Description |
|---|---|---|
loop | Boolean | Loop playback |
volume | Number | Volume (0-1) |
@sfx - Sound Effect
Play a sound effect.
@sfx click.mp3
@sfx ambient.mp3 loop:true volume:0.5Parameters:
| Parameter | Type | Description |
|---|---|---|
loop | Boolean | Loop playback |
volume | Number | Volume (0-1) |
Game Logic
@set - Modify Variable
Modify a variable value. If the variable does not exist yet, @set creates it in the current scope.
@set hp = 80
@set gold = gold + 10
@set courage = courage - 5Supports: +, -, *, /, %
Notes:
- The variable name on the left side uses set-or-create semantics
- Variable references on the right side must still already be available
For example:
@set hp = 100 // creates hp if it does not exist yet
@set mp = hp + 10 // valid because hp now exists
@set gold = coins + 1 // still an error if coins is undefined@give - Give Item
Add item to player inventory.
@give healing_potion 1
@give gold 100
@give gold random(10, 20)The quantity parameter supports expressions.
@take - Remove Item
Remove item from player inventory.
@take healing_potion 1
@take gold 1 + 1
@take gold count + 1The quantity parameter supports expressions.
@check - Condition Check
Execute different branches based on condition.
@check condition_expression
@success
// Execute on success
@fail
// Execute on failure
@endcheckExamples:
@check roll("2d6") >= 8
@success
林晓: Success!
@fail
林晓: Failed...
@endcheck
@check has_item("key")
@success
> You opened the chest.
@fail
> No key.
@endcheck
@check hp >= 50
@success
林晓: I can keep going!
@fail
林晓: I need to rest...
@set hp = 50
@endcheck@flag - Set Flag
Set a game flag (for multi-playthrough).
@flag met_spirit@ending - Trigger Ending
Trigger a game ending.
@ending good_ending
@ending bad_endingExpressions and Functions
Arithmetic Operations
@set total = a + b
@set diff = a - b
@set product = a * b
@set quotient = a / bComparison Operations
@check hp > 0
@check gold >= 100
@check hp == 100
@check hp != 0Logical Operations
@check has_item("key") and hp > 0
@check not has_flag("boss_defeated")Built-in Functions
| Function | Description | Example |
|---|---|---|
has_item("id") | Check if player has item | has_item("key") |
item_count("id") | Get item count | item_count("gold") |
has_ending("id") | Check if ending was triggered | has_ending("true_end") |
has_flag("id") | Check if flag was set | has_flag("met_spirit") |
roll("XdY+Z") | Dice check | roll("2d6+3") |
Dice Expressions
roll("2d6") // 2 six-sided dice
roll("1d20") // 1 twenty-sided die
roll("2d6+3") // 2d6 + 3 modifier
roll("1d8-1") // 1d8 - 1 modifier