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)

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): expression should be a string. evaulates the expression with the 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