Skip to main content
Functions return values from the game. Use them in conditions, expressions, and dialogue text.
These function signatures are based on analysis of the game’s files. Some behaviors and parameter descriptions are inferred and may not be fully accurate. Furthermore, the game is in Early Access and may change over time.

Usage Syntax

Functions can be used in several contexts:
// In conditions
<<if get_gold() >= 100>>

// In set statements
<<set $player_hp = get_player_attribute("HP")>>

// In dialogue text (use curly braces)
Player gold: {get_gold()}

Player State Functions

get_player_attribute

Returns a player attribute value.
get_player_attribute("HP")
get_player_attribute("STR")
ParameterTypeDescription
namestringAttribute name
Returns: float Common attributes: "HP", "MaxHP", "STR", "DEX", "INT"
<<if get_player_attribute("HP") < get_player_attribute("MaxHP") / 2>>
    Healer: You look injured.
<<endif>>

get_value

Retrieves a stored game value by ID.
get_value(1001)
ParameterTypeDescription
idintValue ID
Returns: float
This function takes an integer ID, not a string key. Value IDs are defined in the game’s data tables.
<<if get_value(1001) == 1>>
    NPC: I see you've already started the quest.
<<endif>>

get_gold

Returns the player’s current gold amount.
get_gold()
Returns: int
Merchant: You have {get_gold()} gold coins.

<<if get_gold() >= 500>>
    -> Buy the rare sword
<<endif>>

get_item

Returns the quantity of a specific item.
get_item(10001)
ParameterTypeDescription
itemIDintItem ID
Returns: int
<<if get_item(10001) >= 3>>
    Alchemist: You have enough herbs.
<<endif>>

get_item_count

Alternative function to get item quantity.
get_item_count(10001)
ParameterTypeDescription
itemIdintItem ID
Returns: int

Character Functions

Character functions use integer IDs to identify characters:
IDCharacter
1000Protagonist
1001Lilith (莉莉丝)
1002Karen (卡莲)
1003Sartre (夏特露)
1004Fouco (弗子)
1005Green (格林)

get_character_attribute

Returns an attribute for a specific character.
get_character_attribute(1001, "HP")
ParameterTypeDescription
idintCharacter ID
attrNamestringAttribute name
Returns: float
The first parameter is an integer character ID, not a string name.
<<if get_character_attribute(1001, "HP") < 50>>
    // Lilith is low on health
<<endif>>

get_char_attr

Alias for get_character_attribute.
get_char_attr(1001, "STR")
ParameterTypeDescription
characterIDintCharacter ID
attrstringAttribute name
Returns: float

is_character_dead

Checks if a character is dead.
is_character_dead(1003)
ParameterTypeDescription
idintCharacter ID
Returns: bool
<<if is_character_dead(1003)>>
    Lilith: We lost Sartre in that battle...
<<endif>>

is_own_character

Checks if a character is in the player’s party.
is_own_character(1003)
ParameterTypeDescription
idintCharacter ID
Returns: bool
<<if is_own_character(1003)>>
    -> Ask Sartre for help
<<endif>>

Event Functions

is_event_finished

Checks if a specific event has been completed.
is_event_finished(10084)
ParameterTypeDescription
eventIDintEvent ID
Returns: bool
<<if is_event_finished(10084)>>
    NPC: I heard you helped the merchant.
<<endif>>

Global State Functions

get_global_value

Retrieves a global game state value.
get_global_value("CurrentDay")
get_global_value("CurrentPeriod")
ParameterTypeDescription
namestringGlobal value name
Returns: string
Day {get_global_value("CurrentDay")}

g_str

Gets a global string value.
g_str("SomeStringValue")
ParameterTypeDescription
namestringValue name
Returns: string

g_num

Gets a global numeric value.
g_num("SomeNumericValue")
ParameterTypeDescription
namestringValue name
Returns: float

Localization Function

l10n

Retrieves a localized string by key.
l10n("UI_Confirm")
ParameterTypeDescription
keystringLocalization key
Returns: string
Standard dialogue localization uses #line:id tags, not this function. The l10n function is for accessing the game’s internal localization table (e.g., UI strings).

Cooking Functions

These functions are specific to the cooking system.

has_food_ingredient

Checks if player has food ingredients.
has_food_ingredient()
Returns: bool

get_cook_character

Gets the current cooking character.
get_cook_character()
Returns: int (character ID)

get_cook_character_dialog

Gets cooking dialogue for a character.
get_cook_character_dialog(1)
ParameterTypeDescription
typeintDialogue type
Returns: string

Common Patterns

Conditional Dialogue Based on Stats

<<if get_player_attribute("INT") >= 15>>
    -> [Intelligence] I notice something hidden...
<<endif>>

<<if get_player_attribute("STR") >= 12>>
    -> [Strength] I'll force it open.
<<endif>>

Inventory Checks

<<if get_item(20001) >= 1>>
    Guard: Ah, you have the seal. Pass.
    <<change_item 20001 -1>>
<<else>>
    Guard: No entry without authorization.
<<endif>>

Gold Checks

Merchant: That costs 50 gold. You have {get_gold()}.

<<if get_gold() >= 50>>
    -> Pay 50 gold
        <<change_gold -50>>
        <<change_item 10001 1>>
<<endif>>
-> I'll come back later

Character State

<<if is_own_character(1003) && !is_character_dead(1003)>>
    -> Ask Sartre for advice
<<endif>>

Event Progression

<<if is_event_finished(10001)>>
    NPC: Thank you for your help before!
<<else>>
    NPC: I could use some assistance...
<<endif>>

Important Notes

Common mistakes:
  • get_value takes an int ID, not a string
  • Character functions take int IDs, not string names
  • Use #line:id tags for dialogue localization, not l10n()