Skip to content

Conditions

McHorse edited this page May 21, 2021 · 10 revisions

Conditions is a Mappet mechanism that allows to check something, kind of like expressions do, but using GUI and blocks. If you're not good with coding, you may try using conditions instead of expressions.

Conditions are available in every checker component.

Editing

When a checker component is toggled in a condition state (when Edit condition... button is present) click on the Edit condition... button and it will open condition editor modal:

Empty condition editor

By right clicking where it says Right click here... and Add a condition... will allow you to add a condition. Try adding a World time condition block. After adding on the left you would see condition block list and condition block editor on the right.

Condition editor

By right clicking you can also remove and copy/paste conditions. If you have multiple condition blocks in the list you can sort by drag and dropping.

Condition blocks

At the moment of writing of this documentation, condition editor supports following condition blocks:

  • Quest condition block, this block allows to check whether player(s) (or the world) has no quests, in-progress quests or completed quests.
  • State condition block, this block allows to compare a state of a player or of the world.
  • Dialogue condition block, this block allows to check whether a player read dialogue.
  • Faction condition block, this block allows to check player's relationship with a faction.
  • Item condition block, this block allows to check whether a player holds, equips or has an item in the inventory.
  • World time condition block, this block allows to check world's time.
  • Condition condition block, this block allows to setup nested conditions.

Quest block

In a quest block, you can pick quest's ID, the completion state (absent, present or completed) and the target player (see below for more information about target).

State block

In a state block, you can pick the key of a state, target where to look for the state (see below for more information about target) and comparison mode (see below for more information about comparison modes).

Dialogue block

In a dialogue block, you can pick dialogue's ID, the marker ID and the target player (see below for more information about target).

Faction block

In a faction block, you can pick faction's ID, faction comparison mode, the target player (see below for more information about target) and comparison mode (see below for more information about comparison modes)

Faction comparison mode can be:

  • Aggressive checks whether attitude towards found player is aggressive.
  • Passive checks whether attitude towards found player is passive.
  • Friendly checks whether attitude towards found player is friendly.
  • Score checks faction scare of the found player using comparison mode.

Item block

In an item block, you can pick any item stack, item comparison mode and the target player (see below for more information about target).

Item comparison mode can be:

  • Held (hands) checks whether the player must hold in hands (stack count isn't accounted for).
  • Equipment (armor) checks whether the player has an item stack equipped in an armor slot (i.e. helmet, chestplate, leggings or feet).
  • Inventory checks whether the player has an item stack in the inventory.

World time block

In a world time block, you can pick time condition mode, and range (but only if time condition range is Range).

Time condition mode can be:

  • Is day? checks whether it's day in the world (012000).
  • Is night? checks whether it's night in the world (1200024000).
  • Range checks whether world's time is between minimum (the left field) and maximum (the right field).

Targeting

In most condition block editors, there is Target button which allows to toggle between different targeting modes.

  • Global targets the world/server.
  • Subject targets the subject entity in event's context.
  • Object targets the object entity in event's context.
  • Selector targets one player by given target selector (if target selector finds more than one player it return voids the check of the block).

Comparison

In some condition block editors, there is Comparison module which allows setup comparison of found value. The value field allows to set the target value against which the comparison will be evaluated. Consider that found and target are variables, then comparison operators will work like this:

  • found < target (<), true if found is less than target
  • found <= target (<=), true if found is less than or equals to target
  • found == target (==), true if found equals to target
  • found >= target (>=), true if found is greater than or equals to target
  • found > target (>), true if found is greater than target
Clone this wiki locally