How can you check if a nomad character has too much lands, and the clans are demanding more? (and optionally, how much they're demanding) The wiki wasn't as helpful as I had hoped.
Maybe it used to be broken, but I've managed to get it to work just fine. It is used just like the add_spouse command.Does anyone knwo about the "add_betrothal" command or has used it in a mod`The wiki says it is broken ...![]()
Maybe it used to be broken, but I've managed to get it to work just fine. It is used just like the add_spouse command.
Just use the scope "betrothed"Thanks! Indeed, it works.
Another question: Do we have a scope for a promised one - not the actual spouse, but the coming Mr./Mrs. xxxx ?
if = {
limit = {
any_sibling = {
is_female = no
is_older_than = ROOT
}
}
random_sibling = {
#do stuff
}
break = yes
}
Speaking of scopes, how do I scope to a character's oldest living brother in an event? This is the closest I've come, but it will randomly pick among a character's older brothers:
Code:if = { limit = { any_sibling = { is_female = no is_older_than = ROOT } } random_sibling = { #do stuff } break = yes }
if = {
limit = {
any_sibling = {
is_female = no
is_older_than = ROOT
}
}
random_sibling = {
limit = {
is_female = no
is_older_than = ROOT
NOT = {
ROOT = {
any_sibling = {
is_female = no
is_older_than = PREVPREV
NOT = { character = PREVPREV } # Probably unnecessary, but just in case
is_alive = yes # Probably unnecessary, but just in case
}
}
}
}
#do stuff
}
break = yes
}
Try using The Validator program in the pinned thread named "List of Mods/Utilities". That should find invalid syntax that has changed since Horse Lords and give you a jumping off point. After that, make sure to look in your %userprofile%\Documents\Paradox Interactive\Crusader Kings II\logs folder and look at the logfiles there for error messages.
Thank you so much. I've been analyzing this masterpiece the past half-hour or so. The only thing that's throwing me is the NOT operator. What's wrong with my interpretation?Code:if = { limit = { any_sibling = { is_female = no is_older_than = ROOT } } random_sibling = { limit = { is_female = no is_older_than = ROOT NOT = { ROOT = { any_sibling = { is_female = no is_older_than = PREVPREV NOT = { character = PREVPREV } # Probably unnecessary, but just in case is_alive = yes # Probably unnecessary, but just in case } } } } #do stuff } break = yes }
This should work.
Thank you. The game will now start, but almost immediately crashes at "Initialising Maplogic" and does not seem to leave any error messages/logs. :/
if = {
limit = { # If the stuff inside this clause evaluates to true, then do the stuff below this clause
any_sibling = { # Look through all of ROOT's siblings (i.e., if any of ROOT's siblings fulfills all the conditions in this clause, return true for this clause)
is_female = no # Check if the sibling is not female (i.e. male)
is_older_than = ROOT # Check if the sibling is older than ROOT
} # So basically we're just checking to see if ROOT has an older brother.
} # I'm not sure if this is where you're confused, but what happens in the limit is entirely irrelevant for what happens below. All the game cares about is whether or not it evaluates to true.
random_sibling = { # Now we're going to take one random one of ROOT's siblings. Note that since you don't have a limit clause here, this will actually take any sibling - older or younger, male or female.
#do stuff
}
break = yes
}
I could have sworn it just read off the province_setup. I've looked into this and so far this seems like the correct response, thank you.province_setup is only used when loading saves IIRC. You need to look at the province history.
Another solution:Speaking of scopes, how do I scope to a character's oldest living brother in an event? This is the closest I've come, but it will randomly pick among a character's older brothers:
Code:if = { limit = { any_sibling = { is_female = no is_older_than = ROOT } } random_sibling = { #do stuff } break = yes }
save_event_target_as = oldest #Saves ROOT as the target
any_sibling = { #Scopes to all living siblings
limit = {
is_female = no
is_older_than = event_target:oldest
}
save_event_target_as = oldest
}
event_target:oldest = {
if = {
limit = {
NOT = { character = ROOT }
}
<do stuff>
}
}
clear_event_target = oldest
That seems like it would work well, and the code makes more sense to me. I tested it out, though, and the code I inserted into <do stuff> wasn't being executed. I read on the Event Modding page on the CK II wiki that using event targets inside an Immediate block (which this conditional is in) can cause unexpected effects. Could that be issue?Another solution:
Code:save_event_target_as = oldest #Saves ROOT as the target any_sibling = { #Scopes to all living siblings limit = { is_female = no is_older_than = event_target:oldest } save_event_target_as = oldest } event_target:oldest = { if = { limit = { NOT = { character = ROOT } } <do stuff> } } clear_event_target = oldest
Not sure, never had any problems with it. Just tested that code in both decisions and events, and it seems to work fine.Event Modding page on the CK II wiki that using event targets inside an Immediate block (which this conditional is in) can cause unexpected effects. Could that be issue?
Code:if = { limit = { any_sibling = { is_female = no is_older_than = ROOT } } random_sibling = { limit = { is_female = no is_older_than = ROOT NOT = { ROOT = { any_sibling = { is_female = no is_older_than = PREVPREV NOT = { character = PREVPREV } # Probably unnecessary, but just in case is_alive = yes # Probably unnecessary, but just in case } } } } #do stuff } break = yes }
This should work.
Hm, why do you have two limit-loops in this event? ("any_sibling" and then "random_sibling"?
if = {
limit = { # This limit clause is used to determine if the clauses under it are executed. It is the condition of the if clause.
any_sibling = {
is_female = no
is_older_than = ROOT
}
}
random_sibling = { # This limit clause has absolutely nothing to do with the first clause, except that the game will only ever get here if the first limit clause evaluates to true.
limit = { # What happens here is that the game will go through each of ROOT's siblings and check these conditions for each one of them. Then, out of all ROOT's siblings for which all of the below is true (we have structured this so that there should only be one choice), the game will execute the commands below.
is_female = no
is_older_than = ROOT
NOT = {
ROOT = {
any_sibling = {
is_female = no
is_older_than = PREVPREV
NOT = { character = PREVPREV } # Probably unnecessary, but just in case
is_alive = yes # Probably unnecessary, but just in case
}
}
}
}
#do stuff
}
break = yes
}