Scripting issue adding traits to beginning races

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

primem0ver

Major
16 Badges
Jul 15, 2015
563
70
  • Stellaris
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Stellaris: Synthetic Dawn
I am adding several new species trait types that do not work the same as other traits in the game. So I must cycle through all races and add traits that I am adding based on a random list. This method works for the human player as it is not random, but picked by the player in response to a popup at the beginning of the game. I am having an issue with it not recognizing the "name = " line in the following code (this line works fine in a popup option's code.). What am I doing wrong?

NOTE: Functionally, not using the name option seems to work; but I don't want the game to rename the species. This code is placed in a non-specific "event", whereas the popup code is a country event... so that may have something to do with it?

Code:
immediate = {
        every_country = {
            limit = {
                is_ai = yes
            }
            if = {
                limit = {
                    owner_species = { is_species_class = whatever_class }
                }
                random_list = {
                    32 ={
                        every_owned_pop = {
                            limit = {
                                is_same_species = root
                                NOT = { has_trait = some_new_trait }
                            }
                            modify_species = {
                                species = this
                                name = this
                                add_trait = some_new_trait
                            }
                        }
                        change_dominant_species = { species = last_created change_all = yes }
                    }
                   ...
                }
               ...
            }
           ...
        }
        ...
}

This is the error I am getting: name effect at file: events/pmct_start_events.txt line: 45 accepts only yes or no as values


EDIT: I also need a way to add additional trait points (available slots) to the species when I add these traits so that it doesn't affect the number of traits that can be used when gene modification is researched. (My mod lowers the number of starting traits to compensate.)
 
Last edited:

Persepheus

Second Lieutenant
68 Badges
Aug 10, 2016
171
5
  • Stellaris - Path to Destruction bundle
  • Semper Fi
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Darkest Hour
  • Europa Universalis IV: Pre-order
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Monks and Mystics
  • Hearts of Iron IV: Together for Victory
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cradle of Civilization
  • Surviving Mars: Digital Deluxe Edition
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Crusader Kings II: Holy Fury
  • Hearts of Iron IV: La Resistance
  • Stellaris: Nemesis
  • Stellaris: Lithoids
  • Europa Universalis IV: Golden Century
  • Stellaris: Necroids
  • Europa Universalis IV: Dharma
  • Stellaris: Federations
  • Battle for Bosporus
  • Europa Universalis IV
  • Stellaris
  • Victoria 2
  • Europa Universalis 4: Emperor
  • Stellaris: Ancient Relics
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
modify_species doesnt change the name, so you dont need it.
Dont think there is a posibility for trait picks. But if you set the cost to 0, it shouldnt count as a pick.
 

primem0ver

Major
16 Badges
Jul 15, 2015
563
70
  • Stellaris
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Stellaris: Synthetic Dawn
Thanks. I figured out the trait pick part. There is a setting for trait picks that make it not count towards a space. It is:

alters_species_identity = yes

This makes it so that the trait doesn't use up a trait "slot".

EDIT: I got it all working now :)