Skip to content

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 comment

Comments 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
@end

Properties:

PropertyTypeDescription
colorColorCharacter name color in dialogue box
descriptionStringCharacter description
sprite_defaultFilenameDefault sprite file
sprite_*FilenameEmotion 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
@end

Properties:

PropertyTypeDescription
nameStringItem display name
descriptionStringItem description
iconFilenameItem icon file

@var - Variable Definition

Define a game variable.

@var variable_name = initial_value

Supported 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
@end

Scene 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_scene

Use @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:fade

Parameters:

ParameterTypeDescription
transitionStringTransition 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 hide

Parameters:

ParameterTypeDescription
show-Show sprite; if url is omitted, NovaMark tries sprite_default from the character definition
hide-Hide sprite
urlFilenameSprite image
positionStringRecommended left / right, passed through as-is
xString/NumberPassed through to the host as-is
yString/NumberPassed through to the host as-is
opacityNumberOpacity (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 stop

Parameters:

ParameterTypeDescription
loopBooleanLoop playback
volumeNumberVolume (0-1)

@sfx - Sound Effect

Play a sound effect.

@sfx click.mp3
@sfx ambient.mp3 loop:true volume:0.5

Parameters:

ParameterTypeDescription
loopBooleanLoop playback
volumeNumberVolume (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 - 5

Supports: +, -, *, /, %

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 + 1

The quantity parameter supports expressions.


@check - Condition Check

Execute different branches based on condition.

@check condition_expression
@success
  // Execute on success
@fail
  // Execute on failure
@endcheck

Examples:

@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_ending

Expressions and Functions

Arithmetic Operations

@set total = a + b
@set diff = a - b
@set product = a * b
@set quotient = a / b

Comparison Operations

@check hp > 0
@check gold >= 100
@check hp == 100
@check hp != 0

Logical Operations

@check has_item("key") and hp > 0
@check not has_flag("boss_defeated")

Built-in Functions

FunctionDescriptionExample
has_item("id")Check if player has itemhas_item("key")
item_count("id")Get item countitem_count("gold")
has_ending("id")Check if ending was triggeredhas_ending("true_end")
has_flag("id")Check if flag was sethas_flag("met_spirit")
roll("XdY+Z")Dice checkroll("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
Last updated on