No active sessions yet.

No games yet.

No conversations yet.

No characters yet.

Asking questions

The true/false half of the API: $.hasItem, $.alive, $.hasPlugin and friends.

These answer yes or no. Conditions are built from them.

Inventory

$.hasItem("Rope"); // any at all?
$.hasItem("Rope", 3); // at least three?

People and places

$.alive("Ironjaw"); // is this NPC alive?
$.at("Ironjaw", "the mill"); // is this NPC here?
$.location.name === "the mill"; // is this happening at the mill?

A spawn step's id works here too:

$.exists("nest-swarm"); // is the thing spawned with this id in the world?
$.alive("nest-swarm"); // and not dead?
$.hasItem("smugglers-box"); // does the subject carry that one copy?

$.location is the place the rule is running in: where the player is standing for an item they use, where the event fired for an event. It is a read that compares with === instead of asking the model.

Names are as they appear in your game. A missing name returns false. A typo reads as "no" instead of raising an error. Use editor completion.

Abilities and gear

$.hasAbility("secondwind");
$.slotEmpty("offhand"); // false if the body has no offhand at all
$.slotHolds("weapon", "Iron Sword");

Other plugins

$.hasPlugin("hunger"); // is that plugin installed?
$.hasField("infection", "target"); // does this entity have that field?

Any plugin can read any field, so ask first. Without the check, $.field('satiety') in a game without the hunger plugin reads null, and your rule acts as if everyone is always starving or never hungry, depending on which way the comparison points.

$.hasPlugin("hunger") && $.field("satiety") < 20 ? 2 : 1; // hits harder if also hungry

Time windows

$.timeBetween("20:00", "04:00"); // handles midnight

An operator chosen at runtime

$.compare(actual, op, target);

For when the operator comes from data, like a quest that stores '>=' next to its threshold.

Every question

Call Answers
$.hasItem('rope', 2) Whether the subject has at least this many.
$.delivered('Raw Copper Ore', 1, 'Foreman Hilda') Quest steps only: whether the party has put at least that many in that NPC's hands. They keep them when the step completes.
$.carried('weight') The total of a field across everything carried.
$.stats.luck A map of stat names to values for this character, including custom stats alongside the default five. Read this when a rule needs to handle every stat alike. Use $.stat(name) when you want a specific one. Role aliases like might and engine:might point to whichever stat claims them, so looping over keys can return repeated values.
$.stat('might') A stat on the subject: health, playerLevel, a stat key this game declares, or a role (might, resolve, presence, speed, evasion, accuracy, insight, or a plugin's) once one of its stats claims it. Prefer the role, which survives a rename. Any other name has no value. The formula fails and a gate stays shut. get_plugin lists what each key reads in this game (statReads).
4 + $.skill('Healing') * 3 A rank in a declared skill, or 0 when untrained. Reads the player's, or the subject's when who is "target". Damage and heal steps on tagged abilities or items already scale with rank, so use this if you need a custom formula.
$.field('satiety', 'player') One declared field, number or text, on the subject or whoever who names - "player", "target", "location" for the place this is happening in, or "weapon" for what the subject wields.
$.compare(actual, op, target) Compare two values with an operator chosen at runtime.
$.alive('Ironjaw') Whether a named entity is alive.
$.exists('hornet-swarm') Whether something a spawn step made with this id is in the world (an item anywhere, or a creature alive or dead).
$.questIs('BORROWED_CARTRIDGE', 'completed') Whether the quest with this id stands "active", "completed" or "failed".
$.questStep('BORROWED_CARTRIDGE') >= 2 How many steps of the quest are done: -1 before it is taken, every step once finished.
$.at('Ironjaw', 'the mill') Whether a named entity is at a location.
$.itemAt('House Fire', 'the mill') Whether an item is lying at a location - on the ground or fixed in place, not carried.
$.mobsAt('the mill').filter(n => n === 'Shambler').length The creatures in sight at any place, by name, as $.mobs lists them for the place this is happening in. Inside a hook about a creature or NPC somewhere else, $.mobs is still where the party is, so read the place they stand in with $.mobsAt($.subject.location).
$.positionOf($.subject.location) A place's pin as { x, y, map }, where it stands now: x grows east, y grows south, and map is the place whose map holds the pin ('' for the top map). Null for a place with no pin. Compare positions only on the same map; $.directionOf lifts two places onto one.
$.directionOf($.event.from, $.event.to) === 'North' The compass direction from one place to another, one of East, South-East, South, South-West, West, North-West, North, North-East, read on the deepest map holding both, as exits are told. '' when they share a spot or have no pins.
Object.keys($.exitsOf($.subject.location)) Every place one hop from any place, as { name: distance }, the shape $.exits has for the place this is happening in. Walk it outward to reach places further off.
$.timeBetween(from, to) Whether the clock now reads between two times.
$.hasAbility('secondwind') Whether the subject has an ability.
$.slotEmpty('offhand') Whether a slot exists on this body AND is empty. False for a slot the body does not have, since a missing hand cannot be freed up.
$.slotHolds('weapon', 'Iron Sword') Whether one named item is worn in a particular slot.
$.hasPlugin('hunger') Whether another plugin is installed - ask before reading its fields.
$.hasField('infection', 'target') Whether a field exists. Use it to tell an unset field from a real zero.
$.dial('foodDrainPerHour') One of your own plugin's dials. Never freeze a dial's value as a literal.
$.table('conditions') Returns every row in a table as an array, from this plugin or another if you provide its ID. If the table is undeclared or its plugin is off or missing, you get an empty array and loops simply skip.
$.row('mechanisms', 'pump', 'firearm-mechanisms') One row found by its first column, or null when nothing matches: from your own table, or another plugin's when you name its id. Read a cell off it by column key.
$.random() < 0.25 A random number from 0 up to (but not including) 1. ONLY inside a script body - in a condition or an amount expression it answers null, because those are cached and a cached roll is the same roll every time. Roll in the body and pass the result to a step.
$.rollDie(6) A whole number from 1 to faces, like one die. Script bodies only, for the reason $.random() gives. Null if faces is not at least 1.
$.pick($.row('seasons', 'winter').weights) Picks an option at random. With a weights map, each key's chance is its weight over the total, ignoring keys with weights of zero or less. With a plain array, it picks evenly. Returns the chosen key or entry, or null if no valid options exist. Script bodies only. Pull from table rows where entries are validated, so typos won't slip through.