• 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.

Shiny Dog

Colonel
65 Badges
Sep 12, 2016
997
1.653
  • Crusader Kings II: Charlemagne
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Shadowrun: Hong Kong
  • Hearts of Iron 4: Arms Against Tyranny
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Europa Universalis IV: Rule Britannia
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Hearts of Iron IV: La Resistance
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Battle for Bosporus
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: By Blood Alone
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: Colonel
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Stellaris
  • Hearts of Iron IV: Death or Dishonor
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
I want to make a character interaction that creates a different event depending on the country that's doing it.
For example: Making a different abdication event for France, the USA, etc.

However, I cannot figure out how to define a country in Character Interaction. The closest I have in Vanilla is the "if {x} else {y}" dichotomy for Abdication depending on whether there's a Revolution or not.
 
Yes, that's basically what you'd do. In the effect (or if you define each interaction by country, then potential), script in an if block then add owner = c:TAG for the trigger. If that doesn't work for the trigger, you could try:
Code:
owner = {
    c:TAG ?= this
}

That form is the more complete check which includes a "safety" in case the country doesn't exist. Then put the effect you want for each country.
 
  • 1
Reactions:
I'm trying to make it like that, but my fiddling either breaks the event for every nation, or Russia doesn't get a unique one.
This is what I have down, and I must admit, I have no idea how to actually code. I'm not sure if I should remove the limit, put something else in, etc.

Code:
effect = {
        if = { limit = {
            owner = { c:RUS ?= this }
            }
            owner = {
                trigger_event = { id = event_RUS popup = yes }
            }
        }
        else = {   
            owner = {
                trigger_event = { id = event.generic popup = yes }
            }
        }
    }
 
Hm, that looks right, so I'm not sure why it wouldn't work.

The other thing you could try is just trigger all of the events and then put the conditions in the event trigger.

That is, if you call an event but the event's trigger doesn't return true, it shouldn't fire (this is done with on_action called events quite a lot).
 
  • 1
Reactions:
Hm, that looks right, so I'm not sure why it wouldn't work.

The other thing you could try is just trigger all of the events and then put the conditions in the event trigger.

That is, if you call an event but the event's trigger doesn't return true, it shouldn't fire (this is done with on_action called events quite a lot).
Ugh, I just found out the problem. I decided to troubleshoot it by having it trigger a different event, then I took a stab in the dark. I guess this is my fault because you might've noticed the problem if I used the actual name... but it's uh... it's a meme mod. The dedication of flavoring it to every tag will be part of the meme.

Basically I had the generic event be, for example, "(Event)_A" while the Russian Event was "(Event)_A_RUS" so instead of activating "(Event)_A_RUS" it just pulled "(Event)_A." Since it did this, I thought the "if" statement wasn't working (not recognizing if you're RUS) but instead it went "RUS? Yes. > Activate (Event)_A."

It's solved now by being "(Event)_RUS."
 
Glad you figured it out. Another thing to consider is that you can set event text by conditions too, so especially if the effects don't change, that might be a better way to vary the event by country.
 
  • 1
Reactions:
Glad you figured it out. Another thing to consider is that you can set event text by conditions too, so especially if the effects don't change, that might be a better way to vary the event by country.
I was planning to initially, but it would've resulted in an absolutely massive single event file where I'd have to if-else for (.t) (.d) (.f) and (.a). Since there's about 40~ Hegemony-Empire tier tags with even more Kingdom-tier ones... that's a lotta space for a misplaced bracket.
 
Looks like I spoke too soon. I didn't notice it before, but now trying it like that just puts the Russian-Flavor decision in every country instead.
 
Post your whole file and I'll see if I can note anything.
 
  • 1
Reactions:
Post your whole file and I'll see if I can note anything.
Thanks. I did say it was a meme though, so sorry about the stupid premise. My goal is to eventually make it so that nearly every tag and several ideology/tag combos have unique text for this event so I can claim that it has "The most flavor."
 

Attachments

  • poop_pants.txt
    610 bytes · Views: 0
It all looks fine, except usually event ids have a .# rather than just the namespace. I don't know if that actually matters or not, but adding a .1 to each of them might help. (Also, always check the error.log for any relevant notes)
 
  • 1
Reactions:
It all looks fine, except usually event ids have a .# rather than just the namespace. I don't know if that actually matters or not, but adding a .1 to each of them might help. (Also, always check the error.log for any relevant notes)
Yeah, checking the log finally revealed what I was doing wrong. I didn't put a namespace in either event file, but instead of completely breaking I think considered "nothing" as the namespace and so it considered the Generic Event to have the same namespace as the Russian event, so it defaulted to the Russian event for some reason.
 
  • 1Like
Reactions: