Stellaris

Stellaris

97 ratings
[Deprecated] Leader Traits: Enhanced Randomisation
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
327.374 KB
21 Jul, 2021 @ 6:41pm
9 May, 2023 @ 2:45pm
14 Change Notes ( view )

Subscribe to download
[Deprecated] Leader Traits: Enhanced Randomisation

In 1 collection by corsairmarks
Corsair's Stellaris Mods
57 items
Description
DEPRECATED: Due to the changes in Stellaris version 3.8 "Gemini" to how leaders gain traits (and trait "levels") as they level up, this mod is no longer applicable. It has been discontinued.

Overview
Frustrated that some leader traits can't be gained on level-up? Or maybe you'd like your robotic/synthetic leaders to use the machine-specific traits too? Then this mod is for you!

The code in this mod polishes some of the code from the base game to work better and offer options that may have been forgotten when new traits were added or systems were redesigned.

Changes
  • Removes invalid/inappropriate/already-extant traits from the pool when rolling
  • Refers to the leader itself or its species instead of assuming based on empire (this could sometimes result in incorrect traits being applied)
  • Handles machine trait alternatives better in code
  • Machine/robot leaders get machine traits where there are equivalents to the "normal" traits
  • Machine/robot admirals can now gain a Restore Point (this built-in trait was not coded to be randomly added but had a small chance to appear when leaders were initially generated)
  • Machine/robot leaders have lifespan-altering traits removed (they are immortal)
  • Scientists can now get a Sapient AI Assistant on level-up if the correct technology is unlocked
  • Code for adding random traits generally respects the "opposites" blocks of each trait, except that scientists are not limited to only one scientific expertise (scientists could already have multiple expertises in the base game, despite the opposites block on all of the traits)
  • Governors can roll Agrarian Upbringing, Bureaucrat (or equivalent), or army/navy related traits upon level up - this make a bit less narrative sense for Agrarian Upbringing and the former military traits, but I felt it was unfair to lock their benefits to only newly generated leaders
  • Rulers can now roll "Space Miner," "From the Ranks," and "Reformer" - the army related trait makes less narrative sense to add randomly, but politicians can definitely become reformers during their tenure
  • English localisation to change the descriptions for traits that sounded odd when randomly added after a leader was spawned, including their descriptions:
    • Agrarian Upbringing is now Agrarian Affinity
    • Army Veteran is now Military Liaison
    • Retired Fleet Officer is now Naval Liaison
    • From the Ranks wasn't renamed - I felt the name fit the effect very well - maybe it can be justified as leader's military experience becoming more widely known?
  • Leaders now gain the regular and "ruler" version of generic traits (+/-experience, +/-lifespan, Arrested Development) (and if they gain one while being a ruler, it transfers back to their regular class)
  • Leaders that have "ruler" generic traits (invisible until a leader becomes a ruler) have it/them removed and rerolled to another non-generic trait - together with the above point, this will help leaders always benefit from their generic traits when they are rulers (e.g. not losing Resilient and then dying)
  • Leaders with opposing traits, e.g. Adaptable and Stubborn, will have the negative trait removed (this mod should no longer roll them at all, so this fix is for any existing leaders you have)
Optional feature (defaults to disabled): Leaders will have a higher chance to gain traits related to their current role. This feature is experimental and only applies to scientists at present. Enable or disable by running this command on the console: event better_leader_trait_randomization.3. Check the status with trigger is_leader_trait_role_weight_enabled = yes (showing a green checkmark indicates the feature is enabled, a red x is disabled).

Compatibility
Built for Stellaris version 3.7 "Canis Minor." Not compatible with achievements.

Most of this mod is custom code, but it does replace two small parts of the base game's code. First, it preempts the event leader.20 that is responsible for triggering leader level-up trait randomisation. Notably this was one of the two places that restricted researching scientists from being able to gain traits. Second, it replaces the effect add_random_leader_trait that does the actual randomisation.

What all this means to you is that this mod will be widely compatible with other mods, as long as they do not also affect these two narrow areas.

When to Install
This mod can be safely added to or removed from your savegame after the game has started. It is implemented through events, effects, and triggers without adding or removing gameplay objects. If you remove it, you will keep any leaders and their existing traits, but further leaders and leader level-ups will use the default code. Back up your savegame before trying to remove a mod.

Recommended Companion Mods
Like leaders? Try a couple of my other leader-related mods that work with this one.
Known Issues
This mod overwrites one effect and preempts one event from the base game. Expect to see two lines in error.log like this:
[15:38:58][game_singleobjectdatabase.h:165]: Object with key: add_random_leader_trait already exists, using the one at file: common/scripted_effects/better_leader_trait_randomisation_scripted_effect_overrides.txt line: 2 [15:38:59][eventmanager.cpp:368]: an event with id [leader.20] already exists! file: events/leader_events_1.txt line: 950
What this means to you is that this mod will need a compatibility patch to work with other mods that alter the same base Stellaris content.

Changelog
See Change Notes

Source Code
Hosted on GitHub[github.com]

[discord.gg]
23 Comments
Winterwolf 20 Nov, 2023 @ 10:43pm 
Thank you for the mod & thanks for adding the deprecated tag as it makes life just a little easier for returning players.
corsairmarks  [author] 10 May, 2023 @ 1:25pm 
@Hagamablabla Thanks! This one is all done - since we choose leader traits now.
Hagamablabla 10 May, 2023 @ 5:39am 
Thank you for your work on this mod for these past few years.
corsairmarks  [author] 25 Apr, 2023 @ 11:54pm 
With the upcoming new DLC "Galactic Paragons" as part of patch 3.8 "Gemini," I anticipate this mod will need significant adjustments.
Westrian 6 Mar, 2023 @ 6:39am 
thanks for the update, one of the things that was annoying me the most was the sheer amount of leaders that got the trait when i rarely do it
corsairmarks  [author] 15 Dec, 2022 @ 4:53am 
All updated for 3.6 "Orion" - just a minor tweaks to randomise the new scientist trait Mindful. Also i did some code cleanup and refactoring but the functionality otherwise stayed the same.
corsairmarks  [author] 11 Dec, 2022 @ 5:44pm 
@aanikron Not yet, but I am working on updates to all my mods for 3.5/3.6
aanikron 10 Dec, 2022 @ 8:37am 
Heya, does this mod need an update for the current version?
Peter34 4 May, 2022 @ 2:33am 
Okay.
corsairmarks  [author] 3 May, 2022 @ 12:13pm 
@Peter34 - This mod does not alter Agendas, so it's not from this mod. I've had that happen before myself - I believe it's an oversight in the Agenda's code.