• 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.
BTW, to give you a better idea of why we are talking about landed_titles.txt readability / clutter problems being a major concern, SWMH's landed_titles.txt, which is not their only titles file, is over 50,000 lines long-- and they use much more compact formatting than vanilla or the snippet I posted. If it used the same formatting as what I posted (which was compact), then I'd estimate it'd expand to about 80,000 lines.
 
FYI, the way to separate out usurpation and creation conditions in a given title's allow trigger is to use an alternation (OR) on FROM = { has_holder = no }, which is just a way of saying "this title, FROM, has no current holder (therefore we'd be creating it rather than usurping it)," which when false, obviously then means you're usurping it and not creating it.
My understanding was that it was a lot simpler than this. In defines.lua you go to DEJURE_COUNTY_LIMIT_TO_CREATE = 0.51 and then, replace it with DEJURE_COUNTY_LIMIT_TO_CREATE = 0.50. And vice versa for DEJURE_COUNTY_LIMIT_TO_USURP.
 
My understanding was that it was a lot simpler than this. In defines.lua you go to DEJURE_COUNTY_LIMIT_TO_CREATE = 0.51 and then, replace it with DEJURE_COUNTY_LIMIT_TO_CREATE = 0.50. And vice versa for DEJURE_COUNTY_LIMIT_TO_USURP.
Yep, those values determine default creation/usurpation conditions. You're missing the point of your quote, though.
 
I took way too long to post the full solution. Hehe. Didn't even notice your post. You took more than 20 minutes, but I'll give you the prize, because you provided a usage example, and I only asked for the name of the trigger to use.

EDIT:

Your full code was a little bit... out of context, FWIW. A title allow trigger is in character scope with FROM being the title scope, so calling holder_scope = { ... } as you did would not happen in an actual allow trigger. However, at least you demonstrated the arguments.

OK, quiz time's over boys and girls. Meneth, you get a free candy bar. Tune in next time for other ways to waste your time, but fun!
If you're to point our errors in my code, I'm gonna point out some in yours ;)
"num_of_realm_counties = { value = 2 title = FROM }" is completely unnecessary. The 50% requirement already covers that.
And FROM = { holder_scope = { } } is a lot more efficient than any_playable_ruler = { }.
 
If you're to point our errors in my code, I'm gonna point out some in yours ;)
"num_of_realm_counties = { value = 2 title = FROM }" is completely unnecessary. The 50% requirement already covers that.
And FROM = { holder_scope = { } } is a lot more efficient than any_playable_ruler = { }.

Aww, I was just being comical. Obviously you were not intending for your code to be fully correct or even mostly correct in the details beyond using num_of_realm_counties. That's all I needed to see anyway.

However, if YOU'RE going to come back at my flawless, I assert (is there still room for comedy?), trigger, then... well, I guess then I'll defend it.

You're correct about the first num_of_realm_counties being unnecessary in this case due to targeting 50% as the baseline. It seemed incomplete for edification purposes to leave it out of the logic, though, since it relies on a define and hidden hardcoded conditions to supplement it if so (i.e., ain't true on its own).

Then you had to go besmirch yourself by saying this:

Meneth said:
And FROM = { holder_scope = { } } is a lot more efficient than any_playable_ruler = { }.

Yes and no.

Yes, in the sense that scoping to the title, which may or may not be held, and then its possibly undefined holder_scope, and then executing some trigger within that interesting scope is a lot more efficient than any_playable_ruler = { <the same or an effectively equal cost inner trigger> }. Like, in the sense that it would run faster if you benchmarked it. Efficiency toward what end, I don't know. Your code fragment did not solve the problem that my code fragment did, nor did it solve the basic problem, so I guess efficiency is subjective. ;)

Once there was a program named Apples and a different program named Bananas. Apples actually didn't accomplish its intended goal and miscalculated most of the time, but its benchmarks were excellent. Bananas, on the other hand, had very poor benchmarks. However, not only did it always calculate the right answer, but it actually answered an entirely different and much more sophisticated question. [ I implemented the "he who is the most powerful within the title and holds the minimum for creation/usurpation" rule that was suggested at one point, as I also mentioned. ]

In the end, the inane competition between the too-fast-to-be-right Apples and the correct-but-too-overloaded-to-compete Bananas led to Apples finally going bananas and Bananas just going nuts:

Obviously, if efficiency were the concern and 4-county was the optimization target (but with the goal of still being valid in the other cases and not hard-coded), the best trigger would have directly checked the direct de jure vassals of FROM twice, nested, to flexibly isolate the case where two different characters that aren't ROOT held counties in the duchy vs. whether only one character held the direct de jure vassal titles not owned by ROOT. That should just barely work for a 6-county case. For an 8-county title, then you'd need to hardcode title references or use any_playable_ruler again to solve the Bananas question. That is a way more confusing trigger for someone not versed in these dark arts to grok, though.
 
Aww, I was just being comical. Obviously you were not intending for your code to be fully correct or even mostly correct in the details beyond using num_of_realm_counties. That's all I needed to see anyway.

However, if YOU'RE going to come back at my flawless, I assert (is there still room for comedy?), trigger, then... well, I guess then I'll defend it.

