Skip to content

Expressions

Expressions are represented in yaml as strings. You can use math and boolean comparisons (like >= or ==) in them, and a number of functions. Attributes can be referenced by doing i.e. q:strength to get the strength quality.

1 is treated as true and 0 as false for boolean expressions.

Variables

  • i:example_item or item:example_item: count of items
  • q:example_quality or quality:example_quality: count of quality
  • c:example_circumstance or circumstance:example_circumstance: whether they have that circumstance. returns 1 if they do and 0 if they dont.
  • s:example_step or step:example_step: count of the steps they have on a path (i think)
  • hidden_flag:example: boolean, whether they have the hidden flag
  • action_flag:example: boolean, whether they have the action flag (gained when they do the action for the first time. id is the id of the action)
  • outcome_flag:example: boolean, whether they have the outcome flag (gained when they get the outcome for the first time. id is the id of the outcome)
  • item_cap:example: number, maximum amount they can have of the item
  • quality_cap:example: number, maximum amount they can have of the quality
  • item_min_cap:example: number, minimum amount they can have of the item
  • quality_min_cap:example: number, minimum amount they can have of the quality
  • world_enum:example: string, gets the world enum
  • wish:example: boolean, whether the vessel has fulfilled a wish (only usable on vessels)
  • accomodation:example: boolean, whether the vessel has this equipped accomodation (only usable on vessels)
  • linked_vessel_quality:example: number, count of the linked vessel's quality. if there's no linked vessel, returns 0.

Functions

There's a function set for some of the quality, items and such, like q("strength"), so the old code that uses that syntax still works.

  • undiscovered_outcomes_count(): gets the amount of undiscovered outcomes in the current area
  • has_stage(stage_id): whether the character has this stage (stages are things qualities can have)
  • max(a, b): returns whichever one is highest
  • min(a, b): returns whichever one is lowest
  • hunger_sated_by_tag(tag): number of times hunger has been sated by an item with this tag (not implemented)
  • location(): the area_id of the character's current location
  • vessel_character(expression): expression should be a string. only usable on vessels. evaulates the expression with the vessel's character instead of the vessel
  • linked_vessel(expression, default_value): expression should be a string. evaulates the expression with the linked vessel. returns default_value instead if there's no linked vessel.
  • boarded_vessel(expression): expression should be a string. evaulates the expression with the boarded vessel
  • voyage_vessel(expression): expression should be a string. evaulates the expression with the vessel they are currently voyaging with (only works during a voyage)
  • characters_vessels_in_area(area_id): amount of vessels the character has deployed in this area
  • can_set_sail(): boolean, whether the character can currently set sail / start a voyage
  • is_at_sea(): boolean, whether the character is currently at sea / voyaging
  • vessel_in_same_area(): only works on vessels. returns true if the vessel is in the same area as the character
  • voyage_current_danger(): only works while on a voyage. get the current danger level.
  • game_testing_tools_enabled(): boolean. returns true if the game testing tools / debug mode are enabled
  • get_world_variable_without_locking(namespace, variable_name, default): gets a world variable in namespace (string), returning default value if it isn't set. doesn't lock, meaning the variable can change between the call of this function and subsequent things in an action. if you're using the return of this value to modify the variable, or another in the same namespace, you should use the version that locks instead.
  • get_world_variable_with_locking(namespace, variable_name, default): gets a world variable in namespace (string), returning default value if it isn't set. locks, meaning that for the rest of this action, anything else will have to wait to modify the variable. you should use this version if you're using the result of this function to modify the same variable, or another in the namespace, later on in the action.