Skip to main content

Condition Node

The Condition node evaluates an expression and routes execution to one of two outputs: true or false. It is the primary tool for creating story branches that depend on the state of your variables.

Simple Conditions

A simple condition compares a single variable against a value using a comparison operator. To configure it:

  1. Select a variable from the VariablePicker dropdown.
  2. Choose an operator: ==, !=, >, <, >=, or <=.
  3. Enter a comparison value.

The available operators work across all variable types:

  • Boolean — Typically compared with == against true or false.
  • Number — All six operators are useful. Example: score >= 50.
  • String — Equality checks with == and !=. Example: currentRoute == "A".
  • Item — Compared by quantity. Example: potionCount > 0.

Examples

  • hasKey == true — Check if the player has obtained a key.
  • affinity >= 50 — Check if a relationship score is high enough.
  • currentLocation != "dungeon" — Check that the player is not in the dungeon.

Compound Conditions

For more complex logic, build compound conditions that combine multiple checks with AND or OR operators.

Click "Add Condition" in the Inspector to add additional clauses. Each clause is a simple condition. The logic combinator determines how they are evaluated:

  • AND — All clauses must be true for the overall condition to be true.
  • OR — At least one clause must be true.

You can nest compound conditions by adding groups. A group has its own combinator and is evaluated as a unit within the parent expression.

Example: "The player has the key AND (strength is greater than 10 OR has the lockpick)"

AND
hasKey == true
OR
strength > 10
hasLockpick == true

True and False Outputs

The Condition node has two output handles:

  • True — Execution follows this edge when the condition evaluates to true.
  • False — Execution follows this edge when the condition evaluates to false.

Both outputs should be connected. If an output is left unconnected and execution reaches it, the player will halt.

VariablePicker with Inline Create

The variable dropdown in the Condition node includes a + button that lets you create a new variable without leaving the Inspector. Enter a name, select a type, set a default value, and the new variable is immediately available for use in the condition.

Where Conditions Are Used

The same condition system appears in several places throughout Nongine:

  • Condition nodes — Full branching based on variable state.
  • Choice option conditions — Show, hide, or disable individual choice options.
  • Sequence step conditions — Make individual steps conditional within a sequence.

Common Patterns

  • Gate content — Use a Condition node to check if the player has met a requirement (item, score, flag) before allowing access to a scene.
  • Skill checks — Evaluate a stat variable against a threshold. True leads to success, false to failure.
  • Route selection — Check a string variable that tracks which story route the player is on.
  • Fallthrough — Connect the True output to unique content and the False output back to the main story path, creating optional content that only appears under certain conditions.

Tips

  • Give your variables clear, descriptive names so conditions are readable at a glance.
  • When a condition becomes very complex, consider splitting it into multiple Condition nodes in sequence.
  • Use Comment nodes next to Condition nodes to document what each branch represents.