• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Another one - ai_will_do doesn't seem to be doing anything in cb_types (giving a factor of 0 if distance exceeds a certain value does not preclude a crusade, but putting the distance restriction in can_use does), despite being added to some of the new vanilla CBs, and crusade weights don't seem to have much of an effect, if any, at least in the fragmented world of Lux Invicta.

I finally got around to looking into this one. It doesn't have anything to do with the AI not looking at ai_will_do or the distance trigger not working. The problem is bad coding and using scopes for things they weren't made for. Any CB that is in title scope and has an attacker in the Root scope and a defender in the From scope will have this problem if you step into the Root scope, like this:

Code:
  ai_will_do = {
     factor = 1
     modifier = {
       factor = 0
       ROOT = {
         distance = {
           who = FROM
           value = 1000
         }
       }
     }

The ROOT scope here isn't the real ROOT scope (which instead is the title) and thus have no FROM scope, so when you use FROM here it will instead point to itself, and the character will check the distance against itself...

Unfortunately this is a pretty big bug and I can't do such a big change on my own. Will have to wait for the CK2 lead to return from vacation to discuss this. To "fix" the problem wight now you can do something like this (I feel dirty just writing it):

Code:
  ai_will_do = {
     factor = 1
     modifier = {
       factor = 0
       ROOT = {
         PREV = {
           FROM = {
             distance = {
               who = PREVPREV
               value = 1000
             }
           }
         }
       }
     }
 
  • 4
Reactions:
Gars, is there anyway you will simplify the dynamic mercs composition? At the moment we need to switch the government of the character to nomadic, then the culture to a dummy culture to be able to define the mercenary company that is created when we create the title. Would it be possible to get the mercenary_composition flag in the create title decision?
 
I finally got around to looking into this one. It doesn't have anything to do with the AI not looking at ai_will_do or the distance trigger not working. The problem is bad coding and using scopes for things they weren't made for. Any CB that is in title scope and has an attacker in the Root scope and a defender in the From scope will have this problem if you step into the Root scope, like this:

Code:
  ai_will_do = {
     factor = 1
     modifier = {
       factor = 0
       ROOT = {
         distance = {
           who = FROM
           value = 1000
         }
       }
     }

The ROOT scope here isn't the real ROOT scope (which instead is the title) and thus have no FROM scope, so when you use FROM here it will instead point to itself, and the character will check the distance against itself...

Unfortunately this is a pretty big bug and I can't do such a big change on my own. Will have to wait for the CK2 lead to return from vacation to discuss this. To "fix" the problem wight now you can do something like this (I feel dirty just writing it):

Code:
  ai_will_do = {
     factor = 1
     modifier = {
       factor = 0
       ROOT = {
         PREV = {
           FROM = {
             distance = {
               who = PREVPREV
               value = 1000
             }
           }
         }
       }
     }
Part of the problem then is lack of documentation (which is, unfortunately, a common problem.) There's nothing in the notes at the top of the CB file indicating that ai_will_do is a title scope.
 
Captain, is it possible to stop the game from translating negative income from holdings into positive income?

Allowing it to actually assign negative tax would be great, but simply making it zero would do...


P.S.: Thank you for your hard work :)
 
The ROOT scope here isn't the real ROOT scope (which instead is the title) and thus have no FROM scope, so when you use FROM here it will instead point to itself, and the character will check the distance against itself...

Unfortunately this is a pretty big bug and I can't do such a big change on my own. Will have to wait for the CK2 lead to return from vacation to discuss this. To "fix" the problem wight now you can do something like this (I feel dirty just writing it):

Code:
  ai_will_do = {
     factor = 1
     modifier = {
       factor = 0
       ROOT = {
         PREV = {
           FROM = {
             distance = {
               who = PREVPREV
               value = 1000
             }
           }
         }
       }
     }

Just so I can understand this: in order to scope to the attacker character (ROOT) or the defender character (FROM), you need to do so from inside the base title scope only?

So my previous example where I wanted to make ROOT not be willing to attack FROM if they're part of the same religion group, I'd need to change

Code:
modifier = {
   factor = 0
   ROOT = {
     is_nomadic = no
     NOT = { religion_group = FROM }
   }
}

to something more like

Code:
modifier = {
   factor = 0
   FROM = {
     PREV = {
       ROOT = {
         is_nomadic = no
         NOT = { religion_group = PREVPREV }
       }
     }
   }
}

did I understand that right?
 
Oh captain my captain the any_direct_de_jure_vassal_title scope is broken.

just to prove my point I used it three times in a row.


Code:
                any_direct_de_jure_vassal_title = {
                    has_holder = yes
                    holder_scope = {
                        is_tributary = ROOT
                    }
                }
                any_direct_de_jure_vassal_title = {
                    NOT = {
                        has_holder = yes
                        holder_scope = {
                            is_tributary = ROOT
                        }
                    }
                }
                any_direct_de_jure_vassal_title = {
                    NAND = {
                        has_holder = yes
                        holder_scope = {
                            is_tributary = ROOT
                        }
                    }
                }
Per logical definition at least one of these has to evaluate to false.
But when run it in the game
ByA02ukJqoeb36g8bV18rI7lJ4JMdypLssj2aW2ODG-wAPYnGtmlcBt70PGRHnWG7rdPkNJO-whtnBmRHwNz2Ee7boLGyAHxIDcMfo3E3O2aYEZML1x7cjI_zFvqcgtihtUon4GRD8feiWtbniU50GIYmWtZ52BKQkPHzZkQCy2mbobWKWwig8VpjS3F0erlfecrWPz__q7XQB3NXTsbHlC-jclIigIl48-P4nSh1tQidv0DCi1RvHC7WFrZPCYArtLTIwwpWx07Axkd-W47gXVK-tH-KLIKwiPs19ZMkG2Qv6_eol16v7OtZ1AUgI0E98o_SXlbb0YE-bc7NnS9IaKuwunKdqileOpvuLf50YAul9QAdCtRNhPUQLff3eJiUKR6N56R-f4paKFOqx_kUyGuxUxF9Duc1bOKV9C-hoDRFuCvnJUHhk3TZhAWCQmCbwwVs_tt4fmEQe-y6Wm-aM1744WgbVkmiWvDAiWLcSxOtXOOcThoVyDOJvJoVqC56JM90Vg=w288-h276-no

The top one should evaluate to false but the scope turn it to true for some reason. Also the localisation for NAND is All of the following must be true when it should be all of the following must be false.
 
Oh captain my captain the any_direct_de_jure_vassal_title scope is broken.

just to prove my point I used it three times in a row.


Code:
                any_direct_de_jure_vassal_title = {
                    has_holder = yes
                    holder_scope = {
                        is_tributary = ROOT
                    }
                }
                any_direct_de_jure_vassal_title = {
                    NOT = {
                        has_holder = yes
                        holder_scope = {
                            is_tributary = ROOT
                        }
                    }
                }
                any_direct_de_jure_vassal_title = {
                    NAND = {
                        has_holder = yes
                        holder_scope = {
                            is_tributary = ROOT
                        }
                    }
                }
Per logical definition at least one of these has to evaluate to false.
But when run it in the game
ByA02ukJqoeb36g8bV18rI7lJ4JMdypLssj2aW2ODG-wAPYnGtmlcBt70PGRHnWG7rdPkNJO-whtnBmRHwNz2Ee7boLGyAHxIDcMfo3E3O2aYEZML1x7cjI_zFvqcgtihtUon4GRD8feiWtbniU50GIYmWtZ52BKQkPHzZkQCy2mbobWKWwig8VpjS3F0erlfecrWPz__q7XQB3NXTsbHlC-jclIigIl48-P4nSh1tQidv0DCi1RvHC7WFrZPCYArtLTIwwpWx07Axkd-W47gXVK-tH-KLIKwiPs19ZMkG2Qv6_eol16v7OtZ1AUgI0E98o_SXlbb0YE-bc7NnS9IaKuwunKdqileOpvuLf50YAul9QAdCtRNhPUQLff3eJiUKR6N56R-f4paKFOqx_kUyGuxUxF9Duc1bOKV9C-hoDRFuCvnJUHhk3TZhAWCQmCbwwVs_tt4fmEQe-y6Wm-aM1744WgbVkmiWvDAiWLcSxOtXOOcThoVyDOJvJoVqC56JM90Vg=w288-h276-no

The top one should evaluate to false but the scope turn it to true for some reason. Also the localisation for NAND is All of the following must be true when it should be all of the following must be false.

is_tributary takes a boolean, not a character scope.
What you want is pays_tribute_to ;)
 
  • 1
Reactions:
What version of CK2 is After the End supposed to be tested with? Running the latest released version crashes on loading the defines.
Were you using the latest Github version of After the End? I just tested a few minutes ago and it loads fine with the latest version of CK2, and we haven't had any reports of a load CTD in our forum thread.
 
Last edited:
I think you need to link the Github repository for After The End. It isn't the Captain's job to search for it.
 
I suspect that "random" is not working or I did not have understood is meaning, for example I send an event to 5 characters they receive it and expect their response I liked that I receive the response not in the same time to give the impression that the letter came from distant and different realms instead I get 5 responses all stacked one on the other and this breaks the immersion a lot! My impression is that the random value obtained is always the same number that is not a lot random...

This is a snippet of the code I'm using (this is the option of the character that should answer):

Code:
    # Vassals of the Byzantine Empire which the Emperor is not de jure liege (forced to join)
    option = {
        name = "EVTOPTCEoG.506"
        trigger = {
            #NOT = { has_landed_title = e_byzantium }
            event_target:the_loser = {
                    NOT = { character = ROOT }   
            }
           
            NOT = { has_landed_title = k_orthodox }
            any_realm_title = {
                kingdom = {
                    OR = {
                        title = k_byzantium # Hellas
                        title = k_epirus
                        title = k_bulgaria
                        title = k_serbia
                        title = k_croatia
                    }
                    NOT = { tier = baron }
                }
            }
        }

        set_character_flag = joins_the_conference_of_peace

        # Send an event back to the caller to make him known of our participation
        FROM = { character_event = { id = EoG.507 days = 5 random = 15 } }
        }

Thanks for your help!
 
Part of the problem then is lack of documentation (which is, unfortunately, a common problem.) There's nothing in the notes at the top of the CB file indicating that ai_will_do is a title scope.

I agree with you (although it is fairly obvious that it is in title scope from the way they are scripted). But I've added a note about it now and I've also fixed the bug so you should be able to use scopes normally as of next patch/DLC.
 
Just so I can understand this: in order to scope to the attacker character (ROOT) or the defender character (FROM), you need to do so from inside the base title scope only?

So my previous example where I wanted to make ROOT not be willing to attack FROM if they're part of the same religion group, I'd need to change

Code:
modifier = {
   factor = 0
   ROOT = {
     is_nomadic = no
     NOT = { religion_group = FROM }
   }
}

to something more like

Code:
modifier = {
   factor = 0
   FROM = {
     PREV = {
       ROOT = {
         is_nomadic = no
         NOT = { religion_group = PREVPREV }
       }
     }
   }
}

did I understand that right?

Yes, correct. This will however be fixed in the next patch/DLC. But in the mean time this work-around will do.
 
Were you using the latest Github version of After the End? I just tested a few minutes ago and it loads fine with the latest version of CK2, and we haven't had any reports of a load CTD in our forum thread.

I only use direct download links here on the forum or a link to download a zip archive somewhere.
 
I suspect that "random" is not working or I did not have understood is meaning, for example I send an event to 5 characters they receive it and expect their response I liked that I receive the response not in the same time to give the impression that the letter came from distant and different realms instead I get 5 responses all stacked one on the other and this breaks the immersion a lot! My impression is that the random value obtained is always the same number that is not a lot random...

This is a snippet of the code I'm using (this is the option of the character that should answer):

Code:
    # Vassals of the Byzantine Empire which the Emperor is not de jure liege (forced to join)
    option = {
        name = "EVTOPTCEoG.506"
        trigger = {
            #NOT = { has_landed_title = e_byzantium }
            event_target:the_loser = {
                    NOT = { character = ROOT }  
            }
          
            NOT = { has_landed_title = k_orthodox }
            any_realm_title = {
                kingdom = {
                    OR = {
                        title = k_byzantium # Hellas
                        title = k_epirus
                        title = k_bulgaria
                        title = k_serbia
                        title = k_croatia
                    }
                    NOT = { tier = baron }
                }
            }
        }

        set_character_flag = joins_the_conference_of_peace

        # Send an event back to the caller to make him known of our participation
        FROM = { character_event = { id = EoG.507 days = 5 random = 15 } }
        }

Thanks for your help!

Don't use the random in the reply events - since those five all got the same random seed from the original event. Use the random when you send out the events instead and then reply with fixed days or instant.
 
There was a note in the changelog that said "Added triggers is_[law/government/decision/targetted_decision/title_decision/settlement_decision]_[valid/potential] with parameters key, character, title and settlement." For the life of me, I can't figure out how that's supposed to work. The other triggers added with "is_[law/government/decision/targetted_decision/title_decision/settlement_decision/trade_post_decision/fort_decision]_[allowed/potential]" work great, but how does one use the previous?

They are both the same triggers. All of those exists with _allowed/_potential at the end (so there is no one with _valid). is_[law/government/decision] uses a single right-side argument while is_[targetted_decision/title_decision/settlement_decision/trade_post_decision/fort_decision] is scripted like this:

Code:
    k_england = {
       ROOT = {
         is_title_decision_allowed = {
           key = raiding_adventurer_buy_title
           title = PREV
         }
       }
     }
 
Event targets don't seem to be working as I would expect them to in CBs:

Code:
  on_success_title = {
     holder_scope = {
       save_event_target_as = target_taker
     }
    
     any_direct_de_jure_vassal_title = {
       limit = {
         holder_scope = {
           OR = {
             character = FROM
             is_liege_or_above = FROM
           }
           NOR = {
             character = event_target:target_taker
             is_liege_or_above = event_target:target_taker
             is_liege_or_above = ROOT
           }
         }
       }
       usurp_title_plus_barony_if_unlanded = { target = event_target:target_taker type = claim }
     }

That's actually not a problem - the assert fires when it shouldn't. Will remove that logging.
 
About asserts... it's almost impossible to identify the source of most asserts, and the Previous assert occured in... lines seem completely useless (unconnected with any assert failed lines.) Is it possible for the asserts to log the file/event/decision etc. they occurred in?
 
Last edited:
  • 1
Reactions:
Possibly -- although, at the moment, there are no variable commands in the mod whatsoever. I guess I could also try removing check_variables as well, and see if that's it.

You're probably right about "previous assert" not really connecting to the event it's mentioning...although that makes it disappointingly useless. Hopefully Captain Gars can verify.

EDIT: That seemed to do it. Removed all check_variable commands as well, and now there are no asserts showing whatsoever.

Sounds very strange and I can't reproduce it. If you can reproduce it on your end with one specific event, then paste it here and I will look at it.
 
I've recently tried to increase the number of children someone can educate by setting MAX_WARDS_PER_GUARDIAN in defines.lua to 10 instead of 2.

However, I'm only able to educate the stock 2, so either I'm missing something or the defines isn't working.

Found and fixed this one (hopefully once and for all). The problem was using hard-coded values and not the define in several places.