To define a quest add a QuestData json to your mod.
Similar to any other CatalogData you define an `id`, as well as `sensitiveContent`, `sensitiveFilterBehaviour` and `version`.
QuestData is currently using version 0.
Specific to QuestData we also define a list of `pois` or point of interests.
```json
{
"$type": "QuestFramework.QuestData, QuestFramework",
"id": "ExampleQuest",
"sensitiveContent": "None",
"sensitiveFilterBehaviour": "Discard",
"version": 0,
"pois": [
...
]
}
```
## Point of Interest
All point of interests have a `levelId` and a `position` to determine in which level they apply and where.
For dungeons you also need to define the optional `areaId` to get the POI to spawn in the correct room.
If a quest that is not completed or failed has POIs that meet their condition set in the `condition` field and are not disabled in the level that is being loaded they will be spawned in.
Each POI can have a list of `sequences` of interactions you can have with it.
The sequences all get executed based on their individual conditions.
The interactions, however, get executed sequentially.
Each POI also has a `interactionRadius` that is used for player-based interactions.
==For the Quest menu the new properties `name` is what appears in the third position "Level | POI | {Name}" and `hide` determines if the POI is shown at all while `hideOnMap` solely determines visibility on the map board.==
==Setting a `cullDistance` allows you to force the POI to disable when the player is not within the set radius. If set to 0 it will be ignored.==
```json
{
"$type": "QuestFramework.POI.PointOfInterest, QuestFramework",
"name": "Name",
"hide": false,
"hideOnMap": false,
"condition": {
...
},
"levelId": "Market",
"areaId": null,
"position": {
"x": -16.4,
"y": 1.942379,
"z": -7.473015
},
"interactionRadius": 2.5,
"cullDistance": 0.0,
"sequences": [
...
]
}
```
### NPC
The NPC POI has an additional `rotationY` field to define which direction the NPC should face, `creatureId` for the creature to spawn, `factionId` for which faction it should belong to, `containerId` for equipment the NPC should wear, `brainId` for which brain the NPC should use.
`failQuestOnKill` will fail the quest and `disablePoiOnKill` will disable the POI if the NPC dies.
`despawnOnInvalid` will make the NPC despawn as soon as it is no longer valid.
Failed quest / disabled POIs do not respawn on level load.
By default they are set to true.
In the following example a male Human will be spawned at `-16.4, 1.942379, -7.473015` belonging to a player neutral faction, wearing shirt, trousers and sandals while using a dummy brain so they just stand still.
```json
{
"$type": "QuestFramework.POI.Npc, QuestFramework",
"name": "Example NPC",
"hide": false,
"hideOnMap": false,
"condition": null,
"levelId": "Market",
"areaId": null,
"position": {
"x": -16.4,
"y": 1.942379,
"z": -7.473015
},
"interactionRadius": 2.5,
"cullDistance": 0.0,
"rotationY": 90.0,
"creatureId": "HumanMale",
"factionId": -1,
"containerId": "PlayerTutorial",
"brainId": "HumanDummy",
"failQuestOnKill": true,
"disablePoiOnKill": true,
"despawnOnInvalid": false,
"sequences": [
...
]
}
```
### GoToLevel
The GoToLevel POI has an additional `text` field to define what the popup will say, `destinationLevelId` for the level it will load you into, `destinationLevelMode` for which mode should be loaded and `destinationLevelOptions` for a list of level options.
Common level option included:
- PlayerSpawnerId,
- PlayerContainerId,
- PlayerVisibilityDistance,
- Difficulty,
- DungeonLength,
- DungeonRoom,
- Seed
==Version 1.1.1 added `destinationPosition` and `destinationRotationY` which create a PlayerSpawner at the given **WORLD** position and rotation.==
==This enables you to specify where the player spawns and in case of some dungeon rooms without a PlayerSpawner fix the infinite loading issue.==
==**To use the defined PlayerSpawner you will also need to add the level option "PlayerSpawnerId" with the value "gotolevel"**==
==Version 2.1.1 added `saveContainer` which, if true, will save the players inventory when loading into the level.==
In the following example a level load popup will happen at `17.39, 1.83, 18.45` on the Market level and upon confirmation will load the Home level and place the player at the boat near the world map.
```json
{
"$type": "QuestFramework.POI.GoToLevel, QuestFramework",
"name": "Exit",
"hide": false,
"hideOnMap": false,
"condition": null,
"levelId": "Market",
"areaId": null,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"interactionRadius": 2.5,
"cullDistance": 0.0,
"destinationLevelId": "Home",
"destinationLevelMode": "Sandbox",
"destinationLevelOptions": [
{
"name": "PlayerSpawnerId",
"value": "boat"
}
],
"text": "You are about to go to Home",
"destinationPosition": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"destinationRotationY": 0.0,
"saveContainer": false
}
```
### GoToCoord
The GoToCoord POI works like the GoToLevel POI but instead of teleporting the player to a different level it teleports the player to a different position.
It has an additional `text` field to define what the popup will say, `destinationPosition` for the position to teleport the player to and `destinationRotationY` for a rotation the player should face.
```json
{
"$type": "QuestFramework.POI.GoToCoord, QuestFramework",
"name": "Exit",
"hide": false,
"hideOnMap": false,
"condition": null,
"levelId": "Market",
"areaId": null,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"interactionRadius": 2.5,
"cullDistance": 0.0,
"destinationPosition": {
"x": -15.35,
"y": 1.94,
"z": -1.46
},
"destinationRotationY": 90,
"text": "You are about to go to Home"
}
```
### Item
The Item POI has an additional `rotation` and `itemId` field to define what what item and in which rotation it should be spawned.
You can also set `isStatic` to true if you want the item to stay in place, unaffected by any force, until it is grabbed.
By default `disableOnStoreInInventory` is set to true and will disable the POI if the item gets stored in the inventory.
`despawnOnInvalid` will make the item despawn as soon as it is no longer valid.
==The new `transferOwnership` will make the item player owned when grabbed.==
```json
{
"$type": "QuestFramework.POI.Item, QuestFramework",
"name": "Arthur's Sword",
"hide": false,
"hideOnMap": false,
"condition": null,
"levelId": "Market",
"areaId": null,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"rotation": {
"x": 90.0,
"y": 0.0,
"z": 0.0
},
"itemId": "ArthursSword",
"isStatic": false,
"interactionRadius": 2.5,
"cullDistance": 0.0,
"disableOnStoreInInventory": true,
"despawnOnInvalid": false,
"transferOwnership": false
}
```
### Destruction
The Destruction POI has the following additional field:
- `itemIds`: list of item IDs
- `itemFilter`: can be AnyExcept or NoneExcept
- ==`itemVariableQuestId`: id of the quest the variable is saved in==
- `itemVariableName`: name of the variable that should be incremented
- `creatureIds`: list of creature IDs
- `creatureFilter`: can be AnyExcept or NoneExcept
- ==`creatureVariableQuestId`: id of the quest the variable is saved in==
- `creatureVariableName`: name of the variable that should be incremented
When a item in the interaction radius of the POI is destroyed or a creature is killed and the respective ID is / is not in the filter the respective variable will be incremented by 1.
In the following example we count how many barrels were destroyed in a radius of 10, as well as how many creatures that are not Chickens have been killed.
```json
{
"$type": "QuestFramework.POI.Destruction, QuestFramework",
"name": "Example",
"hide": false,
"hideOnMap": false,
"condition": null,
"levelId": "Market",
"areaId": null,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"interactionRadius": 10,
"cullDistance": 0.0,
"itemIds": [
"Barrel1"
],
"itemFilter": "NoneExcept",
"itemVariableQuestId": "ExampleQuest",
"itemVariableName": "BarrelsBroken",
"creatureIds": [
"Chicken"
],
"creatureFilter": "AnyExcept",
"creatureVariableQuestId": "ExampleQuest",
"creatureVariableName": "NonChickensKilled"
}
```
## Sequences
Sequences a list of `interactions` that get executed sequentially if the `condition` is met.
```json
{
"$type": "QuestFramework.Sequence, QuestFramework",
"condition": {
...
},
"interactions": [
...
]
}
```
## Interactions
Interactions define how you can interact with a POI.
Some may only work with particular POIs.
They will be executed sequentially and will only start executing if the `condition` is met and the player is within the interaction radius.
You can disable this by setting `needsPlayerInZone` to false.
Every interaction has the fields:
`continueBehaviour` determines when to execute the next interaction
- `FinishAction`: continues after the action was successfully executed
- `ContinueImmediately`: continues immediately
`checkpointBehaviour` determines where to continue when interaction is started again
- `None`: starts at last saved checkpoint
- `Current`: starts at this interaction again
- `Next`: starts at the next interaction again
```json
{
"$type": "QuestFramework.Interactions.Interaction, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true
}
```
### Dialog
Dialog has one additional field `text` for which text should be displayed in the speech box.
The dialog will be above the NPCs head or at the location of the POI.
If the transform is not present, for some reason (like an item being stored in the inventory), the dialog will show up on the left hand of the player.
Upon skipping of the text by holding left trigger the interaction is successful.
==With the `npcTurnToPlayer` and `npcLookAtPlayer` you can control whether the NPC should turn to / look at the player.==
In the following example we stop the interaction after the "Good luck!" dialog and next time the interaction is initiated we continue with the next interaction in the list.
```json
{
"$type": "QuestFramework.Interactions.Dialog, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "Next",
"needsPlayerInZone": true,
"text": "Good luck!",
"npcTurnToPlayer": true,
"npcLookAtPlayer": true
}
```
### SetQuestState
SetQuestState will set the assotiated quest's state.
When the level is reloaded a Completed or Failed quest will no longer be loaded in.
Possible states are:
- None
- InProgress
- Completed
- Failed
The following example will complete the quest and immediately execute the next interaction.
It will also make a checkpoint at the next interaction where the interaction will be continued if the interaction is reinitiated.
```json
{
"$type": "QuestFramework.Interactions.SetQuestState, QuestFramework",
"condition": null,
"continueBehaviour": "ContinueImmediately",
"checkpointBehaviour": "Next",
"needsPlayerInZone": true,
"state": "Completed"
}
```
### DisablePoi
DisablePoi will disable a POI.
When the level is reloaded the POI will no longer be loaded in.
```json
{
"$type": "QuestFramework.Interactions.DisablePoi, QuestFramework",
"condition": null,
"continueBehaviour": "ContinueImmediately",
"checkpointBehaviour": "Next",
"needsPlayerInZone": true
}
```
### Wave
Wave will start a wave with the defined `waveId` or stop a wave if no id is defined.
If `spawnerIndex` is defined it will use the wave spawner present in the level based on the index, otherwise it will try and find a spawner with the name set in the `spawnerName` field.
If all this fails to find a spawner a new one will be created with the set name.
Additionally, a list of `position` and `rotation` can be defined under`spawns` to add (new) spawn positions.
The interaction succeeds once the wave is won or immediately if the wave is to be stopped.
```json
{
"$type": "QuestFramework.Interactions.Wave, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"waveId": "Bandit1",
"spawnerIndex": 0,
"spawns": [
{
"position": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
]
}
```
### Set{Type}Variable
The Set{Type}Variable interaction sets the value of the variable defined in the `variableName` field to the `value` field value.
==`questId` defines where the variable is saved.==
Possible types are:
- SetBoolVariable: for true / false
- SetIntVariable: for integer values (whole numbers)
- SetFloatVariable: for floating point numbers (fractions)
- SetStringVariable: for text
- SetTimeVariable: this is a float that sets the current time in seconds since the game started
- SetRandomIntVariable: this is an integer that sets a random number between `min` and `max`
- SetRandomFloatVariable: this is a float that sets a random number between `min` and `max`
The following example would set the value of IsExample to true.
```json
{
"$type": "QuestFramework.Interactions.SetBoolVariable, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"questId": "ExampleQuest",
"variableName": "IsExample",
"value": true
}
```
### Increment{Type}Variable
The Increment{Type}Variable interaction increments the value of the variable defined in the `variableName` field by the `value` field value.
==`questId` defines where the variable is saved.==
Possible types are:
- IncrementIntVariable: for integer values (whole numbers)
- IncrementFloatVariable: for floating point numbers (fractions)
The following example would increment the value of IsExample by 1.
```json
{
"$type": "QuestFramework.Interactions.IncrementIntVariable, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"questId": "ExampleQuest",
"variableName": "IsExample",
"value": 1
}
```
### MoveTo
The MoveTo interaction moves the POI to the defined `position` and `rotation`.
==For dungeons you can also define `areaId`.==
If the POI is a NPC the NPC will walk / run to the location.
In that case you can also define:
- `moveSpeedRatio`:
- `runSpeedRatio`:
- `targetRadiusAngle`:
- `unobstructedPathFirst`:
- `repathMinDelay`:
- `repathMaxDelay`:
```json
{
"$type": "QuestFramework.Interactions.MoveTo, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"rotation": {
"x": 0.0,
"y": 0.0,
"z": 0.0
}
}
```
### JumpTo
The JumpTo interaction will continue the sequence from the start.
If the option `index` field is set you can also define where in the sequence it should jump to.
*Note that the first interaction in a sequence is index 0.*
```json
{
"$type": "QuestFramework.Interactions.JumpTo, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"index": 0
}
```
### Effect
The Effect interaction will spawn the effect defined in `effectId` with `intensity` and `speed` at the position and rotation of the POI with the defined `positionOffset` and `rotationOffset`.
The interaction finishes when one of the effect modules despawns.
```json
{
"$type": "QuestFramework.Interactions.Effect, QuestFramework",
"condition": null,
"continueBehaviour": "ContinueImmediately",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"effectId": "SpellGravityPush",
"intensity": 1.0,
"speed": 1.0,
"positionOffset": {
"x": 0,
"y": 1,
"z": 0
},
"rotationOffset": {
"x": 0,
"y": 0,
"z": 0
}
}
```
### ==Choice==
The Choice interaction will spawn a menu with a list of options defined in `options`.
In the option you can define `text` for the listed text and `interaction` for an interaction to play once option is selected.
==With the `npcTurnToPlayer` and `npcLookAtPlayer` you can control whether the NPC should turn to / look at the player.==
The interaction finishes when the selected options interaction finishes or immediately when no interaction is passed.
```json
{
"$type": "QuestFramework.Interactions.Choice, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"positionOffset": {
"x": 0,
"y": 1.5,
"z": 0.5
},
"options": [
{
"text": "Example option",
"interaction": null
}
],
"npcTurnToPlayer": true,
"npcLookAtPlayer": true
}
```
### ==TeleportPlayer==
The TeleportPlayer interaction teleports the player to the defined `position` facing the defined `rotationY`.
For dungeons you can also define `areaId`.
Optionally, you can also define `useFading`, `fadeInDuration` and `fadeOutDuration` to make the screen fade to black when teleporting.
```json
{
"$type": "QuestFramework.Interactions.TeleportPlayer, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"areaId": null,
"position": {
"x": 17.39,
"y": 1.83,
"z": 18.45
},
"rotationY": 0.0,
"useFading": true,
"fadeInDuration": 1.0,
"fadeOutDuration": 1.0
}
```
### ==StopInteraction==
The StopInteraction interaction has no additional fields.
Once executed it will stop the interaction.
This is useful if you want to add an option in the choice interaction that stops the flow of interactions.
```json
{
"$type": "QuestFramework.Interactions.StopInteraction, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true
}
```
### ==SetCurrency==
The SetCurrency interaction sets the `value` of a given `currencyType`.
This is useful if you want to change the amount of gold a Player has.
The following example would set the Gold of the Player back to 0.
```json
{
"$type": "QuestFramework.Interactions.SetCurrency, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"currencyType": "Gold",
"value": 0
}
```
### ==AddCurrency==
The AddCurrency interaction adds (or subtracts in case of negative value) the `value` of a given `currencyType`.
This is useful if you want to give the Player gold or have the Player pay for something.
In the latter case you should definitely enable `checkCanAfford` to only succeed the interaction if the Player has enough ofthe currency.
The following example would remove 100 Gold from the Player, if the Player has enough Gold.
```json
{
"$type": "QuestFramework.Interactions.AddCurrency, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"currencyType": "Gold",
"value": -100,
"checkCanAfford": true
}
```
### Speak
:::warning
*Only works for NPC POI*
:::
Speak has one additional field `dialogId` for which dialog of the creatures voice should be played.
==Setting the optional `text` will also display a speech bubble like in the Dialog interaction.==
When the audio clip finishes ==or the speech bubble get's skipped== the interaction succeeds.
==With the `turnToPlayer` and `lookAtPlayer` you can control whether the NPC should turn to / look at the player.==
In the following example the NPC speaks `dialog1` and immediately continues with the next action to for example also display the dialog in text.
```json
{
"$type": "QuestFramework.Interactions.Speak, QuestFramework",
"condition": null,
"continueBehaviour": "ContinueImmediately",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"dialogId": "dialog1",
"text": "Dialog in a speech bubble (optional).",
"turnToPlayer": true,
"lookAtPlayer": true
}
```
### Handshake
:::warning
*Only works for NPC POI*
:::
Handshake will initiate a handshake for example to initiate the quest.
The NPC will reach out their hand and wait for the player to grab it.
Upon letting go of the hand the interaction is successful.
==With the `turnToPlayer` and `lookAtPlayer` you can control whether the NPC should turn to / look at the player.==
```json
{
"$type": "QuestFramework.Interactions.Handshake, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"turnToPlayer": true,
"lookAtPlayer": true
}
```
### ReceiveItem
:::warning
*Only works for NPC POI*
:::
ReceiveItem will make the NPC hold up their hand to receive an item.
The item defined in `itemId` will be the only item allowed.
Once the item has been placed in the hand of the NPC they will take the item, ==and if `transferOwnership` is true the ownership is transferred (player no longer owns it)== and despawn it once the animation completes.
You can also instead define `holderName` to holster the item in the defined holder.
If no holder is found it will fall back to despawn the item.
This makes the interaction succeed.
There are also optional fields for:
- `receiveAnimationDataId`: Animation that plays while waiting for the player
- `storeAnimationDataId`: Animation that plays once the player places the item
- `finishAnimationDataId`: Animation that plays after the item despawns
```json
{
"$type": "QuestFramework.Interactions.ReceiveItem, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"itemId": "ArthursSword",
"holderName": "BackRight",
"receiveAnimationDataId": "HumanReceiveItem",
"storeAnimationDataId": "HumanStoreItem",
"finishAnimationDataId": "HumanReceiveItemFinish",
"transferOwnership": true
}
```
### GiveItem
:::warning
*Only works for NPC POI*
:::
GiveItem will spawn the item defined in `itemId` in the hand of the NPC which will hold out their hand until the player takes the item.
==If `transferOwnership` is true the Player will own the item.==
You can also instead define `holderName` to unholster the item in the defined holder.
If no holder or item is found it will fall back to spawn the item.
This will make the interaction succeed.
There are also optional fields for:
- `prepareAnimationDataId`: Animation that plays before the item spawns
- `waitAnimationDataId`: Animation that plays while waiting for the player
- `finishAnimationDataId`: Animation that plays once the player took the item
- `cancelAnimationDataId`: Animation that plays if the player doesn't take the item
==With the `turnToPlayer` and `lookAtPlayer` you can control whether the NPC should turn to / look at the player.==
```json
{
"$type": "QuestFramework.Interactions.GiveItem, QuestFramework",
"condition": null,
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"itemId": "FoodApple",
"holderName": "HipsRight",
"prepareAnimationDataId": "HumanGiveItemPrepare",
"waitAnimationDataId": "HumanGiveItem",
"finishAnimationDataId": "HumanGiveItemFinish",
"cancelAnimationDataId": "HumanStoreItem",
"transferOwnership": true,
"turnToPlayer": true,
"lookAtPlayer": true
}
```
### Animation
:::warning
*Only works for NPC POI*
:::
Animation has one additional field `animationDataId` for which animation the NPC should play.
When the animation finishes the interaction succeeds.
If no id is defined the interaction will stop any running animation.
==With the `turnToPlayer` and `lookAtPlayer` you can control whether the NPC should turn to / look at the player.==
```json
{
"$type": "QuestFramework.Interactions.Animation, QuestFramework",
"condition": null,
"continueBehaviour": "ContinueImmediately",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"animationDataId": "HumanSit",
"turnToPlayer": false,
"lookAtPlayer": false
}
```
### ==UpdateNpc==
:::warning
*Only works for NPC POI*
:::
UpdateNpc has most of the fields that the NPC POI has.
When the interaction runs the corresponding fields on the NPC will change.
Leave any field null or don't include it at all to not change it.
The following example will make an NPC hostile towards the player and will nolonger fail the quest once killed.
```json
{
"$type": "QuestFramework.Interactions.UpdateNpc, QuestFramework",
"continueBehaviour": "FinishAction",
"checkpointBehaviour": "None",
"needsPlayerInZone": true,
"factionId": 4,
"containerId": null,
"brainId": "HumanHard",
"failQuestOnKill": false,
"disablePoiOnKill": null,
"despawnOnInvalid": null
}
```
## Condition
### And
The And condition is valid if all the conditions defined in the `conditions` field are valid.
```json
{
"$type": "QuestFramework.Conditions.And, QuestFramework",
"conditions": [
{
...
}
]
}
```
### Or
The Or condition is valid if any of the conditions defined in the `conditions` field are valid.
```json
{
"$type": "QuestFramework.Conditions.Or, QuestFramework",
"conditions": [
{
...
}
]
}
```
### Not
The Not condition is valid if the condition defined in the `condition` field is not valid.
```json
{
"$type": "QuestFramework.Conditions.Not, QuestFramework",
"condition": {
...
}
}
```
### QuestState
The QuestState condition is valid if the quest defined in the `questId` field is the defined state.
The field `state` can be the following values:
- None
- InProgress
- Completed
- Failed
```json
{
"$type": "QuestFramework.Conditions.QuestState, QuestFramework",
"questId": "ExampleQuest",
"state": "Completed"
}
```
### Compare{Type}Variable
The Compare{Type}Variable condition is valid if the value of the variable defined in the `variableName` field compared to the `value` field is what is defined in the `comparisonType` value ==and `questId` defines where the variable is saved.==
Comparison types are:
- LessThan: value precedes savedValue (smaller or alphabetically earlier)
- Equal: value equals savedValue
- GreaterThan: value follows savedValue (greater or alphabetically later)
Possible types are:
- CompareBoolVariable: for true / false
- CompareIntVariable: for integer values (whole numbers)
- CompareFloatVariable: for floating point numbers (fractions)
- CompareStringVariable: for text
- CompareTimeVariable: this is a float that subtracts the saved value from the current time
The following example would be valid if the value in IsExample is true.
```json
{
"$type": "QuestFramework.Conditions.CompareBoolVariable, QuestFramework",
"questId": "ExampleQuest",
"variableName": "IsExample",
"value": true,
"comparisonType": "Equal"
}
```
### InZone
The InZone condition is valid if the amount of creatures / items defined in the `creatureIds` / `itemIds` field is greater or equal to `count`.
Use only one list of creatures or items.
The following example would be valid if there is at least 1 log in the zone.
```json
{
"$type": "QuestFramework.Conditions.InZone, QuestFramework",
"creatureIds": null,
"itemIds": [
"WoodLog1"
],
"count": 1
}
```
### ItemInInventory
The ItemInInventory condition is valid if the `itemId` is at least `count` times in the players inventory, holders, hands ==or armour.==
==These can be toggled off separately.==
The following example would be valid if there is at least 1 apple in the players inventory.
```json
{
"$type": "QuestFramework.Conditions.ItemInInventory, QuestFramework",
"itemId": "FoodApple",
"count": 1,
"checkHolders": true,
"checkInventory": true,
"checkLeftHand": true,
"checkRightHand": true,
"checkArmour": true
}
```
### ==CompareCurrency==
The CompareCurrency condition is valid if the value of the currency defined in the `currencyType` field compared to the `value` field is what is defined in the `comparisonType` value.
The following example would be valid if the Player has at least 1 Gold.
```json
{
"$type": "QuestFramework.Conditions.CompareCurrency, QuestFramework",
"currencyType": "Gold",
"value": 0,
"comparisonType": "GreaterThan"
}
```
### IsDestroyed
:::warning
*Only works for item and NPC POIs*
:::
The IsDestroyed condition is valid if item / NPC in this POI is broken / destroyed.
```json
{
"$type": "QuestFramework.Conditions.IsDestroyed, QuestFramework"
}
```
### IsGrabbed
:::warning
*Only works for item and NPC POIs*
:::
The IsGrabbed condition is valid if item / NPC in this POI is grabbed.
```json
{
"$type": "QuestFramework.Conditions.IsGrabbed, QuestFramework"
}
```
### ==BrainState==
:::warning
*Only works for NPC POIs*
:::
The BrainState condition is valid if the NPC has the defined `state`.
```json
{
"$type": "QuestFramework.Conditions.BrainState, QuestFramework",
"state": "Combat"
}
```
### ==Detected==
:::warning
*Only works for NPC POIs*
:::
The Detected condition is valid if the NPCs alertness level exceeds the detect alertness threshold define in the BrainModuleDetection.
```json
{
"$type": "QuestFramework.Conditions.Detected, QuestFramework"
}
```
### ==Health==
:::warning
*Only works for NPC POIs*
:::
The Health condition is valid if the NPCs health comparison check defined in `comparisonType` succeeds for `value`.
The following example would succeed if the NPC has less than 100 health points.
```json
{
"$type": "QuestFramework.Conditions.Health, QuestFramework",
"value": 100.0,
"comparisonType": "LessThan"
}
```