• 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.
It is possible to work around the limits of the scoping tbh by triggering an event sequence. I have some code for CKII, that simulates the two party diplomatic interactions by scoping to all valid characters and letting each display of character options leave a tag on the characters. This can be done in Stellaris with scopes to planets, fleets or leaders using flags to assign a yes/no check and then having a final event option to give more options. While it is undoubtedly annoying to do, it is possible.

It would even work substantially better for Stellaris, because it does not have the limit of four event options so is able to display far more information on each individual page.
 
* Added is_exact_same_species that works like is_same_species used to work

I did not understand , could you explain?
I didn't make the change but from a quick check in the code they have implemented an non-species-object-unique-identity for species. Which means that while some species are not exactly the same species they might still be considered to share identity enough to be considered the same species as with the case of neo-humans.
 
I didn't make the change but from a quick check in the code they have implemented an non-species-object-unique-identity for species. Which means that while some species are not exactly the same species they might still be considered to share identity enough to be considered the same species as with the case of neo-humans.
So,
is_exact_same_species = yes
is like
OR = {
is_same_specie = yes
is_subspecies = yes
}
?
 
subs
 
I saw these where added in defines
NDefines.NGameplay.XENOPHOBIA_SAME_SPECIES_CLASS_MULT = 0.5
NDefines.NGameplay.XENOPHOBIA_SUBSPECIES_MULT = 0.25
NDefines.NGameplay.XENOPHOBIA_ROBOT_MULT = 0.25
NDefines.NGameplay.XENOPHOBIA_CLIENT_PATRON_MULT = 0.25

But they don't seem to work properly. As for instance XENOPHOBIA_SAME_SPECIES_CLASS_MULT only changes the Alien overlord penalty, but doesn't affect the xenophobia happiness.

And the XENOPHOBIA_ROBOT_MULT doesn't seem to do anything at all.
 
Seems that is_exact_same_species is not working right either.

From reading the description of it in patch notes and trigger_docs. It is supposed to function the way is_same_species worked before patch 1.2.0
As is_same_species was changed to work so that it included subspecies.

So it is now works kinda like this before 1.2.0
Code:
or = {
    is_subspecies = ROOT
    is_same_species = ROOT
}

But is_exact_same_species still for whatever reason keeps including subspecies in it's checking. Which is not how is_same_species worked before the patch. And making it impossible for me to count the total number of primary species, as it also keeps including subspecies in the count....
 
- Added is_subject and is_overlord triggers.
I'm getting an error in error.log when using is_subject in portrait files. Both of those triggers are also missing from trigger_docs. Were they by chance not added in the patch?
Code:
[06:01:30][trigger_impl.cpp:904]: Error in scripted trigger, cannot find: is_subject
 
I'm getting an error in error.log when using is_subject in portrait files. Both of those triggers are also missing from trigger_docs. Were they by chance not added in the patch?
Code:
[06:01:30][trigger_impl.cpp:904]: Error in scripted trigger, cannot find: is_subject
Unfortunately it got erroneously removed by a merge conflict in our subversion system. So it didn't make this patch. Thank you for poking me about the issue.
 
  • 1
Reactions:
Seems that is_exact_same_species is not working right either.

From reading the description of it in patch notes and trigger_docs. It is supposed to function the way is_same_species worked before patch 1.2.0
As is_same_species was changed to work so that it included subspecies.

So it is now works kinda like this before 1.2.0
Code:
or = {
    is_subspecies = ROOT
    is_same_species = ROOT
}

But is_exact_same_species still for whatever reason keeps including subspecies in it's checking. Which is not how is_same_species worked before the patch. And making it impossible for me to count the total number of primary species, as it also keeps including subspecies in the count....
There was an issue with the change that made both of them work like is_same_species. I fixed the issue but I don't know what patch that will reach you with that change.
 
  • 1
Reactions:
There was an issue with the change that made both of them work like is_same_species. I fixed the issue but I don't know what patch that will reach you with that change.

Cool. Oh, and you also might wanna take a closer look at the pop_events.txt script that handles the pops self gene modding event.

As the changes in is_same_species = ROOT which the script uses, will more than likely cause that script to not work right. As it wont be able to tell apart which is a primary species, and which is a gene modded one.

