-
Notifications
You must be signed in to change notification settings - Fork 10
Conditions
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.
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:
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.
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.
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.
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).
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).
In a dialogue block, you can pick dialogue's ID, the marker ID and the target player (see below for more information about target).
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.
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.
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 (
0
—12000
). -
Is night? checks whether it's night in the world (
12000
—24000
). - Range checks whether world's time is between minimum (the left field) and maximum (the right field).
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).
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 iffound
is less thantarget
-
found <= target
(<=
), true iffound
is less than or equals totarget
-
found == target
(==
), true iffound
equals totarget
-
found >= target
(>=
), true iffound
is greater than or equals totarget
-
found > target
(>
), true iffound
is greater thantarget
If parts of the wiki don't make sense with Mappet's latest version, or you weren't able to recreate examples (i.e. outdated information), feel free to report the page and section that is out of date on community's Discord server (make sure to mention which Mappet’s version did you use).