• 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.
Showing developer posts only. Show all posts in this thread.
Anyone know how to create customized "death_reason" code? I've been told we can customize them now, but I saw no mention how that's done.
common/death
You define the code, whether it is violent or not which means if there is no set sound then a random violent one will be chosen, the description, if it can have no killer and then a sound list, if a murder then whether the murder is unknown (make two copies of it one unknown one not like vanilla does), whether it is an execution or not which means it will be used when you execute someone (if you do make it an execution you then need to go into common/execution_methods and add it there with a trigger and weighting as well). The vanilla file also tells you to add any new death reasons into the appropriate scripted triggers which I would also advise doing.
 
  • 1
Reactions:
I feel like I'm close, but something isn't tying together correctly. I just want to confirm, so in the fields that say things like long_desc = "DEATH_SACRIFICED", am I replacing that DEATH_SACRIFICED field with my own entry, or is that a hardcoded entry I'm not allowed to touch? I think I'm supposed to leave it alone. Right now the game is saying "Was sacrificed to the gods by unknown." What am I missing here? Right now I have:

Localisation:
death_sacrificed_lilith = Sacrificed by Lilith for failing his birth trial. x

00_scripted_triggers:
death_sacrificed_trigger = {
OR = {
death_reason = death_sacrificed
death_reason = death_sacrificed_norse
death_reason = death_sacrificed_ancestors
death_reason = death_sacrificed_lilith # Failed his birth trial and was sacrificed to Lilith.
}​
}

lilith_deaths.txt
death_sacrificed_lilith = {
long_desc = "DEATH_SACRIFICED"​
}

lilith_birth_events.txt:
FROM = { death = { death_reason = death_sacrificed_lilith } }
You need to give it your own long desc as that is what displays when you hover over the skull, the coded entry is not something localised
 
  • 1
Reactions:
Anyone know how to modify the game rules? Nothing in the game rules folder seems changeable.
Everything in the game rules folder is changeable, the update that fixed the bug with them came out a few hours ago. Make sure your ck2 is up to date on 2.6.1.1
 
I am struggling to get a small project onto Steam Workshop. Going into the content menu, I can see the mod just fine among the listed mods, but when I press 'manage' and then 'publish' absolutely jack squat happens. Nothing gets uploaded, there's no notifications, and the game doesn't even tell me why this isn't working.

I'm using a regular folder for the mod, unzipped and unarchived, in Paradox Interactive\Crusader Kings II\mod, which is how it's supposed to be, right? I've provided a picture entry and a tag entry in the .mod file, too. I don't know what's up and why it isn't publishing.
 
I wonder if someone could clear something up for me please. With event modding you're able to give a single event multiple description texts 'DESC', by adding triggers to these.
My question is, is it possible to do the same with the 'GFX_evt' picture?

Thanks in advance
Yep, although you also do it in the triggered description however you can choose to not add a new description each time.
Code:
desc = {
    picture = GFX_YOUR_PIC
    trigger = { <conditions> }
}
 
  • 1
Reactions:
When you create the character, instead of the flag, give him a trait with cached = yes and the attribute that hides the trait (hidden_from_others = yes, I think). then you can use <your trait name> = {} as a scope for that character.
Hidden from others only hides it from people who don't also have the same trait so just hidden = yes will hide it from everyone, minor difference but might be important for those with all of that OCD.
As for using a cached trait, you could just save the character as an event target in new_character instead of adding a cached trait
 
