Use this page to navigate the Campaign Creation Documentation. It's not expected that you read all of this to create a campaign - Instead, use this as a reference during campaign creation, whenever you need to use a specific event.
In a Choice event, the player is presented with multiple options, each with its own image, name, description, and result.
Choices can also save variables or chain to other events.
Link | Name | Data Type | Description | Notes |
---|---|---|---|---|
LINK | list | [ { Object } ] | Each choice option. Can include desc, name, img, vars, chain. | |
LINK | limit | Int | The maximum number of choices to display at once. | By default, the event will show all possible choices. |
"choice": { "colorSelect": { "micon": "pack.webp", "mdesc": "Pick a color", "title": "Pick a Gadget Color!", "list": [ { "desc" : "Green", "name" : "Green Gadget", "img" : "Green.webp", "vars" : "color=>Green", "chain": "text:Green_text_Event" }, { "desc" : "Red", "name" : "Red Gadget", "img" : "Red.webp", "vars" : "color=>Red", "chain": "text:Red_text_Event" }, { "desc" : "Yellow", "name" : "Yellow Gadget", "img" : "Yellow.webp", "vars" : "color=>Yellow", "chain": "text:Yellow_text_Event" } ] } }
Each Object in the list array represents one choice that the user may make.
The list Objects may contain desc, name, img, vars, and chain attributes. All of these are optional.
desc | name | image | vars | chain | disable |
---|---|---|---|---|---|
Text to show, when hovering over this choice. | Name to show, when hovering over this choice | Image that this choice uses, from the /choice/ dir. | Variables to set, when this is chosen. This uses the older (=>) vars syntax. | Event to chain to, when this is chosen. | An object reflecting when this choice should be disabled. |
Simple Example
The disable property of a choice object allows you to 'hide' that choice under certain conditions.
This uses a syntax somewhat similar to extendWithSearch/shrinkFromSearch.
The disable property is a single Array of Objects.
The key of each of those Objects is the name of a Variable.
If the value of the Object is equal to that Variable's value, the choice is disabled.
The following example (1) shows a choice event with 2 options.
Selecting either option will set the corresponding variable to 'true', marking it as 'seen'.
This means that if we were to visit this choice event again, that choice would be disabled.
-----
Complex Example
The second example displays how you can combine requirements to make more complex disables.
Anything within [] is considered to be an AND, and the entire disable is a conjunction of ORs.
[ {a} , {b} ] reflects a OR b.
[ [ {a} , {b} ] ] reflects a AND b.
This can often lead to somewhat confusing jsons, so it might be worthwhile to instead set a single variable beforehand reliant on the properties for the disable.
"choice": { "example1": { "list": [ { "chain" :"text:cat", "img":"cat.webp", "vars":"seenCat=>true", "disable": [{"seenCat":"true"}] }, { "chain" :"text:dog", "img":"dog.webp", "vars":"seenDog=>true", "disable": [{"seenDog":"true"}] } ] }, "example2": { "list": [ { "chain" : "text:catDog", "img":"catOrDog.webp", "disable": [ {"seenDog":"true"},{"seenDog":"true"} ] }, { "chain" : "text:catDog", "img":"catAndDog.webp", "disable": [[{"seenCat":"true"},{"seenDog":"true"}]] } ] } }
Setting a limit is optional.
If present, a random subset of all possible choices will be displayed.
The list Objects may contain desc, name, img, vars, and chain attributes.