I've been trying to update the on_battle_won event to increase a character's martial skill but it seems to fail miserably. After changing on_actions.txt to be:
on_battle_won =
{
100 = 500 #very low chance to get victorious
}
and then changing after_battle.txt to be: (All right, I know it should be in a mod, but this should still work)
character_event = {
id = 500
is_triggered_only = yes
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99 # change to 20 after debugging
military = 1
}
}
}
I can win a battle with any general but there is never a change to his martial skill. So then I added a trait 'general' for a +1 martial and good_general to be +2 and changed after_battle,txt to be:
character_event = {
id = 500
is_triggered_only = yes
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
THIS = {
character_event = 44250
character_event = 44254
}
}
}
character_event = {
id = 44250
is_triggered_only = yes
trigger = {
traits = general
}
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99
remove_trait = general
add_trait = good_general
}
}
}
character_event = {
id = 44254
is_triggered_only = yes
trigger = {
not = {
traits = general
traits = good_general
}
}
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99
add_trait = general
}
}
}
Now I find that winning a battle gives both traits, which is clearly wrong as good_general is only possible by removing general and general is only possible if neither general nor good_general apply. I then tinkered some more and found out that triggers and limits are ignored, at least for the new traits, even though they appear perfectly correctly when you look at the character in the game. Does anyone have any ideas?
on_battle_won =
{
100 = 500 #very low chance to get victorious
}
and then changing after_battle.txt to be: (All right, I know it should be in a mod, but this should still work)
character_event = {
id = 500
is_triggered_only = yes
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99 # change to 20 after debugging
military = 1
}
}
}
I can win a battle with any general but there is never a change to his martial skill. So then I added a trait 'general' for a +1 martial and good_general to be +2 and changed after_battle,txt to be:
character_event = {
id = 500
is_triggered_only = yes
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
THIS = {
character_event = 44250
character_event = 44254
}
}
}
character_event = {
id = 44250
is_triggered_only = yes
trigger = {
traits = general
}
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99
remove_trait = general
add_trait = good_general
}
}
}
character_event = {
id = 44254
is_triggered_only = yes
trigger = {
not = {
traits = general
traits = good_general
}
}
title = "EVTNAME500"
desc = "EVTDESC500"
option = {
name = "EVTOPTA500"
random = {
chance = 99
add_trait = general
}
}
}
Now I find that winning a battle gives both traits, which is clearly wrong as good_general is only possible by removing general and general is only possible if neither general nor good_general apply. I then tinkered some more and found out that triggers and limits are ignored, at least for the new traits, even though they appear perfectly correctly when you look at the character in the game. Does anyone have any ideas?
Last edited: