• 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.
Just some clarification about event targets which can be unset, are all of these true?

event_target:whatever = { always = yes } is true if and only if the event target has been set

NOT = { event_target:whatever = { always = yes } } is true if and only if the event target has not been set

event_target:whatever = { character = ROOT } is true if and only if the event target is ROOT

event_target:whatever = { NOT = { character = ROOT } } is true if and only if the event target has been set to someone other than ROOT

NOT = { event_target:whatever = { character = ROOT } } is true if the event target has not been set to ROOT, regardless of whether or not it has been set to someone else

Is there a way to differentiate "the event target has died" from "the event target was never set"?

Edit: One more question. If I send someone an event, and then kill them in the same block where I sent the event, do they receive that event before getting the succession screen?
 
Last edited:
event_target:whatever = { always = yes } is true if and only if the event target has been set
And is alive.
NOT = { event_target:whatever = { always = yes } } is true if and only if the event target has not been set
Or if it has been set, but then died.
event_target:whatever = { character = ROOT } is true if and only if the event target is ROOT
Yes.
event_target:whatever = { NOT = { character = ROOT } } is true if and only if the event target has been set to someone other than ROOT

NOT = { event_target:whatever = { character = ROOT } } is true if the event target has not been set to ROOT, regardless of whether or not it has been set to someone else
No. If event_target:whatever has not been set, any condition inside it will return false. So the first one will return true only if the event target exists and it has been set to the ROOT, otherwise it will always return false. The second one will return true if the event target either does not exist, or if it has been set to someone other than ROOT.
Is there a way to differentiate "the event target has died" from "the event target was never set"?
Not sure, actually. The best practise is to generally always set your event targets if you're planning to use them :) Persistent event targets, however, can reference dead people, so you can check for is_alive, but they behave differently in general.
Edit: One more question. If I send someone an event, and then kill them in the same block where I sent the event, do they receive that event before getting the succession screen?
If you do this:
Code:
immediate = {
    FROM = {
        character_event = { id = faiuwle.2 }
        death = { death_reason = death_execution_bear killer = ROOT }
    }
}
The FROM (if they are a player) will get the event and the death screen simultaneously, one atop the other.
If you do this:
Code:
immediate = {
    FROM = {
        death = { death_reason = death_execution_bear killer = ROOT }
        character_event = { id = faiuwle.2 }
    }
}
They will get only the death screen, since you cannot trigger events for dead people.
It is probably better to have event faiuwle.2 have the death in the option or after block. That way you can give the player pause to read what's happening before they perish.
 
I am currently editing events which generate random characters. It appears that the 'dynasty = culture' line causes them to appear with an 'of' or 'from' [location] dynasty. Is it possible to make it choose a location in a restricted area (so, for instance, I do not get a Jewish courtier named 'Abraham of Delhi')? If not, what do I need to do in order to have them select a dynasty from their culture's normal list?
 
I am currently editing events which generate random characters. It appears that the 'dynasty = culture' line causes them to appear with an 'of' or 'from' [location] dynasty. Is it possible to make it choose a location in a restricted area (so, for instance, I do not get a Jewish courtier named 'Abraham of Delhi')? If not, what do I need to do in order to have them select a dynasty from their culture's normal list?
Try dynasty = actually_culture. The behaviour is poorly explained on the wiki, so let me know if this ends up working.
 
I am currently editing events which generate random characters. It appears that the 'dynasty = culture' line causes them to appear with an 'of' or 'from' [location] dynasty. Is it possible to make it choose a location in a restricted area (so, for instance, I do not get a Jewish courtier named 'Abraham of Delhi')? If not, what do I need to do in order to have them select a dynasty from their culture's normal list?

Try using "dynasty = actually_culture".
 
There's no difference, I'm afraid. EDIT: Whoops, forgot to actually apply the change to the mod folder itself. :oops:

EDIT2: It works! Thanks.

Also, I am having trouble with the capital_scope check. How can it be applied to multiple regions (meaning you can be in any one of those regions for it to fire)? Do I have no choice but to make larger, custom super-regions? It's quite a lot of work, since I'd be doing the entire map, and I usually try to be a minimalist when it comes to new features or changes to the map.
 
Last edited:
I think you are mixing something up there:
capital_scope is a scope, so it will bring you somewhere else. On the other hand, region is a condition, something to check against while you are in a fitting scope.
So you can first scope to a province with "capital_scope", and then check with an OR clause for several regions.
Like so:
Code:
capital_scope = {    # go to capital province
    OR = {    # will yield true if province is in any of the following regions
        region = my_region_1
        region = my_region_2
        region = my_region_3
    }
}

It is a tad confusing because you'd expect that there also exists a 'region_scope', which switches to all provinces of a region - however, that one does not exist! Luckily you probably don't need it if i understood you correctly. Though it is problematic if you want to check whether e.g. a certain amount of provinces within a region have a certain modifier.
 
I think you are mixing something up there:
capital_scope is a scope, so it will bring you somewhere else. On the other hand, region is a condition, something to check against while you are in a fitting scope.
So you can first scope to a province with "capital_scope", and then check with an OR clause for several regions.
Like so:
Code:
capital_scope = {    # go to capital province
    OR = {    # will yield true if province is in any of the following regions
        region = my_region_1
        region = my_region_2
        region = my_region_3
    }
}

Ah, thanks. I assumed an OR clause couldn't be used with capital_scope for some reason.
 
Last edited:
Hi there!
Trying to add a couple of minor rivers. Is there anything else I have to do besides drawing them in rivers.bmp?
Maybe I didn't draw them correctly?

When I start up the game, everything is a river.
rvrs.PNG
 
Could someone please tell me what I'm missing with province editing. So I edit the number of settlements that Dublin & Kildare can have to 7. That's fine. But when I use the Ancient Religions mod Dublin reverts to it's usual 4. Kildare still has 7 though. The modder replied to me on steam and told me that there must be a different province history .txt file but there actually isn't one for Dublin in the mod so there is no conflic that I can see. Now the mod DOES make a barony in Dublin a holy site so that must be what's causing the issue but, unfortunately, I can't see how/why

Thanks for any help
Hi,

Not to try hog the thread but was wondering if anyone had any ideas about this?
 
Not sure, actually. The best practise is to generally always set your event targets if you're planning to use them :) Persistent event targets, however, can reference dead people, so you can check for is_alive, but they behave differently in general.

How do persistent event targets work? I actually wound up making this event target persistent, because I wasn't sure that all the events using it would count as being in the same chain. The reason I don't want to always set the event target is because I want it to be possible for the event to continue either with a particular actual character or a generic peasant character who doesn't actually exist.

It is probably better to have event faiuwle.2 have the death in the option or after block. That way you can give the player pause to read what's happening before they perish.

I thought about doing it that way, but in this case it's much more likely that the player is the killer rather than the victim, and I wanted there to be a tooltip in the killer's event that says "So and so dies!".
 
How do persistent event targets work? I actually wound up making this event target persistent, because I wasn't sure that all the events using it would count as being in the same chain. The reason I don't want to always set the event target is because I want it to be possible for the event to continue either with a particular actual character or a generic peasant character who doesn't actually exist.
I am going to have to correct myself: it looks like regular event targets can target dead folk too. They are basically pointers, containing the id and type of what they're referring to, regardless of whether they're dead, alive, inactive, active, etc. So use always = yes to check if the target has been set, and is_alive = yes to check if the person is alive.

About how event chains work... it's mostly sane, but there's some oddball conditions. If you have event A triggering B triggering C, then stuff set in A will be known to C, no issue.

If A triggers both B and C, then C will usually not know about event targets set in B, unless both B and C were called from A without delay. Undelayed event triggers are treated differently.
I thought about doing it that way, but in this case it's much more likely that the player is the killer rather than the victim, and I wanted there to be a tooltip in the killer's event that says "So and so dies!".
I know there's a way to do it, but I don't know how out of the top of my head. Check the wiki, or look at the vanilla duel events, I think it's used there.
 
Hi there!
Trying to add a couple of minor rivers. Is there anything else I have to do besides drawing them in rivers.bmp?
Maybe I didn't draw them correctly?

When I start up the game, everything is a river.
View attachment 513946
The drawing looks fine to me. The only thing I can think of is that the save format might be off. Most of the files (except provinces.bmp) use a very specific color table (wiki)that is saved together with the file. If you somehow changed that or did not save it with the .bmp file, the game might be confused about what should be a river.
Though the wiki states such an error should actually result in a CTD, so idk

Hi,

Not to try hog the thread but was wondering if anyone had any ideas about this?
No idea. Can you post your file and the one that adds the holy site from the ancient religions mod?Maybe someone can spot the problem in the files.
 
The drawing looks fine to me. The only thing I can think of is that the save format might be off. Most of the files (except provinces.bmp) use a very specific color table (wiki)that is saved together with the file. If you somehow changed that or did not save it with the .bmp file, the game might be confused about what should be a river.
Though the wiki states such an error should actually result in a CTD, so idk
Here's a pic of what it looks like ingame.
20190922130351_1.jpg


