Does anyone know whether the "Elector Titles Held" modifier is at all accessible to modify outside the MAX_ELECTOR_TITLES_LEGALLY_HELD define? In particular, I'm interested in being able to modify the magnitude.
I looked at this a few different ways and couldn't see anything. I suspect it's hardcoded. That's not any kind of certainty, but I guess at least you know someone else looked at it :-/Does anyone know whether the "Elector Titles Held" modifier is at all accessible to modify outside the MAX_ELECTOR_TITLES_LEGALLY_HELD define? In particular, I'm interested in being able to modify the magnitude.
effect = {
abdicate_to = liege
move_character = liege
any_courtier = liege
}
How do I have the game scope to the liege of a liege of the current character (any_courtier)?
For instance I want to create a targeted decision to where a landed character abdicates to their liege, that character and all of their courtiers move to the liege's court.
The code I have currently is
Code:effect = { abdicate_to = liege move_character = liege any_courtier = liege }
So what this does in game currently is
Current character gives all titles to their liege
Current character move to lieges court
Current character's courtiers move to current character's court that they are already in (which causes them to scatter all over the place because the court is destroyed)
What I want it to do is
Current character gives all titles to their liege.
Current character move to lieges court
Current character's courtiers move to current character's liege's court
abdicate_to
and move_character
are commands, whereas any_courtier
is a scope, i.e. something that can be told to do something with a command or checked against various conditions. So your first problem is that liege
is not a command either, and you are trying to tell a scope that it is another scope, something that is incorrect in this case and impossible for the code in that manner.any_courtier = { move_character = liege }
any_courtier
part up to before the abdicate_to
command.effect = {
liege = {
ROOT = {
any_courtier = { move_character = PREVPREV }
abdicate_to = PREV
move_character = PREV
}
}
}
any_courtier
from ROOT targets courtiers of ROOT. PREV is used to step back in the scope chain. In this case, PREVPREV is stepping two scopes back. The current scope is any_courtier
, so stepping one scope back from that is ROOT, and stepping two scopes back from that is liege
. Therefore, in this case, PREVPREV points to ROOT's liege and moves all his courtiers there. By moving his courtiers there before he abdicates, you don't get the random scattering. If you have his courtiers move after abdicating, he technically doesn't have any courtiers any more, though that may be an effect that takes an in-game day to fully realize, hence it "moves" them to his just-destroyed court, before scattering as you indicated.on_new_holder
event which allows characters to resize their dynamically-created merc companies immediately after creation - ie. without altering anything in the vanilla code.on_new_holder
means I want to be as exclusive as possible in my event triggers.on_new_holder
because I couldn't find any other on_action which works. Notably, on_create_title
doesn't work, probably because dynamic merc titles are created by the band_creator
's primary_title
and there's no such thing as a title_event
.How do you write a condition that returns true if a title has been newly created (and false if not)? I'm pretty sure there's a way to test for this, but I've run out of ideas...
Background:
- I'm writing an
on_new_holder
event which allows characters to resize their dynamically-created merc companies immediately after creation - ie. without altering anything in the vanilla code.- The reason is because my dynamic companies have size 10k and therefore have hiring cost >1k, which means no AI ever hires them, so it would be nice to be able to downgrade them to size 1k / hiring cost 100 (or whatever, I'll give options).
- The fact I'm having to use the very-generic
on_new_holder
means I want to be as exclusive as possible in my event triggers.
- I "have" to use
on_new_holder
because I couldn't find any other on_action which works. Notably,on_create_title
doesn't work, probably because dynamic merc titles are created by theband_creator
'sprimary_title
and there's no such thing as atitle_event
.- I've tried a LOT of different things, but I didn't document them thoroughly as I went along, so I don't want to write them up here. Suffice it to say that, whenever I try to access the previous title holder (which should be null), it seems like the null scope is always treated in the least-convenient way for my purpose.
How do you write a condition that returns true if a title has been newly created (and false if not)? I'm pretty sure there's a way to test for this, but I've run out of ideas...
Background:
- I'm writing an
on_new_holder
event which allows characters to resize their dynamically-created merc companies immediately after creation - ie. without altering anything in the vanilla code.- The reason is because my dynamic companies have size 10k and therefore have hiring cost >1k, which means no AI ever hires them, so it would be nice to be able to downgrade them to size 1k / hiring cost 100 (or whatever, I'll give options).
- The fact I'm having to use the very-generic
on_new_holder
means I want to be as exclusive as possible in my event triggers.
- I "have" to use
on_new_holder
because I couldn't find any other on_action which works. Notably,on_create_title
doesn't work, probably because dynamic merc titles are created by theband_creator
'sprimary_title
and there's no such thing as atitle_event
.- I've tried a LOT of different things, but I didn't document them thoroughly as I went along, so I don't want to write them up here. Suffice it to say that, whenever I try to access the previous title holder (which should be null), it seems like the null scope is always treated in the least-convenient way for my purpose.
<title> = { any_previous_holder = { always = no } } probably works, assuming the current holder isn't included in that scope because of some interesting design approach. The title probably can use e.g. a primary_title scope rather than a specific tag.
NOT = { any_previous_holder = { always = yes } }
should work in an event fired by on_new_holder, perhaps on_create_title too. Vanilla uses this in k_jerusalem, for the first time someone creates it and gains that ridiculous 5000 prestige.I tried a few variations on this, and it didn't work. Specifically:<title> = { any_previous_holder = { always = no } } probably works, assuming the current holder isn't included in that scope because of some interesting design approach. The title probably can use e.g. a primary_title scope rather than a specific tag.
trigger = {
...
# There is no previous title holder
# The following do not work:
#FROM = { any_previous_holder = { always = no } }
#primary_title = { any_previous_holder = { always = no } }
#FROMFROM = { always = no }
trigger = {
...
# There is no previous title holder
# Current test code:
NOT = { FROMFROM = { always = yes } } # For on_new_holder, FROMFROM is defined to be the previous holder
Code:trigger = { ... # There is no previous title holder # Current test code: NOT = { FROMFROM = { always = yes } } # For on_new_holder, FROMFROM is defined to be the previous holder
This seems theoretically sound to me - does it also look correct to you?
I tried your exact suggestion, and you might be interested to know thatYes, this is how you detect the absence of a certain scope.
FROM = { NOT = { any_previous_holder = { always = yes } } }
does not work! (And neither does primary_title = { NOT = { any_previous_holder = { always = yes } } }
.)any_previous_holder
scope has someone in it, even though it really shouldn't.# Called from on_new_holder
# ROOT is the character, FROM is the title, FROMFROM is the old holder
character_event = {
id = EXPDTargetedVanillaMerc.100
hide_window = yes
is_triggered_only = yes
trigger = {
#######################################################################################
# #
# WARNING: THIS LOGIC IS EXTREMELY DELICATE #
# A lot of conditions that seem like they should work... actually don't. #
# Be sure to test any alterations thoroughly, to ensure they are working as intended. #
# #
#######################################################################################
# We only want to continue for newly-created dynamic bloodline/nomad merc companies
# Title is landless merc adventurer with no income siphon
# --- Feudal merc companies have a siphon and should not be adventurer titles
# --- Base game merc companies should not be adventurer titles and should not have a band_creator (see below)
FROM = {
is_landless_type_title = yes
mercenary = yes
adventurer = yes
mercenary_siphon_factor == 0
}
# There is no previous title holder
NOT = { FROMFROM = { always = yes } }
# NB: The following seemingly-correct conditions do not work:
#FROM = { any_previous_holder = { always = no } }
#primary_title = { any_previous_holder = { always = no } }
#FROMFROM = { always = no }
#FROM = { NOT = { any_previous_holder = { always = yes } } }
#primary_title = { NOT = { any_previous_holder = { always = yes } } }
# NB: We can't check for the merc captain having "started merc company" char modifier, because this is added after the title is created, ie. after this event is triggered.
# Band creator can in theory create bloodline/nomad merc companies
# (IE: Copy the from_potential block of the targeted decision to "Send away as mercenary")
# NB: We can't shortcut this with is_targeted_decision_potential, because there's no way to guarantee that there's another potential target for the decision.
FROM = {
band_creator = {
is_playable = yes
OR = {
has_dlc = "Horse Lords"
any_owned_bloodline = {
has_bloodline_flag = bloodline_mercenary_traditions
}
}
is_adult = yes
prisoner = no
NOT = { trait = incapable }
OR = {
government = nomadic_government
has_character_modifier = mercenary_traditions
any_owned_bloodline = {
has_bloodline_flag = bloodline_mercenary_traditions
}
}
}
}
}
immediate = {
FROM = {
band_creator = {
character_event = { id = EXPDTargetedVanillaMerc.200 }
}
}
}
}
I tried your exact suggestion, and you might be interested to know thatFROM = { NOT = { any_previous_holder = { always = yes } } }
does not work! (And neither doesprimary_title = { NOT = { any_previous_holder = { always = yes } } }
.)
I think this might be a case where theany_previous_holder
scope has someone in it, even though it really shouldn't.
I guess I'm very very lucky that the devs decided to leave FROMFROM empty as expected...
Full working event code, for posterity:
Code:# Called from on_new_holder # ROOT is the character, FROM is the title, FROMFROM is the old holder character_event = { id = EXPDTargetedVanillaMerc.100 hide_window = yes is_triggered_only = yes trigger = { ####################################################################################### # # # WARNING: THIS LOGIC IS EXTREMELY DELICATE # # A lot of conditions that seem like they should work... actually don't. # # Be sure to test any alterations thoroughly, to ensure they are working as intended. # # # ####################################################################################### # We only want to continue for newly-created dynamic bloodline/nomad merc companies # Title is landless merc adventurer with no income siphon # --- Feudal merc companies have a siphon and should not be adventurer titles # --- Base game merc companies should not be adventurer titles and should not have a band_creator (see below) FROM = { is_landless_type_title = yes mercenary = yes adventurer = yes mercenary_siphon_factor == 0 } # There is no previous title holder NOT = { FROMFROM = { always = yes } } # NB: The following seemingly-correct conditions do not work: #FROM = { any_previous_holder = { always = no } } #primary_title = { any_previous_holder = { always = no } } #FROMFROM = { always = no } #FROM = { NOT = { any_previous_holder = { always = yes } } } #primary_title = { NOT = { any_previous_holder = { always = yes } } } # NB: We can't check for the merc captain having "started merc company" char modifier, because this is added after the title is created, ie. after this event is triggered. # Band creator can in theory create bloodline/nomad merc companies # (IE: Copy the from_potential block of the targeted decision to "Send away as mercenary") # NB: We can't shortcut this with is_targeted_decision_potential, because there's no way to guarantee that there's another potential target for the decision. FROM = { band_creator = { is_playable = yes OR = { has_dlc = "Horse Lords" any_owned_bloodline = { has_bloodline_flag = bloodline_mercenary_traditions } } is_adult = yes prisoner = no NOT = { trait = incapable } OR = { government = nomadic_government has_character_modifier = mercenary_traditions any_owned_bloodline = { has_bloodline_flag = bloodline_mercenary_traditions } } } } } immediate = { FROM = { band_creator = { character_event = { id = EXPDTargetedVanillaMerc.200 } } } } }
any_previous_holder
already accesses the title creator, which makes it slightly unintuitive.I triedI think that meansany_previous_holder
already accesses the title creator, which makes it slightly unintuitive.
primary_title = { NOT = { any_previous_holder = { NOT = { character = ROOT } } } }
, and it works!any_previous_holder
includes the current holder - in this context, anyway. I think that's worth a tentative wiki update.In a third party decision, how do you get ROOT to show up at the top of the third-party picker? (So you can see their stats and traits while you are picking the third party.)
(This is present for many vanilla hardcoded decisions - eg. marriage - but I can't think of any vanilla scripted decisions where this is possible, so I have nothing to copy from.)
third_party_score
. Does ROOT even show up in the list at all?The scope of the list is set by theIt would have to be done by scoring ROOT higher inthird_party_score
. Does ROOT even show up in the list at all?
third_party_potential
block, so you can include anyone you like. Normally, the whole purpose of a third party decision is to pick two different characters to interact with each other, so you would normally want to exclude ROOT from the list to avoid confusion (ROOT interacting with themselves?!). However, you could probably twist the logic to include ROOT in the list.The scope of the list is set by thethird_party_potential
block, so you can include anyone you like. Normally, the whole purpose of a third party decision is to pick two different characters to interact with each other, so you would normally want to exclude ROOT from the list to avoid confusion (ROOT interacting with themselves?!). However, you could probably twist the logic to include ROOT in the list.
So, my question is now: Is there a way to change the behaviour of the third-party picker so that it always shows someone who is not in the list? (In this case, I want to show ROOT.)
And, separately: Is it possible to preselect a third-party character, so the player doesn't even have to open the list? (Eg: In the screenshots, it would be nice to always preselect the husband, since that's who I want 99% of the time.) (NB: I tested it and it's not as simple as setting one third party to have a unique highest score.)
That looks heavily modded, so it's possible that there's a mod conflict. To check this: disable all mods except the one mod you're checking, start a new game, and see if the problem is still present.As you can see on my images there is no character in provinces just empty green land, even some that are taken by one faction still have no character in some provinces.
Is there way to fix this? or like a tutorial to personally mod and add more counties or characters?
thank you for your time!
any_trade_route_province
is listed as being from a province scope. This confused me (how do you scope to a province on a trade route from another province), so I checked for vanilla instances of it. It's used once in events, in jd_chinese_diplomacy_events.txt, where it's used from a Character scope.Unfortunately, the only base game usage (JD.40000, the event you found) is actually commented-out in on_actions, so it will never fire, so it was probably never fully tested. It's dead code.On the Scopes wiki page,any_trade_route_province
is listed as being from a province scope. This confused me (how do you scope to a province on a trade route from another province), so I checked for vanilla instances of it. It's used once in events, in jd_chinese_diplomacy_events.txt, where it's used from a Character scope.
Is this an error on the wiki maybe, or have I misunderstood something?
Assuming that it does work from Character scope, as in that events file, does it find only trade route provinces in one's demesne, or everywhere in your realm?
any_trade_route_province
finds every province in the world that is in a trade routeany_trade_route_province
from any scopenamespace = ATRPTest
character_event = {
id = ATRPTest.1
is_triggered_only = yes
hide_window = yes
immediate = {
any_trade_route_province = {
province_event = { id = ATRPTest.2 }
}
}
}
province_event = {
id = ATRPTest.2
is_triggered_only = yes
hide_window = yes
immediate = {
# Discard 90% of the returned provinces, to avoid swamping the player
random_list = {
10 = { any_player = { character_event = { ATRPTest.3 } } }
90 = { #Nothing }
}
}
}
character_event = {
id = ATRPTest.3
is_triggered_only = yes
desc = "[From.GetName]" # May need to put this in a real localisation file
picture = GFX_evt_battle
option = { name = OK }
}