Overview
This mod ensures that your leaders can have every species-based leader trait that their species makes them eligible for. Somehow managed to get a Psionic, Erudite, Cybernetic, Brainslugged species? Now your leaders can have all of the traits together!
Like the default game, this mod does
not guarantee psionic traits for Latent Psionics (instead there is a 20% chance for each leader) or brain slugs (again, 20% chance for each leader). The game includes an event for leaders of a Latent Psionic species randomly gaining the Psionic leader trait, but it was limited to the main species of an empire. That has been altered so any Latent Psionic leaders have a chance to randomly manifest Psionic abilities. Additionally, an event functionally similar has been added for leaders from a species with Brain Slugs to gain the Brain Slug trait.
Governors whose species has the "Numistic Administration" trait gain the "Merchant of Numa" leader trait.
Changes
This mod unifies adding/removing species-based traits for leaders, and it will automatically fire when leaders are spawned (
on_leader_spawned), when a species is modified (
on_modification_complete - including a one-time, independent chance for latent psionics or brainslugs), or when a ruler returns to their previous leader job (
on_ruler_back_to_pre_ruler_class - ensures brainslugged/psionic rulers keep their trait(s) when being demoted). It does not replace the majority of the existing game code for these traits in order to off maximum compatibility with other mods, but it does occasionally result in leaders having their traits in a different order.
The same code is used in each of these three cases (via effects) that do not enforce any requirements other than "does the leader's species have the necessary prerequisite species trait?" So if you've managed to glitch the game into having Psionic Robots, you'll end up with psionic robot leaders.
The original inspiration for me to create this mod was the "Promising Officer" event which rewards admirals with two traits, but none of their appropriate species traits. This seems to occur because the built-in effect to spawn a leader
create_leader completely overwrites any species traits whenever
traits = { } are specified (as in this event
leader.1). Currently, this mod only addresses this one instance, but if you find another place that would benefit from an event-created leader having their species traits added, please leave a comment describing which event.
Compatibility
Built for Stellaris version 3.4 "Cepheus." Not compatible with achievements.
This mod overrides three default events related to adding leader traits:
distar.174 ,
utopia.2508 , and
utopia.2605. Other mods that make changes to any of the same events will conflict with this one.
For
distar.174, the easiest way to resolve the conflict is to comment out or delete the event from this mod, which is in the file
events/000_overridden_leader_species_trait_events.txt. The override is just a cleaner way to add the initial brainslug trait for hireable leaders - the original in-game code will execute in the two places it could be triggered but they have a very low impact.
utopia.2508 is the default event for adding or removing Erudite leader traits. That event uses the effect
remove_leader_traits_after_modification which is also overridden. If you have conflicts with these, it is recommended you keep at least one of the two overrrides from this mod, otherwise you will lose Erudite-based leader traits from leaders that also have another special species trait, any time that
any species in your empire is modified.
utopia.2605 is the event for leaders randomly gaining the Psionic trait from Psionic species. I recommend you use this mod's version of the event in order to benefit from the reduced mean time-to-happen (i.e. happens more frequently) and wider selection criteria (any species with Latent Psionic, not just the owner's main species).
All other the new logic is implemented in standalone events and effects which should not conflict with other mods.
Recommended Companion Mods
Like leaders? Try some of my other leader-related mods that work with this one.
When to Install
This mod can be safely added or removed from your save game after the game has started. It is implemented through custom events and effects without adding gameplay objects. If you remove it, your game will work normally.
Known Issues
Overriding events and effects from the default game causes error logs. Expect to see four lines similar to this in error.log:
[15:38:58][game_singleobjectdatabase.h:147]: Object with key: remove_leader_traits_after_modification already exists, using the one at file: common/scripted_effects/99_leader_species_traits_scripted_effect_overrides.txt line: 2
[15:38:59][eventmanager.cpp:361]: an event with id [distar.174] already exists! file: events/distant_stars_events_1.txt line: 5434
[15:39:00][eventmanager.cpp:361]: an event with id [utopia.2508] already exists! file: events/utopia_on_action_events.txt line: 579
[15:39:00][eventmanager.cpp:361]: an event with id [utopia.2605] already exists! file: events/utopia_on_action_events.txt line: 1493
Changelog
See
Change Notes
Source Code
Hosted on
GitHub
