So I came back to modding Stellaris after a break, and I'm running into an issue that is giving me a headache.
I want to make a species that has a custom archetype so I can control the number of trait picks and trait points, but still have upkeep.
From what I currently know about Species modding, trait points and picks are determined by the species archetype.
The problem is if I make a custom species with a new archetype and tell the species class to inherit traits from BIOLOGICAL, it creates a species that is completely functional except it has no food upkeep (or minerals).
So I went digging on how to fix it.
My initial plan, to maximize mod compatibility and over-write as LITTLE of base code as possible, was to create a new 0-cost trait that all my species would have mandatory, and all it would do is have a 1 food upkeep. I remembered that there are traits that do this, namely Cyborg traits, so I went looking for how "Power Intensive" adds energy upkeep.
common/traits/10_species_traits_cyborg.txt
...nothing, it does quite literally nothing.
So I then searched for how Radiotrophic works, because maybe this was a weird fluke.
common/traits/04_species_traits.txt
Also nothing, but it says something about "inline_script", so I went searching through the code for whatever this is. Nothing in the code is called "traits/radiotrophic_effects", but I DID find something in the triggers for having the radiotrophic trait:
common/scripted_triggers/00_scripted_triggers.txt
My next step was to search for "has_food_upkeep", since that was more or less my original goal. I found very little, as it turns out, but I did find what almost looks like something I was looking for:
common/inline_scripts/pop_categories/regular_upkeep.txt
I thought I had finally figured it out, exactly what sub-folder to put a custom file containing a custom upkeep for a species archetype.
Wrong I was. I copied this folder format precisely in my species test mod, except changed the name of the text file (over-writing bad) and it contained the following:
Of course it doesn't work.
I've tried a couple of variations, such as over-writing the exact named files, and I can't seem to get anything to add a food upkeep to a custom species.
I'm concerned that I am trying to do the impossible here.
Has anyone made a species mod that successfully has a custom archetype and appropriate food upkeep?
Am I looking in the wrong place? Is there a far simpler sollution, like adding an upkeep line to archetypes directly?
Am I doing everything right and I've run into a bug?
Am I doing everything right and I have probably been the one to make an error and typo somewhere that I've missed?
I want to make a species that has a custom archetype so I can control the number of trait picks and trait points, but still have upkeep.
From what I currently know about Species modding, trait points and picks are determined by the species archetype.
The problem is if I make a custom species with a new archetype and tell the species class to inherit traits from BIOLOGICAL, it creates a species that is completely functional except it has no food upkeep (or minerals).
So I went digging on how to fix it.
My initial plan, to maximize mod compatibility and over-write as LITTLE of base code as possible, was to create a new 0-cost trait that all my species would have mandatory, and all it would do is have a 1 food upkeep. I remembered that there are traits that do this, namely Cyborg traits, so I went looking for how "Power Intensive" adds energy upkeep.
common/traits/10_species_traits_cyborg.txt
Code:
trait_cyborg_power_intensive = {
cost = -1
opposites = { }
allowed_archetypes = { BIOLOGICAL LITHOID }
initial = no
species_potential_add = {
can_add_cybernetic_traits = yes
}
species_possible_remove = {
can_remove_cybernetic_traits = yes
}
randomized = no
custom_tooltip = TRAIT_POWER_INTENSIVE_EFFECT
slave_cost = {
energy = -250
}
}
...nothing, it does quite literally nothing.
So I then searched for how Radiotrophic works, because maybe this was a weird fluke.
common/traits/04_species_traits.txt
Code:
trait_plantoid_radiotrophic = {
host_has_dlc = "Plantoids Species Pack"
cost = 2
species_possible_remove = {
can_remove_beneficial_genetic_traits = yes
}
species_possible_merge_remove = {
always = yes
}
potential_crossbreeding_chance = 1.0
opposites = { "trait_plantoid_phototrophic" "trait_lithoid_radiotrophic" "trait_advanced_phototrophic" "trait_advanced_radiotrophic" "trait_harvested_radiotrophic" "trait_voidling" }
allowed_archetypes = { BIOLOGICAL }
species_class = { PLANT FUN }
custom_tooltip = TRAIT_PLANTOID_RADIOTROPHIC_EFFECT
inline_script = "traits/radiotrophic_effects"
}
Also nothing, but it says something about "inline_script", so I went searching through the code for whatever this is. Nothing in the code is called "traits/radiotrophic_effects", but I DID find something in the triggers for having the radiotrophic trait:
common/scripted_triggers/00_scripted_triggers.txt
Code:
is_phototrophic = {
OR = {
has_trait = trait_plantoid_phototrophic
has_trait = trait_plantoid_radiotrophic
has_trait = trait_advanced_phototrophic
has_trait = trait_advanced_radiotrophic
has_trait = trait_harvested_radiotrophic
has_trait = trait_lithoid_radiotrophic
}
}
has_phototrophic_energy_upkeep = {
OR = {
has_trait = trait_plantoid_phototrophic
has_trait = trait_advanced_phototrophic
AND = {
OR = {
has_trait = trait_plantoid_radiotrophic
has_trait = trait_advanced_radiotrophic
has_trait = trait_harvested_radiotrophic
has_trait = trait_lithoid_radiotrophic
}
NOT = { planet = { is_planet_class = pc_nuked } }
}
}
}
has_budding_trait = {
OR = {
has_trait = trait_plantoid_budding
has_trait = trait_lithoid_budding
has_trait = trait_advanced_budding
}
}
has_food_upkeep = {
species = {
is_archetype = BIOLOGICAL
}
NOT = { has_trait = trait_voidling }
}
has_mineral_upkeep = {
species = {
is_archetype = LITHOID
}
NOT = { has_trait = trait_voidling }
}
My next step was to search for "has_food_upkeep", since that was more or less my original goal. I found very little, as it turns out, but I did find what almost looks like something I was looking for:
common/inline_scripts/pop_categories/regular_upkeep.txt
Code:
# Food Upkeep
upkeep = {
trigger = {
has_food_upkeep = yes
is_phototrophic = no
}
food = @living_standard_food_normal
}
upkeep = {
trigger = {
has_food_upkeep = yes
is_phototrophic = yes
}
food = @living_standard_phototrophic_normal
}
# Mineral Upkeep
upkeep = {
trigger = {
has_mineral_upkeep = yes
is_phototrophic = no
}
minerals = @living_standard_food_normal
}
upkeep = {
trigger = {
has_mineral_upkeep = yes
is_phototrophic = yes
}
minerals = @living_standard_phototrophic_normal
}
# Energy Upkeep
upkeep = {
trigger = {
has_phototrophic_energy_upkeep = yes
}
energy = @living_standard_phototrophic_normal
}
upkeep = {
trigger = {
has_energy_upkeep = yes
}
energy = @living_standard_energy_normal
}
I thought I had finally figured it out, exactly what sub-folder to put a custom file containing a custom upkeep for a species archetype.
Wrong I was. I copied this folder format precisely in my species test mod, except changed the name of the text file (over-writing bad) and it contained the following:
Code:
#storm_upkeep_biological is a scripted trigger nearly identical to has_food_upkeep, except looks for STORMTEST instead of BIOLOGICAL. Under "common/scripted_triggers/storm_scripted_triggers.txt"
upkeep = {
trigger = {
storm_upkeep_biological = yes
is_phototrophic = no
}
food = 1.0
}
upkeep = {
trigger = {
storm_upkeep_biological = yes
is_phototrophic = yes
}
food = 0.5
}
Of course it doesn't work.
I've tried a couple of variations, such as over-writing the exact named files, and I can't seem to get anything to add a food upkeep to a custom species.
I'm concerned that I am trying to do the impossible here.
Has anyone made a species mod that successfully has a custom archetype and appropriate food upkeep?
Am I looking in the wrong place? Is there a far simpler sollution, like adding an upkeep line to archetypes directly?
Am I doing everything right and I've run into a bug?
Am I doing everything right and I have probably been the one to make an error and typo somewhere that I've missed?