For example this code snippet..
Code:
                random_pop = {
                    limit = {
                        NOT = { is_pop = ROOT }
                        is_same_species = ROOT
                        is_enslaved = no
                        is_being_purged = no
                        is_robot_pop = no
                    }
                    change_pop_species = last_created
                    set_pop_flag = modified_pop_1
                }
                random_pop = {
                    limit = {
                        NOT = { is_pop = ROOT }
                        is_same_species = ROOT
                        is_enslaved = no
                        is_being_purged = no
                        is_robot_pop = no
                    }
                    change_pop_species = last_created
                    set_pop_flag = modified_pop_1
                }
..has a chance to be applied to the same pop twice. As it wont be able to differentiate between a non-modded and modded pop.

Changing is_same_species to is_exact_same_species should solve it. When is_exact_same_species is working as intended that is.
 
Last edited:
Update:

- Added subtract_variable effect
- Added multiply_variable effect
- Added divide_variable effect
- Variable effects and triggers can take a scope as value
- Variable effects and triggers can take a variable name as value

Code:
multiply_variable = { which = test1 value = test2 }
subtract_variable = { which = test1 value = FROM }

The first example will multiply test1 with test2. The second one will subtract FROM's test1 from test1.

Did this make it into Asimov?
 
[11:11:47][effect_impl.cpp:293]: has_resource effect at file: events/synthetic_empire_events.txt line: 197 accepts only yes or no as values
[11:11:47][effect_impl.cpp:293]: type effect at file: events/synthetic_empire_events.txt line: 198 accepts only yes or no as values
[11:11:47][effect_impl.cpp:293]: amount effect at file: events/synthetic_empire_events.txt line: 199 accepts only yes or no as values

Didn't work :) Thanks anyway, I think I'll leave the resources/deposits alone.

Code:
planet_event = {
    id = synthetic_empire_event.4
    is_triggered_only = yes
    hide_window = yes

    immediate = {
        every_tile = {
            limit = { has_building = "building_hydroponics_farm_1" }
            remove_building = yes
            set_building = "building_power_plant_1"
            clear_resources = yes
            add_deposit = d_rich_energy_deposit
        }
        every_tile = {
            has_resource = {
                type = food
                amount > 0
            }
            add_deposit = d_energy_deposit
        }
    }
}
Looks like you need a limit on the second every_tile. Try:
Code:
every_tile = {
   limit = {
      has_resource = {
         type = food
         amount > 0
      }
   }
   add_deposit = d_energy_deposit
}
 
Looks like you need a limit on the second every_tile. Try:
Code:
every_tile = {
   limit = {
      has_resource = {
         type = food
         amount > 0
      }
   }
   add_deposit = d_energy_deposit
}

Pretty sure I had already tried that and several iterations of the same, but for whatever unholy reason it is working now.

Code:
        every_tile = {
            limit = { has_resource = { type = food amount > 0 } }
            clear_resources = yes
            add_deposit = d_energy_deposit
        }

Final code ended up looking like this

Code:
planet_event = {
    id = synthetic_empire_event.4
    is_triggered_only = yes
    hide_window = yes

    immediate = {
        every_tile = {
            limit = { has_resource = { type = food amount > 0 } }
            clear_resources = yes
            add_deposit = d_energy_deposit
        }
        every_tile = {
            limit = { has_building = "building_hydroponics_farm_1" }
            remove_building = yes
            set_building = "building_power_plant_1"
        }
    }
}

Earlier the second every_tile also had +an energy deposit, but despite the clear_resources it also had, it just added the deposits together in the same tile, so I ended up removing that and just going with a single clear and a single add deposits to avoid conflicts.
 
Last edited:
I'm interested too.

Soo, did I understand correctly that in 1.2 I can't overwrite the vanilla event by my own with the same id?
If so, then this is very bad for the modding, for me at least.
I think so but I'm not handling the merging to patches so I'm not sure. Try to use the effects in a script file and you'll get some obvious errors in the error log if they're not in.

You should be able to replace the whole vanilla event file that contains the event. Copying it and making the necessary changes inside your mod might achieve what you're after.
 
You should be able to replace the whole vanilla event file that contains the event. Copying it and making the necessary changes inside your mod might achieve what you're after.
I think it's a bug when a file was called harderinvaders_game_start nothing worked. When I renamed it to fe_game_start the changes show up in the game.

Can i use set_species_homeworld in planet scope? Or only country?
Tried this:
owner_species = { set_species_homeworld = this }
but got an error in the log