You're correct about the first num_of_realm_counties being unnecessary in this case due to targeting 50% as the baseline. It seemed incomplete for edification purposes to leave it out of the logic, though, since it relies on a define and hidden hardcoded conditions to supplement it if so (i.e., ain't true on its own).

Then you had to go besmirch yourself by saying this:

Yes and no.

Yes, in the sense that scoping to the title, which may or may not be held, and then its possibly undefined holder_scope, and then executing some trigger within that interesting scope is a lot more efficient than any_playable_ruler = { <the same or an effectively equal cost inner trigger> }. Like, in the sense that it would run faster if you benchmarked it. Efficiency toward what end, I don't know. Your code fragment did not solve the problem that my code fragment did, nor did it solve the basic problem, so I guess efficiency is subjective. ;)

Once there was a program named Apples and a different program named Bananas. Apples actually didn't accomplish its intended goal and miscalculated most of the time, but its benchmarks were excellent. Bananas, on the other hand, had very poor benchmarks. However, not only did it always calculate the right answer, but it actually answered an entirely different and much more sophisticated question. [ I implemented the "he who is the most powerful within the title and holds the minimum for creation/usurpation" rule that was suggested at one point, as I also mentioned. ]

In the end, the inane competition between the too-fast-to-be-right Apples and the correct-but-too-overloaded-to-compete Bananas led to Apples finally going bananas and Bananas just going nuts:

Obviously, if efficiency were the concern and 4-county was the optimization target (but with the goal of still being valid in the other cases and not hard-coded), the best trigger would have directly checked the direct de jure vassals of FROM twice, nested, to flexibly isolate the case where two different characters that aren't ROOT held counties in the duchy vs. whether only one character held the direct de jure vassal titles not owned by ROOT. That should just barely work for a 6-county case. For an 8-county title, then you'd need to hardcode title references or use any_playable_ruler again to solve the Bananas question. That is a way more confusing trigger for someone not versed in these dark arts to grok, though.
In practice though, the only guy you're at all likely to be competing with for usurpation is holder_scope. Thus that works just fine.
If it has no holder, it should always return false, thus letting the guy with 50% create the title anyway.

Two people who neither hold the title both having 50% of its dejure area is such an unlikely situation that I truly do not see the point in bothering to account for it.
 
In practice though, the only guy you're at all likely to be competing with for usurpation is holder_scope. Thus that works just fine.
If it has no holder, it should always return false, thus letting the guy with 50% create the title anyway.

Two people who neither hold the title both having 50% of its dejure area is such an unlikely situation that I truly do not see the point in bothering to account for it.

Yes, if you limit the problem to not be able to cover the creation case consistently with the usurpation case and make the assumption that the holder is the only other character that might have 50% of the titles, then you are right, it's an ultra-trivial problem. Why don't we make this change to landed_titles today! ;)
 
They are actually separate, yeah (though the first implementation wasn't IIRC).
But I kind of want to avoid the situation where the duke holds one county, another guy holds two, and the 4th is held by some random guy. The second can't usurp at 510% in that case, which is silly.
And it is definitely something I've seen more often than a 4-province duchy split 2-2.

I don't think that situation would be silly at all. To overcome the current Duke's right to rule (by virtue of holding the title) they should need to overcome more than just "i hold more counties than the Duke." We are talking about the other ruler straight up saying "I'm the Duke now because I say so" and everyone else saying "Yeah alright."

I think that scenario, to be believable/realistic/etc., short of military action, should require that they have a significant (read ~60%) majority of the counties.

But hey, you've been the author of a major (popular) mod for almost two years (?) specifically geared toward balance.

Besides, I can always tweak the mod locally to my tastes ;)
 
Besides, I can always tweak the mod locally to my tastes ;)
Critical point. You are not only enabled but encouraged to do so whenever you damn well feel like it. Your playtesting of variations on the rules which govern the mod may lead to potential, informed feedback that you can more readily backup and critique the mod. Informed criticism gets you free toys and a tub of your favorite ice cream (or even qualifying non-dairy frozen dessert products!) around these parts. It helps make the mod better. Just because Meneth has been authoring a mod called Project Balance for so long doesn't ever mean he's automatically right about these matters, and I can attest that he knows that full well. ;)

The 50% issue is largely one of personal opinion it seems. Since a clear consensus around a reasonable argument for changing it away from 50% can't seem to be built, it's just simply not going to be changed by default, but if a consensus arrives and it's convincing, the define would be changed immediately.
 
Critical point. You are not only enabled but encouraged to do so whenever you damn well feel like it. Your playtesting of variations on the rules which govern the mod may lead to potential, informed feedback that you can more readily backup and critique the mod. Informed criticism gets you free toys and a tub of your favorite ice cream (or even qualifying non-dairy frozen dessert products!) around these parts. It helps make the mod better. Just because Meneth has been authoring a mod called Project Balance for so long doesn't ever mean he's automatically right about these matters, and I can attest that he knows that full well. ;)

The 50% issue is largely one of personal opinion it seems. Since a clear consensus around a reasonable argument for changing it away from 50% can't seem to be built, it's just simply not going to be changed by default, but if a consensus arrives and it's convincing, the define would be changed immediately.
Shh... you can't let the commoners know I'm fallible!