Stellaris

Stellaris

Hydra's Universal Compatibility Patch
 This topic has been pinned, so it's probably important
kroun  [developer] 15 Dec, 2024 @ 4:36pm
How to use this mod
This mod contains inline scripts that handle requirements(potential/possible) for your civics and origins with regards to content from other mods (The target mod). When the target mod is disabled, the requirements that contain contents from that mod won't show up in text, nor effect, ensuring compatibility without one mod having to overwrite the civic or origin.

This mod also contains pre-assembled triggers, which are inline scripts that contain broader categories of triggers. These are maintained by me, and as such simplifies the process of ensuring compatibility for you. You can learn more about them Here.

To require a specific ethic, use Hydra_requires_ethic
Format like so: (Ecocentric from Bug Branch used for this example)

inline_script = { script = comptriggers/Hydra_requires_ethics HAS_MOD = @has_bug_branch GATE = nor ETHIC = ecocentric }

- HAS_MOD is the scripted variable used to check if the target mod is installed/enabled
- GATE is the logic gate. Only OR or NOR are useful here.
- ETHIC is the modded ethic

This can be placed inside either the ethics block of a civic:

MC_Hydra_civic_fossil_fuels = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness } } authority = { NOT = { value = auth_corporate } } } possible = { origin = { NOT = { value = origin_life_seeded } } civics = { NOR = { value = civic_agrarian_idyll value = civic_environmentalist } } ethics = { inline_script = { script = comptriggers/Hydra_requires_ethics HAS_MOD = @has_bug_branch GATE = nor ETHIC = ecocentric } } } modifier = { planet_technician_energy_produces_add = 2 pop_environment_tolerance = -0.25 } random_weight = { base = 1 } ai_weight = { base = 1 } }

In this example, the civic MC_Hydra_civic_fossil_fuels will be pickable by empires of any ethic during normal gameplay, but if Bug Branch is installed it will require the empire to not be any degree of ecocentric.

To require the empire to be ecocentric, use "or" in GATE
Do note that while "and" is also possible to use in gate, it is not recommended as it simply locks the civic to empires who has both the fanatic and normal version of the specified ethic.

To require a specific ethic, civic, origin or authority, use the following format (the fossil fuels civic from Hydra's More Civics used for this example):

inline_script = { script = comptriggers/Hydra_requires_specific_item HAS_MOD = @has_mc_hydra ITEM = ethic_ecocentric }

- HAS_MOD is the scripted variable used to check if the mod is installed/enabled
- ITEM is the modded ethic/civic/authority/origin

This can be placed inside the ethic, civic, origin or authority blocks of a civic, origin or authority
It can also be placed inside OR, AND, NOR, as well as NOT blocks inside these blocks.

Example, using the civic "Desolators" from Forgotten History:

civic_desolators = { description = "civic_desolators_effects" potential = { ethics = { NOT = { value = ethic_gestalt_consciousness } } authority = { NOT = { value = auth_corporate } } } possible = { ethics = { OR = { text = civic_tooltip_militarist value = ethic_fanatic_militarist value = ethic_militarist } } civics = { NOR = { value = civic_environmentalist inline_script = { script = comptriggers/Hydra_requires_specific_item HAS_MOD = @has_bug_branch ITEM = civic_bugged_keepers_of_harmony } } inline_script = { script = comptriggers/Hydra_requires_specific_item HAS_MOD = @has_mc_hydra ITEM = MC_Hydra_civic_ambush } } } random_weight = { base = 2 } }

In this example, the desolators civic can only be picked by empires that are militaristic and do not have the environmentalist civic.
Additionally, if Bug Branch is installed, the keepers of harmony civic is also not allowed, and if Hydra's More Civics is installed, then the ambushers civic is requires to take this civic.

Important!
You need to have a scripted variable from the mod you want to use items from (The target mod) that can be used to check if the mod is installed/enabled.
Most big mods have these, but if the mod does not, you have to ask the mod author to make one.
They are very easy to make, and very useful.

Your own mod (Unless the target mod is supported by this (List can be found in scripted_variables in this mod)) needs a placeholder for this variable equalling 0.

If you don't already have a placeholder, simply make a txt file in common\scripted_variables named zzz_yourmodsname_scripted_variables and include the scripted variable from that mod, usually named @has_xx, where xx is the mod's name or acronym. Set it to 0. (Bug Branch used as example.

@has_bug_branch = 0

It is suggested you make one for your own mod as well, in case other people want to use your mods items in their own items requirements.

To make one, simply make a txt file in common\scripted_variables named !!!_yourmodsname_scripted_variables.txt and include the following line (replace xx with your mod's acronym or the name of your mod):

@has_xx = 1

Conditional Modifiers


To make a trait gain a modifier if a specific mod is enabled, use Hydra_conditional_modifier
inline_script = { script = comptriggers/Hydra_conditional_modifier HAS_MOD = @has_FHMP MODIFIER = army_ NUMBER = 0.1 }
HAS_MOD is the scripted variable used to check if the mod is installed/enabled
MODIFIER is the modifier you want to use
NUMBER is the modifier's strength

This can be placed inside the modifier or triggered_modifier block of a trait
trait_MST_flexible = { cost = 1 category = normal species_possible_add = { can_add_genetic_traits = yes } species_possible_remove = { can_remove_beneficial_genetic_traits = yes } species_possible_merge_remove = { always = yes } potential_crossbreeding_chance = 1.0 1.0 = 100% chance of being considered for new traits when forming half-species. does not guarantee the trait will be added if it costs points. allowed_archetypes = { BIOLOGICAL LITHOID } icon = "gfx/interface/icons/traits/trait_MST_flexible.dds" modifier = { pop_demotion_time_mult = -0.5 inline_script = { script = comptriggers/Hydra_conditional_modifier HAS_MOD = @HAS_MT MODIFIER = pop_happiness NUMBER = 0.2 } } slave_cost = { energy = 500 } opposites = { "trait_invasive" } }
In this example, the trait gives -50% pop demotion time, but if More Traditions is installed, pops with this trait will additionally gain 20% happiness
Last edited by kroun; 19 Dec, 2024 @ 3:48am