Your events.json file contains a list of all map events for your campaign.
"eventType": {
"eventName": {
"attributeName1": "someValue",
"attributeName2": "someValue",
"attributeName3": "someValue",
"attributeName4": "someValue",
}
},
Split lets you chain to different events, reliant on a condition.
These are like fork, but with a different syntax.
"myEvent": {
"split": {
"<<x>>" == 1 : "text:a", //If the value of the variable x is equal to 1, chain to the text event named "a".
"<<x>>" >= <<y>>: "text:b", //If the value of the variable x is greater than or equal to 1, chain to the text event named "b".
"1 == 1": "text:default" //If the number 1 is equal to the number 1, chain to the text event named "default" (this will always be true, but won't happen if a previous condition was met first.)
}
}
| Operation |
Name | Description |
Notes |
|---|---|---|---|
| = | Equality | True if left is equal to right | Identical to "==". |
| == | Equality | True if left is equal to right | Identical to "=". |
| === | Type Equality | True if left is equal to right in both Value and Type | Identical to "=" and "==", but enforces javascript type equality. DDM stores variables as Strings, so this usually is never required. |
| != | Not Equal To | True if left is not equal to right | |
| > | Greater than | True if left is greater than right | Both sides will be parsed as Integers. |
| >= | Greater than or Equal To | True if left is greater than or equal to right | Both sides will be parsed as Integers. |
| < | Less Than |
True if left is less than right | Both sides will be parsed as Integers. |
| <= | Less Than or Equal To | True if left is less than or equal to right | Both sides will be parsed as Integers. |
| includes | Includes | True if right is an element in left | Left must be a comma-separated "Array Literal": For example, the String "[cats,dogs,frogs,1,2,3]". Right must be a String. True if any "element" in left is equal to right. (Full example: "[cats,dogs] includes cats" => true) |
If you are planning a gigantic campaign with many similar events, you can use a "makes" Template Event.
A template is the same as any other event, but includes a "makes" attribute. These are used to generate other events from the template.
Templates are completely ignored during your campaign - you cannot chain to an event Template.
The "makes" attribute requires an Array of Key-Value pairs.
The key of each Object is a term to replace from the rest of the event data.
The value of each Object is the term to replace it with.
The example below has each term begin a dollar sign ($). This is not required, but is strongly recommended, to prevent user errors.
If the value is an [Array], a new event will be generated for each item in the array (recursively).
Here is an example:
{
"area": {
"START": {
"mdata": [
["pack:fire", "pack:water"],
["pack:wind", "pack:earth"]
]
}
},
"pack": {
"$name": {
"micon": "$name.webp",
"mdesc": "A booster pack full of $desc cards!",
"shows": 1,
"makes": [
{"$name": "fire" , "$desc": "Flaming" },
{"$name": "water", "$desc": "Aquatic" },
{"$name": "wind" , "$desc": "Windy Wooshy" },
{"$name": "earth", "$desc": "Hard-as-Stone"}
]
}
}
}
Which will generate the following json:
{
"area": {
"START": {
"mdata": [
["pack:fire", "pack:water"],
["pack:wind", "pack:earth"]
]
}
},
"pack": {
"fire": {
"micon": "$name.webp",
"mdesc": "A booster pack full of Flaming cards!",
"shows": 1
},
"water": {
"micon": "$name.webp",
"mdesc": "A booster pack full of Aquatic cards!",
"shows": 1
},
"wind": {
"micon": "$name.webp",
"mdesc": "A booster pack full of Windy Wooshy cards!",
"shows": 1
},
"earth": {
"micon": "$name.webp",
"mdesc": "A booster pack full of Hard-as-Stone cards!",
"shows": 1
}
}
}
As you can see, the makes version is much shorter and easier to edit. If you wanted to change "shows" from 1 to 2 for all events, you'd need to replace every instance of this in your JSON individually. But with the makes version, you only need to change 1 parameter.