Jump to content

CK2 scripting hurts my brain


Guest

Recommended Posts

So I was trying to figure out why the Jus Primae Noctis isn't firing in Dark World.  I narrowed it down to this trigger in event DWCourt.910

 

I'm posting this outside the main DW thread because I'm unsure of my interpretation of CK2 bizarre syntax.  I don't want to post the "fixed" code block in that thread unless it's actually fixed.

    trigger = {
        NOR = {
            event_target:dw_bride = { # We're trying not to catch our spouse here, since the new_character check we tried in .900 wasn't working as was hoped
                spouse = {
                    character = ROOT
                }
            }
            event_target:dw_bride = {  # Trying to keep a duplicate from taking place when you've a marriage within your own court
                spouse = {
                    NOT = { character = ROOT }
                }
                has_character_flag = dw_first_night_chosen
            }
            event_target:dw_bride = { # Trying to ensure that we don't catch ourselves if we're the bride (Futa catch)
                NOT = { character = ROOT }
            }
        }
    }

I can get the event to work by modifying this trigger in various ways, but I'm not sure I'm destroying the logic of the trigger in the process.  The problem is I don't understand exactly what's going on here.

 

First one I get -  I think.  It's just asking "Is this person married to the ruler?"

 

Second one.  Bride's spouse is not the ruler AND bride has flag dw_first_night_chosen. (unless I'm way off, this seems weird)

 

Third.  Bride is not the ruler.  (so if the bride is NOT the ruler - this will evaluate true and cause the event not to trigger.)

 

This is my "Fixed?" version.  I have confirmed that this allows the event to fire, but I'm not convinced I kept the intended filtering logic intact.  (I mean, if you changed the trigger to "yes" that would also make the event fire.)

    trigger = {
        NOR = {
            event_target:dw_bride = { # We're trying not to catch our spouse here, since the new_character check we tried in .900 wasn't working as was hoped
                spouse = {
                    character = ROOT
                }
            }
            event_target:dw_bride = {  # Trying to keep a duplicate from taking place when you've a marriage within your own court
                spouse = {
                has_character_flag = dw_first_night_chosen
                }
            }
            event_target:dw_bride = {  # Trying to keep a duplicate from taking place when you've a marriage within your own court
                has_character_flag = dw_first_night_chosen
            }
            event_target:dw_bride = { # Trying to ensure that we don't catch ourselves if we're the bride (Futa catch)
                character = ROOT
            }
        }
    }

 

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use