Yes, I didn't suggest that only in case it wasn't within the same event chain (but then, he could also use a global event target, you'd be right on that).

With respect to cached traits, the wiki say "it should be a limited number". What does that mean? Is there a hard limit in how many cached traits the game can handle?

And on another question, when are government potential evaluated? I made a custom "courtier" government, and want the normal governments to apply to landed characters, and my new government to apply to unlanded courtiers, but still, generated characters seem to be ignoring my potential clause (courtiers seems to be generated with the government of their host no matter what).
Limited number I think just means don't have too many of them, no actual hard limit from what I know
 
If you have three traits with health = 1, -2, 2, the benefit will be +1 health with all of them. With health_penalty, the excessive positive health has no effect, leaving you at +0 health with all three traits.
Wait what?
So if you have a trait with health_penalty it negates any health bonuses from other traits you may have? That can't be true as there is also stat penalties and having an illness trait doesn't negate all your other traits stat bonuses.
I think I might have misunderstood you here
 
No. The ceiling of the sum of all health_penalty traits is 0. (The sum of all health_penalty bonuses/maluses is adjusted to 0 if the sum is positive.) It does not affect other health bonuses (health = x rather than health_penalty = x.) Same goes for other stats.
Oh ok I think I get you, so if I have health_penalty = -3 and then health_penalty = 4 they will total out to be +1 but it will be taken as just 0. The health = 2 or health = -1 is completely separate from it?
 
Hey dude, I followed what your code but I'm having problems. The pictures don't show, am I missing something?
Also I'm currently writing in 2.4.5, not sure if that is a contributing factor. I enclosed an example of my work, though I have written quite a few other events with multiple pictures and different conditions (mainly flags), yet none seem to work.

Code:
narrative_event = {
    id = "quest.53"
    title = "EVTTITLEquest.53" # Choose Your Path
    desc = "EVTDESCquest.53" # Four roads lie before you...
  
    is_triggered_only = yes
  
    desc = {
        picture = GFX_evt_path_spring
        trigger = {
            month = 2
            NOT = { month = 5 }
        }
    }
    desc = {
        picture = GFX_evt_path_summer
        trigger = {
            month = 5
            NOT = { month = 8 }
        }
    }
    desc = {
        picture = GFX_evt_path_autumn
        trigger = {
            month = 8
            NOT = { month = 11 }
        }
    }
    desc = {
        picture = GFX_evt_path_winter
        trigger = {
            month = 11
            NOT = { month = 2 }
        }
    }
  
    option = {
        name ="EVTOPTAquest.53" # Go North
        trigger = { NOT = { has_character_flag = go_north_quest } }
        set_character_flag = go_north_quest
        narrative_event = { id = quest.54 days = 60 random = 30 }
    }
    option = {
        name ="EVTOPTBquest.53" # Go East
        trigger = { NOT = { has_character_flag = go_east_quest } }
        set_character_flag = go_east_quest
        narrative_event = { id = quest.55 days = 60 random = 30 }
    }
    option = {
        name ="EVTOPTCquest.53" # Go South
        trigger = { NOT = { has_character_flag = go_south_quest } }
        set_character_flag = go_south_quest
        narrative_event = { id = quest.56 days = 60 random = 30 }
    }
    option = {
        name ="EVTOPTDquest.53" # Go West
        trigger = { NOT = { has_character_flag = go_west_quest } }
        set_character_flag = go_west_quest
        narrative_event = { id = quest.57 days = 60 random = 30 }
    }
}
I am pretty sure it doesn't work on 2.4.5, I think it is a feature from 2.5 onward as it was definitely in some of the Conclave events
 
Some misunderstandings with the "save_event_target_as"-command:

PHP:
father_of_unborn = {
  save_event_target_as = target_adulterer
}

So I have saved the target, howto adress it? Like "death= event_target", or "death= target_adulterer"?
event_target:<your_event_target>
 
So the next command will get the saved event target, not longer the originally event receiver?
No, whenever you would want to scope to your event target you use the scope "event_target:<your_event_target>" instead of something like ROOT or FROM
 
  • 1
Reactions:
I'm trying to set up a bunch of random events, but my random_list isn't working properly. I don't want an event in it to fire more than once every 2 years, so I use a had_character_flag condition with a factor = 0 to make that happen, but it keeps firing again and again. This is the code for the random_list:
Code:
 random_list = {
   5 = {                                                                         ### Ambushed by brigands
      modifier = {
         factor = 0                     
         had_character_flag = {
            flag = ambushed_by_brigands
            days = 730                        # same event shouldn't fire for 2 yrs
         }                 
       }
       character_event = { id = adventuring.2  days = 7 random = 30 }
   }                                                                         
   1 = { character_event = { id = adventuring.1  days = 30 random = 10 } }        ### Cycle back to same event
}
I have set up the bit with adding and clearing flags properly, so that shouldn't be the issue. Or do character_flags have to be in effect for a certain length of time (I add them and then clear them in events that fire right after one another)?

Any help would be appreciated.
had_character_flag trigger only returns true if you've actually had the character flag for 730 days.
Code:
modifier = {
    factor = 0
    has_character_flag = ambushed_by_brigands # If you have the flag
    NOT = {
        had_character_flag = { # AND you haven't had it for 2 years.
            flag = ambushed_by_brigands
            days = 730
        }
    }    # Then this complete trigger will return true giving this
         # random_list entry a weight of 0.
}
Another way to handle it is just to use the trigger has_character_flag and let your ambush event fire a hidden delayed event 2 years later that clears the character flag.
 
Utterly confused: In modding plots, what is the difference between the "target_potential" - block and the "allow" - block? I can't figure it out in the WIKI, perhaps someone knows more ...

Code:
  # Target scope
    target_potential = {
              is_rival = FROM
    }

        allow = {
               is_rival = FROM
    }

Have you put cached = yes inside the trait definitions you want to use this way?

The "character" trigger ought to accept numerals for character ID.

Looking at vanilla examples, target_potential is used to exclude characters that would be targets of other, similar plots, and allow to cover other conditions, but perhaps @Divine will be able to explain better (and perhaps explain the differences between the various plot types and flags, as I don't think we've been able to figure those out completely on our own.)
First off iirc they have different scopes. target_potential : ROOT = target, FROM = plotter, allow : ROOT = plotter, FROM = target.
Also if the potential trigger fails the plot will not show in the interface, however if the potential trigger succeeds then the plot would either be grayed out if it's not allowed or be click-able if the allow also succeeds.

About the different types of plots. It's kind of a combination of the targeted_decisions filters and defining the target and in extension also having a different scope in the various triggers and effects.
 
Could you confirm wether the behaviour of cached traits has changed? cached traits used to scope to all its holders, but now it seem to scope to a random one.
(Also, is it intended that it can scope to dead holders of the trait?)
There doesn't seem to have been any recent changes to it.
I think it might be some confusion due to the interesting thing that the trigger "<trait> = { }" will go through all of the characters and return true if any trait holder fulfills the conditions. So the trigger is functionally a "any_" trigger. While the effect "<trait> = { } will pick out a random trait holder and run the effects.

I ended up using two custom tooltips in a single event option problem is it prints the second one out right at the end of the first one, no new line or space in between. Any way to force a new line?
Try to use backslash + n, "\n", where you want a newline.
 
  • 1
Reactions:
So i have tried to add a opinion modifier to a event option. the end result should be members of a faction getting a opinion bonus with vassals when a civil war begins it does not seem to be working can someone help

Here is the relevant code from the file plot_events
option = {
name = "EVTOPTB8005"
opinion = {
modifier = opinion_rebellove
who = any_faction_backer
months = 12
}
ai_chanc.....

Here is the relevant code from opinion modifiers
opinion_rebellove = {
vassal_opinion = 35
}
That is not how scopes work, the RHS of a who = for opinion modifiers needs to be ROOT, FROM, PREV or an event target. So what you want to do is something like:
Code:
any_plot_backer = {
    ROOT = {
        opinion = {   
            modifier = opinion_rebellove
            who = PREV
            months = 12
        }
    }
}
Also opinion modifiers do not take any value other than opinion = int, as you are selecting who to apply the opinion modifier to.
Your modifier should be:
Code:
opinion_rebellove = {
    opinion = 35
}
 
But there must be a graphics file somewhere from EU4 or the converter that could be used as a source? #totalnoobtographicsmods
The graphics would be in the EU4 game files. But you cannot use content from one paradox game in a mod for another if there is no way of making sure people who use your mod also have access to the game you got the content from, which for the graphics idea would be the case, that is one of the user mod rules
 
That trigger is probably unneeded.

Your best bet is to write 2 targetted decisions (then you won't even need the console). Make them so AI can't use them. One would send this event to the character you use the decision on. The other would send this event to anybody matching the dynasty of the character you use the decision on, with 'any_character = { limit = { dynasty =ROOT } character_event = { id = 25000 } }'.
Or just any_dynasty_member as any_character is a very intensive scope
 
  • 1
Reactions:
I'm having problems with some of my events. All of the events trigger each other appropriately, as far as I can tell. When I use event X they all show up correctly, but when the initiator event fires it is followed by 4 other blank events. Validator isn't giving any errors for the

Code:
namespace = HKC

character_event = {
   id = HKC.0
   desc = "DESC_HKC.0"
   picture = GFX_evt_castle_garden
 
   min_age = 16
   capable_only = yes
   prisoner = no
   ai = no

   option = {
       name = "HKC0A"
       prestige = -20
       hidden_tooltip = {
           random_list = {
               25 = {
               FROM = { character_event = { id = HKC.1 } #it stayed }
               }
               75 = {
               FROM = { character_event = { id = HKC.2 } #it stayed }
               }
           } 
       }
   }
 
   option = {
       name = "HKC0B" #Approach
       limit = { NOR = { trait = craven
                           trait = paranoid
       } }
       prestige = 20
       hidden_tooltip = {
           FROM = { character_event = { id = HKC.3 } #it stayed }
       }
   }
 
   option = {
       name = "HKC0C" #it's nothing
   }
}
character_event = { #garden twili
   id = HKC.1
   desc = "DESC_HKC.1"
   picture = GFX_evt_castle_garden
 
   is_triggered_only = yes

   option = {
       name = "HKC1A"#imprison
       prestige = 20
       random_list = {
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = no
               dynasty = random
               age = 16
               trait = race_twili
               trait = curse_imp
               imprison = yes
               }
               new_character = { imprison = yes }
           }
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = yes
               dynasty = random
               age = 16
               trait = race_twili
               trait = curse_imp
               imprison = yes
               }
               new_character = { imprison = yes }
           }
       }
   }
 
   option = {
       name = "HKC1B" #offer shelter
       prestige = 20
       limit = { NOT = { trait = paranoid } }
       random = {
           chance = 25
         
           add_trait = kind
           hidden_tooltip = {
               FROM = {    character_event = {   id = 38268 #kind} }
           }
       }
       random_list = {
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = no
               dynasty = NONE
               age = 16
               trait = race_twili
               trait = curse_imp
               }
           }
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = yes
               dynasty = NONE
               age = 16
               trait = race_twili
               trait = curse_imp
               }
           }
       }
   }
 
   option = {
       name = "HKC1C" #off with it's head
       limit = { NOT = { trait = kind } }
       random = {
           chance = 50
         
           add_trait = cruel
           hidden_tooltip = {
               FROM = { character_event = { id = 38259 #cruel   } }
           }
       }
   }
}
character_event = { #garden twili
   id = HKC.2
   desc = "DESC_HKC.2"
   picture = GFX_evt_castle_garden
 
   is_triggered_only = yes
 
   option = {
       name = "HKC0C" #it got away
   }
}

character_event = { #garden twili
   id = HKC.3
   desc = "DESC_HKC.3"
   picture = GFX_evt_castle_garden
 
   is_triggered_only = yes

   option = {
       name = "HKC0A"#GUARDS
       prestige = -20
       hidden_tooltip = {
           random_list = {
               75 = {
                   FROM = {  character_event = { id = HKC.4 } }
               }
               25 = {
               FROM = {    character_event = { id = HKC.2 }}
               }
           } 
       }
   }
 
   option = {
       name = "HKC3B" #offer shelter
       prestige = 20
       limit = { NOT = { trait = paranoid } }
       random = {
           chance = 25
         
           add_trait = kind
           hidden_tooltip = {
           FROM = { character_event = { id = 38268 #kind}   }
       }
       create_character = {
           culture = twili
           religion = sol_religion
           random_traits = yes
           dynasty = NONE
           age = 16
           trait = race_twili
           trait = curse_imp
       }
   }
 
   option = {
       name = "HKC3C" #off with it's head
       limit = { NOT = { trait = kind } }
       random = {
           chance = 50
         
           add_trait = cruel
           hidden_tooltip = {
           FROM = {    character_event = {   id = 38259 #cruel   } }
           }
       }
   }
}
character_event = { #garden twili
   id = HKC.4
   desc = "DESC_HKC.4"
   picture = GFX_evt_castle_garden
 
   is_triggered_only = yes

   option = {
       name = "HKC1A"#imprison
       random_list = {
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = no
               dynasty = random
               age = 16
               trait = race_twili
               trait = curse_imp
               imprison = yes
               }
               new_character = { imprison = yes }
           }
           50 = {
               create_character = {
               culture = twili
               religion = sol_religion
               random_traits = yes
               female = yes
               dynasty = random
               age = 16
               trait = race_twili
               trait = curse_imp
               imprison = yes
               }
               new_character = { imprison = yes }
           }
       }
   }
 
   option = {
       name = "HKC1C" #execute
       prestige = 20
       hidden_tooltip = {
       }
   }
}
Your #it stayed or kind or cruel etc are done before the brackets are closed
So where you have FROM = { character_event = { id = HKC.1 } #it stayed } the engine only reads FROM = { character_event = { id = HKC.1 } which is missing the closing bracket as your # comments out the rest of the code, your comments need to always be at the end of a line so as not to block any other pieces of code out so do FROM = { character_event = { id = HKC.1 } } #it stayed
 
  • 2
Reactions: