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

Starless2001

Second Lieutenant
25 Badges
Sep 29, 2016
187
6
  • Stellaris: Galaxy Edition
  • Stellaris: Humanoids Species Pack
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Cities: Skylines - Campus
  • Stellaris: Megacorp
  • Cities: Skylines Industries
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Stellaris: Synthetic Dawn
  • Cities: Skylines Deluxe Edition
Hello, I'm new to the game and I went straight into modding, because developing gaemes is my career of choice when I grow up.

As a first attempt, I'm hoking an event to on_building_complete handler, and this is my script:

Code:
planet_event = {
       id = psion.1
       hide_window = yes
       is_triggered_only = yes

       trigger = {
           AND = {
               OWNER = {
                   NOT = { has_country_flag = flag_built }
               }
               THIS = { has_building = "building_power_plant_1" }
           }
       }

       immediate = {
           OWNER = {
               set_country_flag = flag_built
               owner_species = {
                   add_trait = "trait_rapid_breeders"
               }
           }
       }
   }

This is what I get as error (it says I can't modify my species trait within the species scope, which is where I expected it to be modifiable):


Code:
[13:30:58][effect.cpp:313]: Invalid Scope type for effect add_trait in events/events.txt line : 21
[13:31:00][effect_impl.cpp:13027]: Failed to find trait "trait_rapid_breeders" for _add_trait_ trigger.
[13:34:58][effect.cpp:380]: Script Error, attempted to execute an effect on an unsupported scope!
Event: psion.1
Type: add_trait
Scope:type=species
id=13
random={ 1019375613 1019375613 }
root={
   type=planet
   id=197
   random={ 1019375613 1019375613 }
   from={
       type=tile
       id=1125912791744709
       random={ 1375598546 1375598546 }
   }
}
from={
   type=tile
   id=1125912791744709
   random={ 1375598546 1375598546 }
}
prev={
   type=country
   id=13
   random={ 1019375613 1019375613 }
   root={
       type=planet
       id=197
       random={ 1019375613 1019375613 }
       from={
           type=tile
           id=1125912791744709
           random={ 1375598546 1375598546 }
       }
   }
   from={
       type=tile
       id=1125912791744709
       random={ 1375598546 1375598546 }
   }
   prev={
       type=planet
       id=197
       random={ 1019375613 1019375613 }
       from={
           type=tile
           id=1125912791744709
           random={ 1375598546 1375598546 }
       }
   }
}

 file: events/events.txt line: 21
Is there a way to do this at all?
 
I'm looking at this myself and hit the same problem.

I'm currently digging through vanilla special projects to see if the gene modding project is soft-coded. That will then give a pointer to the relevant event.

If they aren't soft-coded, then I'd guess this is a hard-code restriction. I'll update this if/when I discover more.
 
Last edited:
No luck.

Since gene-modding has its own GUI, it's probably a hard-coded special project and event that actually makes the changes to traits. That might explain why it currently isn't possible in soft-code and is chucking a wobbly - it's not been fully exposed.

EDIT - And it just occured to me that even gene modding actually creates a new race. Perhaps add_trait just won't work out of the scope of last_species_created.
 
Last edited:
  • 1
Reactions:
If I use modify_species several times, giving each one a different set of traits, can I somehow save the each one of them for later use? so I could add a pop of this species later. Even more important than that, can I modify a species with modify_species so it can be buildable? or use create_species and somehow get the traits of the main species as arguments like:

Code:
create_species = {
    name = #somehow get the main species name and concatenate with another string. Contatenating strings isn't too much to ask is it???
    class = #get the main species class
    portrait = #get the mains species portrait
    traits = #get the main species traits. and either add some here or later
    homeworld = #get the main species homeworld
}

Then I would need to save this species to a variable somehow, so I can create pops of this species in the planets owned by the main species. It's a very convoluted process, I know, and it wouldn't be ideal. The ideal would be to create a buildable pop. But it's something