From b7ec246c62932589e4ec8fc8023326800a41e472 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 00:53:55 -0500 Subject: [PATCH 01/11] explore possible infirm fix using age triggers --- common/scripted_triggers/20_health_triggers.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index d799992c0e..dce4ff8d86 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -29,27 +29,28 @@ age_ranked_health_vulnerability_threshold_trigger = { has_trait = infirm # Otherwise, we check health crossed against age. ## Characters that are this old are vulnerable regardless of health. - age >= 90 + # Warcraft - we need to check racial age in relation to humans because different races have longer lifespans + age_in_relation_to_humans_greater_than_trigger = { age = 90 } #wc - note that characters might get an extra year out of this! ## Else, the higher your health is, the older you need to be to suffer age-related health problems. AND = { health <= good_health - age >= 80 + age_in_relation_to_humans_greater_than_trigger = {age = 80} } AND = { health <= medium_health - age >= 70 + age_in_relation_to_humans_greater_than_trigger = {age = 70} } AND = { health <= fine_health - age >= 60 + age_in_relation_to_humans_greater_than_trigger = {age = 60} } AND = { health <= poor_health - age >= 50 + age_in_relation_to_humans_greater_than_trigger = {age = 50} } AND = { health <= dying_health - age >= 40 + age_in_relation_to_humans_greater_than_trigger = {age = 40} } } } From ff98b66a4ed4e184dbef535e966fc24f66eeb1f3 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 01:43:26 -0500 Subject: [PATCH 02/11] move check in from age comparison trigger --- .../scripted_triggers/20_health_triggers.txt | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index dce4ff8d86..221e726f06 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -28,29 +28,36 @@ age_ranked_health_vulnerability_threshold_trigger = { # If you're already having problems... has_trait = infirm # Otherwise, we check health crossed against age. + # Warcraft - we have to divide by the age multiplier + save_temporary_scope_value_as = { + name = temp_age + value = { + value = age + divide = racial_age_multiplier_value + } + } ## Characters that are this old are vulnerable regardless of health. - # Warcraft - we need to check racial age in relation to humans because different races have longer lifespans - age_in_relation_to_humans_greater_than_trigger = { age = 90 } #wc - note that characters might get an extra year out of this! + scope:temp_age >= 90 ## Else, the higher your health is, the older you need to be to suffer age-related health problems. AND = { health <= good_health - age_in_relation_to_humans_greater_than_trigger = {age = 80} + scope:temp_age >= 80 } AND = { health <= medium_health - age_in_relation_to_humans_greater_than_trigger = {age = 70} + scope:temp_age >= 70 } AND = { health <= fine_health - age_in_relation_to_humans_greater_than_trigger = {age = 60} + scope:temp_age >= 60 } AND = { health <= poor_health - age_in_relation_to_humans_greater_than_trigger = {age = 50} + scope:temp_age >= 50 } AND = { health <= dying_health - age_in_relation_to_humans_greater_than_trigger = {age = 40} + scope:temp_age >= 40 } } } From c2da011a13676ebfe8bbb502a830e6a0ba61b47a Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 01:45:29 -0500 Subject: [PATCH 03/11] clarify age multiplier comment --- common/scripted_triggers/20_health_triggers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index 221e726f06..8417016619 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -28,7 +28,7 @@ age_ranked_health_vulnerability_threshold_trigger = { # If you're already having problems... has_trait = infirm # Otherwise, we check health crossed against age. - # Warcraft - we have to divide by the age multiplier + # Warcraft - we have to divide by the age multiplier to get effective age for paradox purposes save_temporary_scope_value_as = { name = temp_age value = { From 984916870eb5a48df9abad13d3e8f50aab7b1abe Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 02:13:00 -0500 Subject: [PATCH 04/11] make exeption for cant get sick characters --- common/scripted_triggers/20_health_triggers.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index 8417016619..20011fe80f 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -24,6 +24,9 @@ can_get_non_epidemic_disease_trigger = { #Diseases shouldn't stack. Don't add a # Will this character suffer age-related health issues, factoring how healthy they actually are vs. what their age is? age_ranked_health_vulnerability_threshold_trigger = { + NOT = { + has_flag = can_not_get_sick + } OR = { # If you're already having problems... has_trait = infirm From e5f61a45018a28a5e62c3cf58b5a17cf42247e99 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 06:49:17 -0500 Subject: [PATCH 05/11] fix error causing infirm to never happen --- .../scripted_triggers/20_health_triggers.txt | 5 +++-- events/health_events.txt | 18 +++--------------- gui/window_character.gui | 2 +- 3 files changed, 7 insertions(+), 18 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index 20011fe80f..172e5e4ee0 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -24,8 +24,9 @@ can_get_non_epidemic_disease_trigger = { #Diseases shouldn't stack. Don't add a # Will this character suffer age-related health issues, factoring how healthy they actually are vs. what their age is? age_ranked_health_vulnerability_threshold_trigger = { + # Warcraft - add flags here that should prevent characters from getting "infirm" NOT = { - has_flag = can_not_get_sick + has_flag = can_not_get_sick } OR = { # If you're already having problems... @@ -35,7 +36,7 @@ age_ranked_health_vulnerability_threshold_trigger = { save_temporary_scope_value_as = { name = temp_age value = { - value = age + value = $AGE$ divide = racial_age_multiplier_value } } diff --git a/events/health_events.txt b/events/health_events.txt index c7f4ade907..73494eb50d 100644 --- a/events/health_events.txt +++ b/events/health_events.txt @@ -10767,21 +10767,9 @@ health.7000 = { theme = physical_health trigger = { - NOT = { has_trait = infirm } - OR = { - # Warcraft - age >= age_50_value - - AND = { - # Warcraft - age >= age_30_value - - OR = { - has_trait = physique_bad - has_trait = spindly - has_trait = weak - } - } + NOT = { + has_trait = infirm + age_ranked_health_vulnerability_threshold_trigger = no } } diff --git a/gui/window_character.gui b/gui/window_character.gui index 78f7c9e37c..1679fd3783 100644 --- a/gui/window_character.gui +++ b/gui/window_character.gui @@ -784,7 +784,7 @@ window = { name = "character_age_2" raw_text = "???" default_format = "#low" - tooltip = "wc_unknown_birth" + tooltip = " [Character.GetAge] [Character.GetDeathOrBirthDateInfo]" #"wc_unknown_birth" fontsize = 20 align = nobaseline } From 3b1eb83427972a78007574f69873f9f54fdffbb5 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 06:51:18 -0500 Subject: [PATCH 06/11] debug info cleanup --- gui/window_character.gui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/window_character.gui b/gui/window_character.gui index 1679fd3783..caa36666a2 100644 --- a/gui/window_character.gui +++ b/gui/window_character.gui @@ -784,7 +784,7 @@ window = { name = "character_age_2" raw_text = "???" default_format = "#low" - tooltip = " [Character.GetAge] [Character.GetDeathOrBirthDateInfo]" #"wc_unknown_birth" + tooltip = "wc_unknown_birth" #" [Character.GetAge] [Character.GetDeathOrBirthDateInfo]" fontsize = 20 align = nobaseline } From 008d7be5aa807c8844f9e234f5b5b020fd2425f9 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 07:13:47 -0500 Subject: [PATCH 07/11] more cleanup from debugging stuff --- gui/window_character.gui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/window_character.gui b/gui/window_character.gui index caa36666a2..2aff3b1dbb 100644 --- a/gui/window_character.gui +++ b/gui/window_character.gui @@ -784,7 +784,7 @@ window = { name = "character_age_2" raw_text = "???" default_format = "#low" - tooltip = "wc_unknown_birth" #" [Character.GetAge] [Character.GetDeathOrBirthDateInfo]" + tooltip = "wc_unknown_birth" #" [Character.GetAge] [Character.GetDeathOrBirthDateInfo]" fontsize = 20 align = nobaseline } From 70cc97063d658f8e660c8ac1600a0d04ea43430c Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 11:28:24 -0500 Subject: [PATCH 08/11] Update common/scripted_triggers/20_health_triggers.txt Co-authored-by: Mayonez_kun <84410981+sumankun@users.noreply.github.com> --- common/scripted_triggers/20_health_triggers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index 172e5e4ee0..fbc82ca8f7 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -26,7 +26,7 @@ can_get_non_epidemic_disease_trigger = { #Diseases shouldn't stack. Don't add a age_ranked_health_vulnerability_threshold_trigger = { # Warcraft - add flags here that should prevent characters from getting "infirm" NOT = { - has_flag = can_not_get_sick + has_trait_with_flag = can_not_get_sick } OR = { # If you're already having problems... From 7f1a680df5fdd030fabf3b1ccad123473c77567a Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 14:09:44 -0500 Subject: [PATCH 09/11] make suggested changes --- common/scripted_triggers/20_health_triggers.txt | 2 +- events/health_events.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index fbc82ca8f7..f35bfd6f83 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -36,7 +36,7 @@ age_ranked_health_vulnerability_threshold_trigger = { save_temporary_scope_value_as = { name = temp_age value = { - value = $AGE$ + value = age divide = racial_age_multiplier_value } } diff --git a/events/health_events.txt b/events/health_events.txt index 73494eb50d..8f60b74dd9 100644 --- a/events/health_events.txt +++ b/events/health_events.txt @@ -10768,9 +10768,9 @@ health.7000 = { trigger = { NOT = { - has_trait = infirm - age_ranked_health_vulnerability_threshold_trigger = no - } + has_trait = infirm + } + age_ranked_health_vulnerability_threshold_trigger = yes } weight_multiplier = { From b3b3b6328cacf1ccd2935265550ad72735204ff2 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Mon, 20 Nov 2023 17:09:19 -0500 Subject: [PATCH 10/11] use age_triggers to determine infirm vulnerability --- .../scripted_triggers/20_health_triggers.txt | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index f35bfd6f83..fe9c5992c7 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -33,35 +33,28 @@ age_ranked_health_vulnerability_threshold_trigger = { has_trait = infirm # Otherwise, we check health crossed against age. # Warcraft - we have to divide by the age multiplier to get effective age for paradox purposes - save_temporary_scope_value_as = { - name = temp_age - value = { - value = age - divide = racial_age_multiplier_value - } - } ## Characters that are this old are vulnerable regardless of health. - scope:temp_age >= 90 + age_in_relation_to_humans_more_than_trigger = { age = 90 } ## Else, the higher your health is, the older you need to be to suffer age-related health problems. AND = { health <= good_health - scope:temp_age >= 80 + age_in_relation_to_humans_more_than_trigger = { age = 80 } } AND = { health <= medium_health - scope:temp_age >= 70 + age_in_relation_to_humans_more_than_trigger = { age = 70 } } AND = { health <= fine_health - scope:temp_age >= 60 + age_in_relation_to_humans_more_than_trigger = { age = 60 } } AND = { health <= poor_health - scope:temp_age >= 50 + age_in_relation_to_humans_more_than_trigger = { age = 50 } } AND = { health <= dying_health - scope:temp_age >= 40 + age_in_relation_to_humans_more_than_trigger = { age = 40 } } } } From 305c34aab71e60926f6811bc2acaf9d93c55c768 Mon Sep 17 00:00:00 2001 From: Edmund <447ght@gmail.com> Date: Tue, 21 Nov 2023 16:29:24 -0500 Subject: [PATCH 11/11] revert back to scoped infirm age trigger --- .../scripted_triggers/20_health_triggers.txt | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/common/scripted_triggers/20_health_triggers.txt b/common/scripted_triggers/20_health_triggers.txt index fe9c5992c7..6c7d9ad060 100644 --- a/common/scripted_triggers/20_health_triggers.txt +++ b/common/scripted_triggers/20_health_triggers.txt @@ -33,28 +33,35 @@ age_ranked_health_vulnerability_threshold_trigger = { has_trait = infirm # Otherwise, we check health crossed against age. # Warcraft - we have to divide by the age multiplier to get effective age for paradox purposes + save_temporary_scope_value_as = { + name = temp_age + value = { + value = age + divide = racial_age_multiplier_value + } + } ## Characters that are this old are vulnerable regardless of health. - age_in_relation_to_humans_more_than_trigger = { age = 90 } + scope:temp_age >= 90 ## Else, the higher your health is, the older you need to be to suffer age-related health problems. AND = { health <= good_health - age_in_relation_to_humans_more_than_trigger = { age = 80 } + scope:temp_age >= 80 } AND = { health <= medium_health - age_in_relation_to_humans_more_than_trigger = { age = 70 } + scope:temp_age >= 70 } AND = { health <= fine_health - age_in_relation_to_humans_more_than_trigger = { age = 60 } + scope:temp_age >= 60 } AND = { health <= poor_health - age_in_relation_to_humans_more_than_trigger = { age = 50 } + scope:temp_age >= 50 } AND = { health <= dying_health - age_in_relation_to_humans_more_than_trigger = { age = 40 } + scope:temp_age >= 40 } } }