• 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.
Status
Not open for further replies.

Whizzer

CKPlus Triumvirate
80 Badges
Jun 17, 2014
1.835
1.013
  • Semper Fi
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Heir to the Throne
  • King Arthur II
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Magicka
  • Victoria: Revolutions
  • Rome Gold
  • Cities in Motion
  • Sengoku
  • Sword of the Stars
  • Sword of the Stars II
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Europa Universalis IV: Mare Nostrum
  • For the Motherland
  • A Game of Dwarves
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Dungeonland
  • Europa Universalis III
  • Crusader Kings II: Sunset Invasion
  • Divine Wind
  • Hearts of Iron III
  • Age of Wonders III
  • Age of Wonders
  • Age of Wonders II
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome Deluxe Edition
Short summary of your issue
Non-primary titles of primary title tier aren't destroyed on a victorious Realm Dissolution faction.

Game Version
1.6

What OS are you playing on?
Windows

What platform are you using?
Steam

What DLC do you have installed?
Royal Court, Northern Lords, Fate of Iberia

Do you have mods enabled?
No

Have you tried verifying your game files (Steam only)?
Yes

How much "pain" is this causing you?
8

Please explain the issue you experienced in the most condensed way possible
The realm dissolution faction CB contains erroneous script, failing to do what it should do: destroy all held titles of equal tier to the primary title tier, if the war is won by the faction.

Please explain how to reproduce the issue
This script has one too many prev in it, specifically in this line: prev = { destroy_title = this }:

Code:
        scope:defender = {
            every_held_title = {
                limit = {
                    NOT = { this = prev.primary_title }
                    tier = prev.primary_title.tier
                }
                prev = { destroy_title = this }
            }
            destroy_title = primary_title
        }

Is there anything else you think could help us identify/replicate the issue?
Replace prev = { destroy_title = this } with destroy_title = this.

I have attached a save game
No

Upload Attachment
File(s) attached

Screenshot courtesy of Tiax.
 

Attachments

  • 20220601002057_1.jpg
    20220601002057_1.jpg
    689,6 KB · Views: 0
Last edited:
  • 10Like
Reactions:
i would even say it would work with this:
Code:
scope:defender = {
    every_held_title = {
        limit = {
            NOT = { this = primary_title }
            tier = primary_title.tier
        }
        destroy_title = this
    }
    destroy_title = primary_title
}
no guarantee that this would work (i don't know CK3 programming, just have knowledge at programming itself)
they should go through each title, look if it is same tier as primary title, but not the primary title itself and destroy it, and at the end destroy the primary title
 
i would even say it would work with this:
Code:
scope:defender = {
    every_held_title = {
        limit = {
            NOT = { this = primary_title }
            tier = primary_title.tier
        }
        destroy_title = this
    }
    destroy_title = primary_title
}
no guarantee that this would work (i don't know CK3 programming, just have knowledge at programming itself)
they should go through each title, look if it is same tier as primary title, but not the primary title itself and destroy it, and at the end destroy the primary title
While I'm far from an expert on CK3 script, I doubt that would work. primary_title doesn't make too much sense as a one-to-one link from a title to that title holder's primary title, though I suppose it's not impossible that is indeed the case. A working alternative could be the following:

Code:
scope:defender = {
    every_held_title = {
        limit = {
            NOT = { this = holder.primary_title }
            tier = holder.primary_title.tier
        }
        destroy_title = this
    }
    destroy_title = primary_title
}
 
I don't really see what's wrong with the current code. Every_held_title opens a new scope, doesn't it? So prev refers to the defender. And destroy_title is a character effect, which is why it takes the title as an argument. It looks to me like prev is correct.
 
I don't really see what's wrong with the current code. Every_held_title opens a new scope, doesn't it? So prev refers to the defender. And destroy_title is a character effect, which is why it takes the title as an argument. It looks to me like prev is correct.
It clearly scopes to the previous scope, which is the defender. So it tries to destroy the defender, not the held title.

Edit: I see now. Confusing how CK3 uses this effect, I must say. So it should be holder = { destroy_title = prev }
 
It clearly scopes to the previous scope, which is the defender. So it tries to destroy the defender, not the held title.

Edit: I see now. Confusing how CK3 uses this effect, I must say. So it should be holder = { destroy_title = prev }
Yeah I think you found the real problem with the original code :)

For reference it was
Code:
scope:defender = {
    every_held_title = {
        limit = {
            NOT = { this = prev.primary_title }
            tier = prev.primary_title.tier
        }
        prev = { destroy_title = this }
    }
    destroy_title = primary_title
}

Where it says prev = { destroy_title = this }, the problem is that prev opens a new scope. And inside it, "this" refers to the defender not to the title.

So it should be, confusingly, prev = { destroy_title = prev }

For readability it's probably better to do scope:defender = { destroy_title = prev } so that the reader doesn't have to puzzle out multiple prevs.
 
  • 2
  • 1Like
Reactions:
Status
Not open for further replies.