From 42eb0fb0407e841b63f1b96822330a4f6a59847c Mon Sep 17 00:00:00 2001 From: yairm210 Date: Fri, 1 Nov 2024 12:02:36 +0200 Subject: [PATCH] Modding: Added validation to event uniques Fixes tutorial --- .../jsons/Civ V - Gods & Kings/Events.json | 18 +++++++++--------- .../ruleset/validation/RulesetValidator.kt | 1 + docs/Modders/uniques.md | 5 +++++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/android/assets/jsons/Civ V - Gods & Kings/Events.json b/android/assets/jsons/Civ V - Gods & Kings/Events.json index 3ac587df9f..3ae4ef2126 100644 --- a/android/assets/jsons/Civ V - Gods & Kings/Events.json +++ b/android/assets/jsons/Civ V - Gods & Kings/Events.json @@ -8,7 +8,7 @@ {"text":"Click on a unit → Click on a destination → Click the arrow popup."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -21,7 +21,7 @@ {"text":"Select the Settler → Click on 'Found city'."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -34,7 +34,7 @@ {"text":"Click the city button twice."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -60,7 +60,7 @@ {"text":"Enter city screen → Click on a unit or building → Click 'add to queue'."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -86,7 +86,7 @@ {"text":"Enter city screen → Click the assigned tile to unassign → Click an unassigned tile to assign population."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -99,7 +99,7 @@ {"text":"Explore the map until you encounter another civilization!"}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ], "choices": [ @@ -131,7 +131,7 @@ {"text":"Construct a Worker unit → Move it to a Plains or Grassland tile → Click 'Construct improvement' → Choose the farm → Leave the worker there until it's finished."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -144,7 +144,7 @@ {"text":"Construct roads between your capital and another city. Or, automate your worker and let him get to that eventually."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, @@ -170,7 +170,7 @@ {"text":"Select an air unit → Select another city within range → Move the unit to the other city."}, ], "uniques": [ - "Only available ", + "Only available ", "Unavailable " ] }, diff --git a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt index 0c46eb3c19..1ac16cf472 100644 --- a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt +++ b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt @@ -255,6 +255,7 @@ class RulesetValidator(val ruleset: Ruleset) { uniqueValidator.checkUniques(choice, lines, true, tryFixUnknownUniques) } + uniqueValidator.checkUniques(event, lines, true, tryFixUnknownUniques) } } diff --git a/docs/Modders/uniques.md b/docs/Modders/uniques.md index 19048612e3..45ad894c10 100644 --- a/docs/Modders/uniques.md +++ b/docs/Modders/uniques.md @@ -3382,6 +3382,11 @@ If your mod renames Coast or Lakes, do not use this with one of these as paramet Applicable to: MetaModifier +??? example "<for every adjacent [tileFilter]>" + Example: "<for every adjacent [Farm]>" + + Applicable to: MetaModifier + ??? example "<for every [amount] [countable]>" Example: "<for every [3] [1000]>"