From 95ff98d5a8fefd89edddea9750ddc5bfe2ed8118 Mon Sep 17 00:00:00 2001 From: Pelmen323 Date: Mon, 2 Dec 2024 17:01:46 +0400 Subject: [PATCH 1/7] Update xp effects to support constants --- Config/effects.cwt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Config/effects.cwt b/Config/effects.cwt index d81ad158..ddbee2c0 100644 --- a/Config/effects.cwt +++ b/Config/effects.cwt @@ -1490,14 +1490,26 @@ alias[effect:remove_core_of] = enum[country_tags] ## scope = country alias[effect:army_experience] = variable_field +### Add army experience for country. +## scope = country +alias[effect:army_experience] = value[variable] + ### Add naval experience for country. ## scope = country alias[effect:navy_experience] = variable_field +### Add air experience for country. +## scope = country +alias[effect:navy_experience] = value[variable] + ### Add air experience for country. ## scope = country alias[effect:air_experience] = variable_field +### Add air experience for country. +## scope = country +alias[effect:air_experience] = value[variable] + ### Save an event target. ## scope = any alias[effect:save_event_target_as] = value_set[event_target] From da97e33489215992eeb694d25e3f78e61c12b9dc Mon Sep 17 00:00:00 2001 From: Pelmen323 Date: Mon, 2 Dec 2024 17:02:40 +0400 Subject: [PATCH 2/7] Update custom_override_tooltip to support character_name | tech_effect --- Config/effects_gtd.cwt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Config/effects_gtd.cwt b/Config/effects_gtd.cwt index 1cc973cc..960bd325 100644 --- a/Config/effects_gtd.cwt +++ b/Config/effects_gtd.cwt @@ -434,6 +434,8 @@ alias[effect:add_project_progress_ratio] = value[variable] alias[effect:custom_override_tooltip] = { tooltip = localisation tooltip = single_alias_right[bindable_loc] + tooltip = character_name| + tooltip = tech_effect| ## cardinality = 1..inf alias_name[effect] = alias_match_left[effect] } From 7ec61bbd46356e17101f5d2a21549f5884051bab Mon Sep 17 00:00:00 2001 From: BiscuitCookies <25040791+BiscuitCookies@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:11:08 +0100 Subject: [PATCH 3/7] new strategy and new on_action in 1.15.2 --- Config/common/ai_strategy.cwt | 1 + Config/on_actions.cwt | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/Config/common/ai_strategy.cwt b/Config/common/ai_strategy.cwt index e9c31598..5e7c1f23 100644 --- a/Config/common/ai_strategy.cwt +++ b/Config/common/ai_strategy.cwt @@ -509,6 +509,7 @@ enums = { equipment_market_spend_factories force_concentration_factor raid_target_country + become_spymaster } enum[pp_strats] = { pp_spend_amount diff --git a/Config/on_actions.cwt b/Config/on_actions.cwt index 504fed3c..591bc557 100644 --- a/Config/on_actions.cwt +++ b/Config/on_actions.cwt @@ -528,12 +528,20 @@ types = { path = "game/common/on_actions" skip_root_key = on_actions } + + # GTD ## type_key_filter = on_project_completion type[on_project_completion] = { path = "game/common/on_actions" skip_root_key = on_actions } + + ## type_key_filter = on_before_peace_conference_start + type[on_before_peace_conference_start] = { + path = "game/common/on_actions" + skip_root_key = on_actions + } } @@ -1119,11 +1127,17 @@ on_action = { ## replace_scope = { ROOT = military_industrial_organization this = military_industrial_organization FROM = COUNTRY } on_mio_industrial_manufacturer_unassigned = single_alias_right[on_action_effect] + # GTD -------------------- + ### Triggered when a project is completed ### ROOT is the owner of the special project, FROM is the special project ## cardinality = 0..inf ## replace_scope = { ROOT = COUNTRY this = COUNTRY FROM = special_project } on_project_completion = single_alias_right[on_action_effect] + + ### ROOT is winner, FROM is loser (called for all winners against all losers) + ## replace_scope = { ROOT = COUNTRY this = COUNTRY FROM = COUNTRY } + on_before_peace_conference_start = single_alias_right[on_action_effect] } single_alias[country_event_effect] = { From de3d95e184d03a27fa21226bbec4234deb8aad27 Mon Sep 17 00:00:00 2001 From: BiscuitCookies <25040791+BiscuitCookies@users.noreply.github.com> Date: Sat, 7 Dec 2024 10:52:11 +0100 Subject: [PATCH 4/7] added scope checks for the other scopes a dynamic modifier can be in --- Config/effects.cwt | 24 ++++++++++++++++++++++++ Config/triggers.cwt | 15 +++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/Config/effects.cwt b/Config/effects.cwt index ddbee2c0..56ede3ad 100644 --- a/Config/effects.cwt +++ b/Config/effects.cwt @@ -3588,6 +3588,18 @@ alias[effect:remove_dynamic_modifier] = { ## cardinality = 0..1 ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. scope = scope[state] + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[character] + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[special_project] } ### Adds a dynamic modifier to country/state/unit leader. @@ -3611,6 +3623,18 @@ alias[effect:add_dynamic_modifier] = { ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. scope = scope[state] + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[character] + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[special_project] + ## cardinality = 0..1 ### Optional, makes the dynamic modifier acted as a timed modifier days = int_variable_field diff --git a/Config/triggers.cwt b/Config/triggers.cwt index 78043f60..f75eda11 100644 --- a/Config/triggers.cwt +++ b/Config/triggers.cwt @@ -2199,6 +2199,21 @@ alias[trigger:has_dynamic_modifier] = { ## cardinality = 0..1 ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. scope = scope[country] + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[state] + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = + + ## cardinality = 0..1 + ### Optional, state or country tag or a variable contains that. if specified the dynamic variable will target that scope. + scope = scope[special_project] } ### Runs a loop on for each element of an array, finds the lowest value and stores result in temp variables. From fddd0f78fe8fa88a1b0a6f63e2cbcfd722658ac9 Mon Sep 17 00:00:00 2001 From: Pelmen323 Date: Sun, 8 Dec 2024 01:55:59 +0400 Subject: [PATCH 5/7] Add missing cardingality for on_before_peace_conference_start --- Config/on_actions.cwt | 1 + 1 file changed, 1 insertion(+) diff --git a/Config/on_actions.cwt b/Config/on_actions.cwt index 591bc557..424ca1bb 100644 --- a/Config/on_actions.cwt +++ b/Config/on_actions.cwt @@ -1136,6 +1136,7 @@ on_action = { on_project_completion = single_alias_right[on_action_effect] ### ROOT is winner, FROM is loser (called for all winners against all losers) + ## cardinality = 0..inf ## replace_scope = { ROOT = COUNTRY this = COUNTRY FROM = COUNTRY } on_before_peace_conference_start = single_alias_right[on_action_effect] } From a9858a16dd3f6f3d9b0044adbfddeb917eff9557 Mon Sep 17 00:00:00 2001 From: Pelmen323 Date: Sun, 8 Dec 2024 02:00:49 +0400 Subject: [PATCH 6/7] Apparently medals can have visible trigger --- Config/common/unit_medals.cwt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Config/common/unit_medals.cwt b/Config/common/unit_medals.cwt index 889990fe..192d5c92 100644 --- a/Config/common/unit_medals.cwt +++ b/Config/common/unit_medals.cwt @@ -13,6 +13,11 @@ unit_medal = { ## cardinality = ~1..inf alias_name[trigger] = alias_match_left[trigger] } + ## cardinality = 0..1 + visible = { + ## cardinality = ~1..inf + alias_name[trigger] = alias_match_left[trigger] + } frame = int icon = From d930ead329ea8056c708ebf4e932956a190644b5 Mon Sep 17 00:00:00 2001 From: Pelmen323 Date: Sun, 8 Dec 2024 02:04:50 +0400 Subject: [PATCH 7/7] Add basic validation to division_template variable - still no validation for create_unit effect --- Config/effects.cwt | 14 +++++++------- Config/effects_bba.cwt | 2 +- Config/effects_gtd.cwt | 2 +- Config/effects_new.cwt | 4 ++-- Config/effects_nsb.cwt | 5 ++++- Config/history/oobs.cwt | 4 ++-- Config/triggers.cwt | 2 +- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Config/effects.cwt b/Config/effects.cwt index 56ede3ad..65f02f01 100644 --- a/Config/effects.cwt +++ b/Config/effects.cwt @@ -637,7 +637,7 @@ alias[effect:randomize_weather] = int ### Adds a division template to country. ## scope = country alias[effect:division_template] = { - name = localisation_inline + name = value_set[division_template_name] ## cardinality = 0..1 division_names_group = ## cardinality = 0..1 @@ -682,7 +682,7 @@ alias[effect:division_template] = { ### Adds units to a division template. ## scope = country alias[effect:add_units_to_division_template] = { - template_name = localisation_inline + template_name = value[division_template_name] ## cardinality = 0..1 regiments = { ## cardinality = 1..25 @@ -2997,27 +2997,27 @@ alias[effect:cancel_border_war] = { ### Set lock status for a division template. ## scope = country alias[effect:set_division_template_lock] = { - division_template = localisation_inline + division_template = value[division_template_name] is_locked = bool } ### Set cap for a division template. ## scope = country alias[effect:set_division_template_cap] = { - division_template = localisation_inline + division_template = value[division_template_name] division_cap = int_variable_field } ### Remove cap for a division template. ## scope = country alias[effect:clear_division_template_cap] = { - division_template = localisation_inline + division_template = value[division_template_name] } ### Set division template to allow force recruiting. force_allow_recruiting defaults to true if unset ## scope = country alias[effect:set_division_force_allow_recruiting] = { - division_template = localisation_inline + division_template = value[division_template_name] ## cardinality = 0..1 force_allow_recruiting = bool } @@ -3025,7 +3025,7 @@ alias[effect:set_division_force_allow_recruiting] = { ### Delete a template and its units. ## scope = country alias[effect:delete_unit_template_and_units] = { - division_template = localisation_inline + division_template = value[division_template_name] ## cardinality = 0..1 disband = bool } diff --git a/Config/effects_bba.cwt b/Config/effects_bba.cwt index 20d9dff1..cf8f3f04 100644 --- a/Config/effects_bba.cwt +++ b/Config/effects_bba.cwt @@ -151,7 +151,7 @@ alias[effect:random_state_division] = { ### Change divisions in scope to selected template ## scope = unit alias[effect:change_division_template] = { - division_template = localisation_inline + division_template = value[division_template_name] } ### Set unit org to a specific value diff --git a/Config/effects_gtd.cwt b/Config/effects_gtd.cwt index 960bd325..afcdc902 100644 --- a/Config/effects_gtd.cwt +++ b/Config/effects_gtd.cwt @@ -46,7 +46,7 @@ alias[effect:every_scientist] = { alias[effect:create_colonial_division_template] = { subject = scope[country] # Country tag division_template = { - name = scalar + name = value_set[division_template_name] ## cardinality = 0..1 division_names_group = ## cardinality = 0..1 diff --git a/Config/effects_new.cwt b/Config/effects_new.cwt index 01520e69..271bf67b 100644 --- a/Config/effects_new.cwt +++ b/Config/effects_new.cwt @@ -14,7 +14,7 @@ alias[effect:delete_unit] = { ## cardinality = 0..1 template = scalar ## cardinality = 0..1 - division_template = scalar + division_template = value[division_template_name] ## cardinality = 0..1 id = variable_field ## cardinality = 0..1 @@ -548,7 +548,7 @@ alias[effect:add_decryption] = { ###Deletes units that uses a specific template. ## scope = { COUNTRY } alias[effect:delete_units] = { - division_template = scalar + division_template = value[division_template_name] ## cardinality = 0..1 disband = bool } diff --git a/Config/effects_nsb.cwt b/Config/effects_nsb.cwt index bd07bccb..5b0ced6a 100644 --- a/Config/effects_nsb.cwt +++ b/Config/effects_nsb.cwt @@ -780,7 +780,10 @@ alias[effect:damage_units] = { ratio = bool ### you can limit army templates ## cardinality = 0..1 - template = localisation_inline + template = value[division_template_name] + ### you can limit army templates + ## cardinality = 0..1 + division_template = value[division_template_name] ### Damage armies ## cardinality = 0..1 army = bool diff --git a/Config/history/oobs.cwt b/Config/history/oobs.cwt index a7ad7b8f..9279d63c 100644 --- a/Config/history/oobs.cwt +++ b/Config/history/oobs.cwt @@ -18,7 +18,7 @@ oob = { ## cardinality = 0..inf division_template = { - name = scalar + name = value_set[division_template_name] ## cardinality = 0..1 division_names_group = ## cardinality = 0..1 @@ -76,7 +76,7 @@ oob = { name_order = int } location = enum[provinces] - division_template = scalar + division_template = value[division_template_name] ### Defines a unique name for this unit's division commander ## cardinality = 0..1 unique = { diff --git a/Config/triggers.cwt b/Config/triggers.cwt index f75eda11..afb36df0 100644 --- a/Config/triggers.cwt +++ b/Config/triggers.cwt @@ -1260,7 +1260,7 @@ alias[trigger:num_tech_sharing_groups] = int ### Check if country has a division template of specific name. ## scope = country -alias[trigger:has_template] = scalar +alias[trigger:has_template] = value[division_template_name] ### Check if state has a specific state category. ## scope = state