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")
| Parameter | Type | Description |
|---|
name | string | Attribute 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.
| Parameter | Type | Description |
|---|
id | int | Value 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.
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.
| Parameter | Type | Description |
|---|
itemID | int | Item ID |
Returns: int
<<if get_item(10001) >= 3>>
Alchemist: You have enough herbs.
<<endif>>
get_item_count
Alternative function to get item quantity.
| Parameter | Type | Description |
|---|
itemId | int | Item ID |
Returns: int
Character Functions
Character functions use integer IDs to identify characters:
| ID | Character |
|---|
| 1000 | Protagonist |
| 1001 | Lilith (莉莉丝) |
| 1002 | Karen (卡莲) |
| 1003 | Sartre (夏特露) |
| 1004 | Fouco (弗子) |
| 1005 | Green (格林) |
get_character_attribute
Returns an attribute for a specific character.
get_character_attribute(1001, "HP")
| Parameter | Type | Description |
|---|
id | int | Character ID |
attrName | string | Attribute 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")
| Parameter | Type | Description |
|---|
characterID | int | Character ID |
attr | string | Attribute name |
Returns: float
is_character_dead
Checks if a character is dead.
| Parameter | Type | Description |
|---|
id | int | Character 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.
| Parameter | Type | Description |
|---|
id | int | Character 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.
| Parameter | Type | Description |
|---|
eventID | int | Event 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")
| Parameter | Type | Description |
|---|
name | string | Global value name |
Returns: string
Day {get_global_value("CurrentDay")}
g_str
Gets a global string value.
| Parameter | Type | Description |
|---|
name | string | Value name |
Returns: string
g_num
Gets a global numeric value.
g_num("SomeNumericValue")
| Parameter | Type | Description |
|---|
name | string | Value name |
Returns: float
Localization Function
l10n
Retrieves a localized string by key.
| Parameter | Type | Description |
|---|
key | string | Localization 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.
Returns: bool
get_cook_character
Gets the current cooking character.
Returns: int (character ID)
get_cook_character_dialog
Gets cooking dialogue for a character.
get_cook_character_dialog(1)
| Parameter | Type | Description |
|---|
type | int | Dialogue 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()
Related Pages