Are councillor-tasks hardcoded?
I am writing on a battle-themed event chain and would like to have some sort of intelligence network using the spymasters 'build spynetwork' task.
I stumbeled apon another major problem I am unable to solve:
I am trying to create some event-chains based on the 'wargame' in the war focus, but there are quite a few problems.
Whenever two armies meet at the battlefield their leaders should get a random event-chain based on their martial skill. Some are just minor buffs for a few days, while others are major decisions that can turn a guranteed victory to a disaster like the romans expierienced vs hannibal in cannae.
I previously used the scopes "in_command" or "in_battle" in my trigger conditions, but this would be true to ALL flank leaders and probably even the unit-leaders, but I only wanted to target the highest in command (either top liege, the highest lord in this army or the center flank leader in case everyone is at the same tier).
Next problem is: how can find the highest tier enemy commander? I tried this until now:
Code:
any_current_enemy = {
any_realm_character = {
limit = {
at_location = ROOT
in_command = yes
in_battle = yes
prisoner = no
}
}
}
but one problem is, that this event will trigger for all commanders for all armies on that location again (although i don't know if all armies on a location merge to one when attacked) rather than just to the one with the highest tier.
I had some Ideas, but they ended up in quite a non-functional mess where i checked dozens of cases for every single character on a location.
The next step in my plan would be - although i have not even an idea if this is accomplishable - to check for arriving armies, to give special opportunities for the reinforcement (like to hit the enemy in the rear unprepared)