• 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.

Undead Night Fury

Corporal
21 Badges
Jul 3, 2019
25
0
  • Europa Universalis IV
  • Stellaris: Nemesis
  • Crusader Kings II
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Galaxy Edition
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
hello, I am trying to add an average lifespan for my species of 120 years old and I have got it partly working but it is very buggy, I dont know how to fix it so I decided to come to the forums... is there any way I should be doing this?
 
I assume you're adding it as a trait? Just look at the code for the longevity traits. Otherwise, you'd have to post your code so we could see what has gone wrong.
 
Heres part of the code I attempted, I made other attempts on other parts trying to get it working...
Code:
admiral = {

    can_lead_navy = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_admirals

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = admiral

}



general = {

    can_lead_army = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_generals

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = general

}



scientist = {

    can_research = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_scientists

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = scientist

}



governor = {

    can_govern_planet = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_governors

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = governor

}



ruler = {

    can_rule_empire = yes

    max_trait_points = 2

    default_category = ruler

    leader_age_min = 7

    leader_age_max = 120

}



envoy = {

    can_be_envoy = yes

    default_category = envoy

    assignment_cooldown = 360

}
 
Heres part of the code I attempted, I made other attempts on other parts trying to get it working...
Code:
admiral = {

    can_lead_navy = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_admirals

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = admiral

}



general = {

    can_lead_army = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_generals

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = general

}



scientist = {

    can_research = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_scientists

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = scientist

}



governor = {

    can_govern_planet = yes

    max_trait_points = 1

    leader_age_min = 7

    leader_age_max = 120

    resources = {

        category = leader_governors

        cost = {

            energy = 200

        }

        upkeep = {

            energy = 2

        }

    }



    default_category = governor

}



ruler = {

    can_rule_empire = yes

    max_trait_points = 2

    default_category = ruler

    leader_age_min = 7

    leader_age_max = 120

}



envoy = {

    can_be_envoy = yes

    default_category = envoy

    assignment_cooldown = 360

}
Yeah, the problem there is that leader_age_min and leader_age_max control the minimum and maximum age between which leaders can be recruited, not how long they live. leader_age is the parameter you're looking for that controls how long they live: it's added (or subrtracted if you make it negative) to the base lifespan of (I believe) 80 years. I don't think you'll be able to define it from leader types, pretty sure you'll have to use a species trait.
 
Yeah, the problem there is that leader_age_min and leader_age_max control the minimum and maximum age between which leaders can be recruited, not how long they live. leader_age is the parameter you're looking for that controls how long they live: it's added (or subrtracted if you make it negative) to the base lifespan of (I believe) 80 years. I don't think you'll be able to define it from leader types, pretty sure you'll have to use a species trait.
well thats good because the entire species are supposed to be 120, this was just the only way I found that does it... where do I go to add that command for it to work?
 
ok I figured out how to add the lifespan the only issue is how to make the trait required, automatically added and cannot be removed...
Well, the way to make it unable to be removed is to add
Code:
modification = no
into the trait.

As for making it required, I don't know how you're setting it up. If it's as an origin, then you just add:
Code:
traits = {
    trait = trait_trait_name
}
to the origin you've scripted.
 
the way I am trying to set it up is that there is no way to change it the starter lifespan is 120 years and can only be changed by the usual technologies that lengthen the natural lifespan of the species... I didnt want to use traits because it allows the option to not have that which screws everything since it creates the possible bug of having a leader spawn over the age of 80 which means it has a high chance of death so the lifespan must start out at 120
 
I'm not quite sure I get what you're saying but you can also add leader_age_min and leader_age_max to traits (that's why Hive Minds spawn leaders between 10-20 years old while regular empires spawn them at 30-40ish).