mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-08 23:08:35 +07:00
Added documentation and schemas for events
This commit is contained in:
@ -114,6 +114,25 @@ The code below is an example of a valid "turns" definition and it specifies that
|
||||
]
|
||||
```
|
||||
|
||||
## Events.json
|
||||
|
||||
Events allow users to choose between options of triggers to activate.
|
||||
|
||||
| Attribute | Type | Default | Notes |
|
||||
|-----------|----------------------|----------|-----------------------------------------------------------|
|
||||
| name | String | Required | Used for triggering via "Triggers a [event] event" unique |
|
||||
| text | String | None | Flavor text displayed to user |
|
||||
| choices | List of EventChoices | | User can choose to trigger one of the viable choices |
|
||||
|
||||
Event choices are comprised of:
|
||||
|
||||
| Attribute | Type | Default | Notes |
|
||||
|------------------|-----------------------------|------------|---------------------------------------------------------------|
|
||||
| text | String | Required | Displayed to user. Should be an action name - "Do X" |
|
||||
| triggeredUniques | List of trigger uniques | Required | The triggers that this choice activates upon being chosen |
|
||||
| conditions | List of conditional uniques | Empty list | If any conditional is not met, this option becomes unpickable |
|
||||
|
||||
|
||||
## ModOptions.json
|
||||
|
||||
<!-- [Link to original](https://github.com/yairm210/Unciv/tree/master/android/assets/jsons/Civ%20V%20-%20Gods%20&%20Kings/ModOptions.json) -->
|
||||
|
@ -66,6 +66,13 @@ Tada! Now Android Studio will recognize all Buildings.json files as belonging to
|
||||
],
|
||||
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/tileResources.json"
|
||||
}
|
||||
,
|
||||
{
|
||||
"fileMatch": [
|
||||
"*/Events.json"
|
||||
],
|
||||
"url": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/events.json"
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
|
32
docs/Modders/schemas/events.json
Normal file
32
docs/Modders/schemas/events.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"text": { "type": "string" },
|
||||
"choices": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"text": { "type": "string" },
|
||||
"triggeredUniques": {
|
||||
"$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/uniques.json",
|
||||
"minItems": 1
|
||||
},
|
||||
"conditions": {
|
||||
"$ref": "https://raw.githubusercontent.com/yairm210/Unciv/master/docs/Modders/schemas/uniques.json"
|
||||
}
|
||||
},
|
||||
"required": ["text", "triggeredUniques"],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name", "text"
|
||||
],
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user