• 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.
Well, that's probably another problem with funky "randomness".
As with all PC games, or programs really, there is no such thing as true randomness: A random result is only simulated via a generated random seed. Problem is that because this seed is generated by some sort of algorithm, it's not really random and can be the same if the generation is the same.
In CK2 specifically, there used to be an oversight that made a random_list always give the same result, if it was called multiple times within the same event. For example, if you wanted to give every province in the game one of three modifiers, let's say "rich", "normal" and "poor", and at some point (maybe gamestart) you would call an event that scopes to every province, and fires a random_list with those three options for every province, it would result in all provinces getting the same modifier, e.g. all "rich" or all "poor", but no combination! That error was fixed a while ago, but
TL;DR: Maybe there is a similar problem with randomness related to random scopes in general, or this scope only? So that instead of true randomness, it always picks the same random result at a given time?

This should really be fixed by vanilla if that is true; but to circumvent it, maybe you could try some things: Fire another event first and have it call one of three events, which all basically do the same and apply your trait via a random_playable_ruler scope. But because they are called via a (now actually working) random thing, maybe the scope will also actually be random in the second event.
Maybe that would work, maybe not, I am not sure. But you could try it out.

Combining your idea with something I saw above. I created an event that calls the actual event after a 1 day delay. Now that random function is indeed working like it should. So it must just be a bug with doing it immediately as the game is loading up.
 
Is is possible to change the localisation for a viceroyalty based on culture? If so, what is the tag?
If you don't know what I mean, I want to know if there is an equivalent to the "king_saxon" and "kingdom_of_saxon" localisation tags for viceroyalties.
Thanks in advance.
 
Hey, Random question

would there be a way to tie agression to an inheritable trait
What do you mean by "aggression"?
An AI modifier, such as "ai_ambition", which will make the AI more likely to declare war? If you mean this, then yes, it is possible - simply define the modifier value inside the trait. The value will be invisible ingame because it is a hidden stat, but it will work on traits. And of course the trait can be made inheritable.
 
How I can test province event by console?
Maybe testevent <eventID> <proc
Hey guys, while testing my mod I noticed that the random_playable_ruler seems to always pick and add a trait to the same ruler. Am I doing something wrong? Is there an additional value I need to add in order to make sure it's fully random?

My Option Code:
Code:
option = {
        trigger = { trait = immortalB}
        name = EVTOPTAvnltbchtmds.1
        random_playable_ruler = {
            add_trait = immortalB
         }
    }

Edit: If it's done when the game starts, it will always pick Alfr of Alfheimr when using the 769 start date. Always picks High Cheif Tyueykezhut of Merya when starting in 867. If I fire the event in game later, from console, it will pick someone new every time.

Sounds like a bug with not properly seeding the rng at game start. I'd advise you report it, linking your mod and the steps to reproduce it.
 
Is there a way to have a building which gives movement speed in the province it was build??
It would seem so:
At least the CK2+ mod has a "roads" building for tradeposts that increases "local_movement_speed".
 
Hey everyone.

I have defined a character modifier which is obtainable by an event option.

Code:
believe_presterjohn = {
    monthly_character_piety = 0.1
    icon = 17
}

I can't see it on the character screen after I get it. Is it because I haven't defined a duration? Is there a way to make it permanent. (I want to remove them with another event in the future)
 
Hey everyone.

I have defined a character modifier which is obtainable by an event option.

Code:
believe_presterjohn = {
    monthly_character_piety = 0.1
    icon = 17
}

I can't see it on the character screen after I get it. Is it because I haven't defined a duration? Is there a way to make it permanent. (I want to remove them with another event in the future)
Yep, every modifier needs a duration, otherwise it won't work.
To make it last indefinitely (or until you remove it), use "duration = -1"
 
Another question.

Is it possible to use variables as triggers. If not, how can I approach this problem:

There is an investigation that can be completed by finding clues. Let's say there are 7 different clues to conclude research. When a character collects 3 clues the investigation is over. I don't want the clues to be in a specific order. A character should be able to find clue 3 first, clue 7 second etc in different events. I wanted to use variables to save the number of clues collected and check if it's equal to or more than 3 to finish. But how can I do it if I can't use variables in triggers?
 
Another question.

Is it possible to use variables as triggers. If not, how can I approach this problem:

There is an investigation that can be completed by finding clues. Let's say there are 7 different clues to conclude research. When a character collects 3 clues the investigation is over. I don't want the clues to be in a specific order. A character should be able to find clue 3 first, clue 7 second etc in different events. I wanted to use variables to save the number of clues collected and check if it's equal to or more than 3 to finish. But how can I do it if I can't use variables in triggers?
You can check for variables values in a trigger.
Code:
check_variable = { which = "clues_found" value = 3 }
 
Today is my question day :)

Let's say I want players to send their characters to a specific location (province) for an event chain. What's the best way to this? I thought spawning a few event troops which character can command and move manually. Than I can check at_location = province ID. But is there an easier way?

Is it possible to mod small icons on top of character portraits which says "in hiding, commanding troops, in prison" etc. Can I add more? If not, can I edit existing ones?
 
Today is my question day :)

Let's say I want players to send their characters to a specific location (province) for an event chain. What's the best way to this? I thought spawning a few event troops which character can command and move manually. Than I can check at_location = province ID. But is there an easier way?

Is it possible to mod small icons on top of character portraits which says "in hiding, commanding troops, in prison" etc. Can I add more? If not, can I edit existing ones?
Well, imo easiest way would still be to send them on a "Pilgrimage".
It does not really have to be a pilgrimage I mean, but you can use the mechanics to have them "be away", and then you could just "send" them to a certain province via events. That way, also AI could use it. The ruler will get a regent (so remember to pick a non-lunatic one beforehand!) and that little icon on top of his portrait.
If you just want the player to be able to do it, yes, armies are a way. But keep in mind that if somehow he ends up in a war, his event troops might end up in a fight! Or the province he goes to spawns a revolt out of the blue, then those revolters will mostly be hostile to anyone, and could also slaughter the troops.

Thus, it would seem safer to me to do everything with events. There is a certain modifier you can apply to a trait that will apply the "pilgrimage" modifier. I don't remember what it is called, but check the vanilla traits and event chains and you should find it.
 
Today is my question day :)

Let's say I want players to send their characters to a specific location (province) for an event chain. What's the best way to this? I thought spawning a few event troops which character can command and move manually. Than I can check at_location = province ID. But is there an easier way?

Is it possible to mod small icons on top of character portraits which says "in hiding, commanding troops, in prison" etc. Can I add more? If not, can I edit existing ones?

You can't add more of these icons, but you should be able to edit their corresponding tooltips, if you find them in the localisation flies.
 
Code:
character_event = { id = event.006 days = 90 random = 30 }

1- How does the random work here? 60-120 days or 90-120 days?

2- Is there anything wrong with calling the same event inside a block of random_list (in the option or immediate)? For example; there is a %10 chance that this same event is fired again in X days.

3- What happens if we use an if block inside a random_list weight block? Let's say we have to 50 blocks and the conditions of the if block inside the first 50 block isn't true. Does it simply execute the second 50 block or do nothing?
 
Last edited:
Code:
character_event = { id = event.006 days = 90 random = 30 }

1- How does the random work here? 60-120 days or 90-120 days?

2- Is there anything wrong with calling the same event inside a block of random_list (in the option or immediate)? For example; there is a %10 chance that this same event is fired again in X days.

3- What happens if we use an if block inside a random_list weight block? Let's say we have to 50 blocks and the conditions of the if block inside the first 50 block isn't true. Does it simply execute the second 50 block or do nothing?

1) 90-120

2) may cause problems if you do that repeatedly. To do it safely use repeat_event instead.

3) will do nothing if an entry is picked with the if that evaluates to false. Note though that you can put a trigger = {} inside an entry so that the entry isn't picked if the trigger isn't satisfied.
 
I can't seem to find how you check for a characters general opinion score before allowing an event or decision to be processed. I see mentions of checking for a specific opinion modifier but thus far I'm not finding anything that says I can say something like:

if ROOT opinion > 50 then allow etc.

Is there a way to do this and I'm just not seeing it in the wiki?
 
2) may cause problems if you do that repeatedly. To do it safely use repeat_event instead.

3) will do nothing if an entry is picked with the if that evaluates to false. Note though that you can put a trigger = {} inside an entry so that the entry isn't picked if the trigger isn't satisfied.

These 2 are exactly what I needed, thanks!

I can't seem to find how you check for a characters general opinion score before allowing an event or decision to be processed. I see mentions of checking for a specific opinion modifier but thus far I'm not finding anything that says I can say something like:

if ROOT opinion > 50 then allow etc.

Is there a way to do this and I'm just not seeing it in the wiki?

opinion = { who = ROOT value = 50 }

or if you don't want to take state diplomacy or laws into account:

personal_opinion = { who = ROOT value = 50 }
 
Last edited:
Is is possible to change the localisation for a viceroyalty based on culture? If so, what is the tag?
If you don't know what I mean, I want to know if there is an equivalent to the "king_saxon" and "kingdom_of_saxon" localisation tags for viceroyalties.
Thanks in advance.
There are tags for vice_royalty_<baron/count/duke/king/emperor> and vice_royalty_<baron/count/duke/king/emperor>_of in v2_20.csv. You can probably tack on culture & religion modifiers.
 
hello,

for the last couple of days i'm trying to mod in my own religion under the indian group. but its not showing up in the ruler designer.

would appreciatie if somebody could have a look and tell me want is going wrong.
 

Attachments

  • mod.zip
    6 KB · Views: 3