How could I have possibly changed the color palette? And how do I make sure I save it?
Ed. Just checked, the colors correspond to the ones on the wiki.
Quick question, there is not supposed to be a source, if the river joins another one, right?
 
Last edited:
I must admit this is a pretty cool looking bug though ^^

Yes, only one source per river system. So if your river joins another river that already has a source defined somewhere, you must not add another source.

You can upload your file if you want, I always suggest this when I'm out of ideas ^^
I'm still thinking something might be off about the colormap, it's my only guess. I could check it if you upload it.
 
I must admit this is a pretty cool looking bug though ^^

Yes, only one source per river system. So if your river joins another river that already has a source defined somewhere, you must not add another source.

You can upload your file if you want, I always suggest this when I'm out of ideas ^^
I'm still thinking something might be off about the colormap, it's my only guess. I could check it if you upload it.
Ok, thanks.
Here's the link, for whatever reason .bmp is not an allowed extension on the forums.
https://drive.google.com/file/d/1uBhvvMAa9G_Eoej8Q0funJuWYHzNxEbD/view?usp=sharing
 
Building a new offmap power, I have some problems with undefined event modifier.
In common/offmap_powers/01_offmap_powers_SSI.txt, I have
Code:
offmap_mexikha = {
  name = mexikha_mexikha
  window_name = domestic_offmaps_mexikha_window
  button_name = icon_offmaps_mexikha_entry
  currency_name = TXT_PESO_MEXIKHA
  currency_gain = monthly_mexikhan_peso
...
And in common/event_modifiers/00_event_modifiers_SSI.txt
Code:
angered_mexikha_modifier = { #Scripter! Update angered_mexikha_tt if values change here.
  icon = 110
  monthly_character_prestige = -0.5
  monthly_mexikhan_peso= -2
}
Then all I have in error.log are
Code:
[persistent.cpp:40]: Error: "Undefined modifier type! token: monthly_mexikhan_peso, near line: 98" in file: "common/event_modifiers/00_event_modifiers_SSI.txt"
...


So how can I make my new event modifier work?

Edit: oh my. Just found I didn't define that in common/modifier_definitions/00_modifier_definitions.txt
Problem solved.
 
Ok, thanks.
Here's the link, for whatever reason .bmp is not an allowed extension on the forums.
https://drive.google.com/file/d/1uBhvvMAa9G_Eoej8Q0funJuWYHzNxEbD/view?usp=sharing
Okay, so I believe it is the colourmap.
Opening the file in GIMP, there is a window under /Windows/Dockable Dialogues/Colourmap that shows the current indexed colourmap in order.
Now, the problem seems to be that while your colours match that of vanilla, their ordering does not! Which is important as - afaik - they get interpreted by the game based on index, not on colour.
You can spot the difference:
vanilla_rivers.jpg your_rivers.jpg

Now tbh I have no idea how that mismatch was introduced, as I know relatively little about this whole thing. Neither do I know how you would revert that error; so my suggestion would be to just copy the vanilla file and start anew from it, just overwriting the copy and thus hopefully keeping the indexed order this time.
 
Last edited:
Okay, so I believe it is the colourmap.
Opening the file in GIMP, there is a window under /Windows/Dockable Dialogues/Colourmap that shows the current indexed colourmap in order.
Now, the problem seems to be that while your colours match that of vanilla, their ordering does not! Which is important as - afaik - they get interpreted by the game based on index, not on colour.
You can spot the difference:
View attachment 514104 View attachment 514105

Now tbh I have no idea how that mismatch was introduced, as I know relatively little about this whole thing. Neither do I know how you would revert that error; so my suggestion would be to just copy the vanilla file and start anew from it, just overwriting the copy and thus hopefully keeping the indexed order this time.
One tip: open up the vanilla file and your altered file in Gimp. Just copy from the altered to vanilla, export it, and the index order is restored.
 
Okay, so I believe it is the colourmap.
Opening the file in GIMP, there is a window under /Windows/Dockable Dialogues/Colourmap that shows the current indexed colourmap in order.
Now, the problem seems to be that while your colours match that of vanilla, their ordering does not! Which is important as - afaik - they get interpreted by the game based on index, not on colour.
You can spot the difference:
View attachment 514104 View attachment 514105

Now tbh I have no idea how that mismatch was introduced, as I know relatively little about this whole thing. Neither do I know how you would revert that error; so my suggestion would be to just copy the vanilla file and start anew from it, just overwriting the copy and thus hopefully keeping the indexed order this time.
Welp, it appears the problem was paint.net.
I downloaded GIMP and it works fine.
At least we got to see a cool bug.
20190922192253_1.jpg

Thank you for all your help.