Loks like variables working. May be you can edit the list of changes and add this important information?

Can i send my mineral/energy/science income to variables?
In better way then:
Code:
if = {
            limit = {
                has_monthly_income = { resource = energy value > 10 }
                }
            set_variable = {
            which = test2
            value = 11
                    }
                }
        if = {
            limit = {
                has_monthly_income = { resource = energy value > 11 }
                }
            set_variable = {
            which = test2
            value = 12
                    }
                }
etc...
 
I think it's a bug when a file was called harderinvaders_game_start nothing worked. When I renamed it to fe_game_start the changes show up in the game.

Can i use set_species_homeworld in planet scope? Or only country?
Tried this:
owner_species = { set_species_homeworld = this }
but got an error in the log


Loks like variables working. May be you can edit the list of changes and add this important information?

Can i send my mineral/energy/science income to variables?
In better way then:
Code:
if = {
            limit = {
                has_monthly_income = { resource = energy value > 10 }
                }
            set_variable = {
            which = test2
            value = 11
                    }
                }
        if = {
            limit = {
                has_monthly_income = { resource = energy value > 11 }
                }
            set_variable = {
            which = test2
            value = 12
                    }
                }
etc...
The file merging is a bit difficult to remember at times but if I remember correctly you should probably have your file named game_start.txt so that you overwrite the games original file with your modded file. However make sure that the essential bits that are needed but you don't want to change also are part of your modded file as the original file should not be read at all on game start.

I guess your version works as well but only because your filename comes before the original event file in alphabetic order ( f->g->h ). This will probably cause some errors when reading the original event file, the errors might be contained to the initialization process of the game and not have any effect when the game later on is running but I personally prefer a little cleaner solution.

owner_species is not a valid scope-change from a planet.
Code:
<assumed planet-scope>
planet_owner = {
   owner_species = {
      set_species_homeworld = PREVPREV
   }
}
Might be close to what you're trying to accomplish?

We've been experimenting a bit with an effect called export_to_variable = { } in our older titles CK2 and EUIV recently and if they work well we will most likely look into porting that functionality to Stellaris. Right now you're unfortunately stuck with the if limits.
 
Last edited:
  • 1
Reactions:
I copy file game_start rename to harderinvaders_game_start, left only one event and changed it.
It works fine in 1.1 but in 1.2 I had to find what the problem is and how to fix the mod for the new version.

So, in 1.1 changes were included in any case, but now if only the letter comes before in the alphabet?

No, it not working.
But i found solution:
Code:
save_event_target_as = my_planet_scope
                    last_created_country = {
                        species = {
                            set_species_homeworld = event_target:my_planet_scope
                        }
                    }

Can species have 2+ homeworlds?
And another questions about species:
Can I change the portrait of existing species by event?
Try to change can_pop_procreate rules. Can i add condition by the planet?
Try this:
Code:
can_pop_procreate = {
   AND = {
     OR = {
       is_enslaved = no
       owner =   {
         NOT = {
           has_policy_flag = slavery_procreation_not_allowed
         }
       }
     }
     NOT = {
      OR = {
         AND = {
           NOT = { is_same_species = owner.species }
           exists = owner
           owner = {
             has_policy_flag = birthcontroll_xenos
           }
         }
         AND = {
           is_same_species = owner.species
           exists = owner
           owner = {
             has_policy_flag = birthcontroll_own
           }
         }
         AND = {
           exists = pop
           exists = owner
           owner = {
             has_policy_flag = birthcontroll_all
           }
         }
         NOT = {
           planet = {
             has_planet_edict = free
           }
         }
       }
     }
   }
}
But in error log i get:
"invalid scope for trigger. got [planet], expected {galactic_object}. file: common/game_rules/birthcontrol_rules.txt line: 36"
What is galactic_object?
 
If you want to override a vanilla file you should use the exact same name as the vanilla file in your mod.
No, a species can have 1 homeworld with the current functionality.
I think there are some ways to do it but other modders would have more experience with trying to do that than I have.
I don't see any obvious error with the code. And a galactic object is a star system.

But for the sake of this threads health and for me to be able to help more modders efficiently I'll henceforth answer questions like this in the quick questions thread where other people also can help out: https://forum.paradoxplaza.com/forum/index.php?threads/quick-questions-thread.926968/

Therefor I'll from here on delete all posts that are not directly related to my modding improvement updates in this thread.
 
  • 1
Reactions: