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

Can someone please point me in the right direction - how do I make it so that a pop with a certain trait is prevented from taking specialist or ruler jobs, exactly how is applied to nerve stapled, serviles or zombies?

I am trying to add this condition to forcefully devolved to see how it works from a balance perspective and make the beam a bit less useless.

Even just pointing me in the direction of where in the code these existing traits have the rules applied would be greatly appreciated so I can try and work it out! I haven't been able to find where this happens or how it works yet.

Thanks,

K
 
Hello!

Can someone please point me in the right direction - how do I make it so that a pop with a certain trait is prevented from taking specialist or ruler jobs, exactly how is applied to nerve stapled, serviles or zombies?

I am trying to add this condition to forcefully devolved to see how it works from a balance perspective and make the beam a bit less useless.

Even just pointing me in the direction of where in the code these existing traits have the rules applied would be greatly appreciated so I can try and work it out! I haven't been able to find where this happens or how it works yet.

Thanks,

K
In 01_scripted_triggers_jobs.txt in the scripted triggers folder in the common folder, there is the trigger can_fill_specialist_job = {[conditions]}.
 
  • 1Like
Reactions:
In 01_scripted_triggers_jobs.txt in the scripted triggers folder in the common folder, there is the trigger can_fill_specialist_job = {[conditions]}.
Thank you, I see that code here:

Code:
can_fill_specialist_job = {
    custom_tooltip = SPECIALIST_JOB_TRIGGER
    hidden_trigger = {
        NOT = { has_ethic = ethic_gestalt_consciousness }
        exists = owner
        OR = {
            is_enslaved = no
            has_slavery_type = { type = slavery_indentured }
        }
        is_being_purged = no
        is_being_assimilated = no
        NOT = { has_trait = trait_syncretic_proles }
        can_think = yes
        OR = {
            NOT = { has_trait = trait_mechanical }
            owner = { has_technology = tech_droid_workers }
        }
        NOT = {
            has_citizenship_type = {
                type = citizenship_organic_trophy
                country = owner
            }
        }
        if = {
            limit = {
                divinity_right_to_work_job_check_trigger_exempt = no
            }
            divinity_right_to_work_job_check_trigger_specialist = yes
        }
    }
}

but where does it mention the other traits, e.g. nerve stapled? How do I add forcefully devolved to this? Thanks!
 
can_think is defined in common/scripted_triggers/00_scripted_triggers.txt .

To make this easier on yourself you should find a text search tool, instead of manually looking for files. I used grep, but if you don't already know what grep is, VSCode + CWTools (recommended to set up for serious Stellaris modding) or Notepad++ can both do "Find in files"

e.g. for the above I searched all files in localisation/english for "Serviles" which told me the localisation key is "trait_syncretic_proles" which was in your post already, then I searched for "Nerve Stapled", found it was "trait_nerve_stapled", then I searched trait_nerve_stapled in common/ and looked for clues in the results.
 
  • 1
Reactions:
I don't know if this is a quick question, but:

I was trying to create new reactor that used on a ship reduces power usage of specific components.
But first i wanted to check how power usage works.
I have two files:
"scripted_variables_component_costs" where i can adjust power usage for all components that use this specific variable:
@power_S1 = -15
@power_M1 = -30
@power_L1 = -60

@power_S2 = -20
@power_M2 = -40
@power_L2 = -80

@power_S3 = -25
@power_M3 = -50
@power_L3 = -100

@power_S4 = -35
@power_M4 = -70
@power_L4 = -140

@power_S5 = -45
@power_M5 = -90
@power_L5 = -180

@power_S6 = -55
@power_M6 = -110
@power_L6 = -220

@power_S7 = -75
@power_M7 = -150
@power_L7 = -300

And "Utilities_shields", where i can directly change those values for either fixed value or change variable like from @power_L5 to @power_M6
utility_component_template = {
key = "SMALL_PSI_SHIELD"
size = small
icon = "GFX_ship_part_psi_shield"
icon_frame = 1
power = @power_S7
resources = {
category = ship_components
cost = {
alloys = @shield_s_t7_cost
sr_zro = 0.111
}
upkeep = {
energy = @shield_s_t7_upkeep_energy
alloys = @shield_s_t7_upkeep_alloys
}
}
modifier = {
ship_shield_add = @shield_S7
ship_shield_regen_add_static = @regen_S7 #Regeneration per day
}
prerequisites = { "tech_psionic_shield" }
component_set = "PSI_SHIELD"

ai_weight = {
weight = @T5_weight
modifier = {
factor = 0.0
no_resource_for_component = { RESOURCE = sr_zro }
}
modifier = {
factor = 0.0
is_ai = yes
}
inline_script = {
script = ship_components/weights/roles_stealth
MULT = 0
}
}
}

Tho changing anything or even in both of those changes nothing in game...
My question is Why?
Is there anything else i should change? I forgot about something? Or it is not where power consumption is placed?

And another question
If i want to introduce variable that changes power usage, which code i should use? I will finally figure it out (i hope) or find it somewhere else, maybe on wiki, but once im here asking i can also ask for this ;)
like in here:
utility_component_template = {
key = "SMALL_PSI_SHIELD"
size = small
icon = "GFX_ship_part_psi_shield"
icon_frame = 1
power = {
IF CORVETTE_DARK_MATTER_REACTOR = @power_S3
IF NOT CORVETTE_DARK_MATTER_REACTOR = @power_S7
resources = {
category = ship_components
cost = {
alloys = @shield_s_t7_cost
sr_zro = 0.111
}

Is stellaris code understanding variable "if" "if not" or should i use something else?
Is name of the reactor valid way to do this?
 
Is there a more elegant way of coding this or am I stuck with it?


Code:
    leader_potential_add = {
        from = { has_authority = "auth_machine_intelligence" }
        NAND = {  
            from = { has_civic = "civic_machine_servitor" }
            NOT = { from = { has_technology = "tech_secrets_league" } }
        }
    }

EDIT: This is what I am currently using to exclude Amplifiers from showing up for Rogue Servitors except if they get the First League Filing Office tech.
 
Is there a more elegant way of coding this or am I stuck with it?


Code:
    leader_potential_add = {
        from = { has_authority = "auth_machine_intelligence" }
        NAND = { 
            from = { has_civic = "civic_machine_servitor" }
            NOT = { from = { has_technology = "tech_secrets_league" } }
        }
    }

EDIT: This is what I am currently using to exclude Amplifiers from showing up for Rogue Servitors except if they get the First League Filing Office tech.
It's not much better, but you can use this:
Code:
leader_potential_add = {
    from = {
        has_authority = auth_machine_intelligence
        NAND = {
            has_civic = civic_machine_servitor
            NOT = { has_technology = tech_secrets_league }
        }
    }
}
Since all the triggers used are in the from scope.
 
  • 1
Reactions:
Quick question. I want to change some prescripted species to humanoid, without altering their mechanics or names, just the looks. Do I do that by simply changing in the prescripted_countries folder, species = { ..... portrait = oldspecies to human? I suppose the ruler = "..... portrait = "human_female_05" is only for the initial ruler.

Also, if I change the class, because I want to use some portraits from Additional Humanoid Portraits, do I automatically mess up the vanilla species mechanics?

Thank you

EDIT: Found my answers through testing.
 
Last edited:
who is well versed in the code - I beg you to help me and to explain why my error happens in 10% of situations.

on game_start event (on_action) i launch the next scripted effect:


Code:
every_playable_country = {
    optimize_memory
    save_event_target_as = mod_target_empire
    capital_scope = {
        solar_system = {
            random_neighbor_system = {
                limit = {
                    NOR = {
                        has_star_flag = sealed_system
                        has_star_flag = lcluster
                        exists = space_owner
                        has_star_flag = neighbor_t1_first_colony
                    }
                }
                save_event_target_as = system1
            }
            if = {
                limit = { NOT = { exists = event_target:system1 } }
                random_neighbor_system = {
                    limit = {
                        NOR = {
                            has_star_flag = sealed_system
                            has_star_flag = lcluster
                        }
                    }
                    save_event_target_as = system1
                }
            }
            event_target:system1 = {
                create_starbase = {
                    owner = event_target:mod_target_empire
                    size = starbase_outpost
                }
            }
        }
    }
}

And "always" THE SAME situation:

10-12 empires capture neigbour system and create starbase (so, this code works with them)

but 1-3 empires always receive the next error (i check this in the error.log):

[21:33:42][galaxy_generator.cpp:603]: Trying to create a starbase with an invalid starbase design Ekhhentep for ship size starbase_outpost (note: starbases cannot have components that allow them to move or go FTL)
[21:33:42][effect_impl_starbase.h:134]: Failed to create a starbase at ` file: scripted effect mod_basic_empire_expand at file: events/mod_event.txt line: 591 line: 1`
[21:33:42][galaxy_generator.cpp:603]: Trying to create a starbase with an invalid starbase design Call for ship size starbase_outpost (note: starbases cannot have components that allow them to move or go FTL)

ships_sizes / designs / starbase components - not modded (and zero other mods enabled).
Also, playable_countries are - default countries and all they must have design for starbase outpost. I don't understand why this error appears....

Who can help and to explain me - why this ALWAYS happens with 1-3 empires (from 15) ?
 
Last edited:
Who can help and to explain me - why this ALWAYS happens with 1-3 empires (from 15) ?
Not sure. Do you still get errors if you try with this instead?
Code:
every_playable_country = {
    optimize_memory
    limit = {
        capital_scope.solar_system = {
            any_neighbor_system = {
                NOR = {
                    has_star_flag = sealed_system
                    has_star_flag = lcluster
                }
            }
        }
    }
    save_event_target_as = mod_target_empire
    capital_scope.solar_system = {
        random_neighbor_system = {
            limit = {
                NOR = {
                    has_star_flag = sealed_system
                    has_star_flag = lcluster
                    exists = space_owner
                    has_star_flag = neighbor_t1_first_colony
                }
            }
            save_event_target_as = system1
        }
        if = {
            limit = { NOT = { exists = event_target:system1 } }
            random_neighbor_system = {
                limit = {
                    NOR = {
                        has_star_flag = sealed_system
                        has_star_flag = lcluster
                    }
                }
                save_event_target_as = system1
            }
        }
    }
    event_target:system1 = {
        create_starbase = {
            owner = event_target:mod_target_empire
            size = starbase_outpost
        }
    }
}
 

Mcgan, the same result with your version of code too ((


I have attached mod as example to my message, where is only 1 function - every playable empire capture 1 system.
Your version triggers during game_start, and my version can be triggered with console command.


Result always the same: 10% chance that game will start without errors, but if to restart new one - 100% will be this error:

[10:13:50][galaxy_generator.cpp:603]: Trying to create a starbase with an invalid starbase design for ship size starbase_outpost (note: starbases cannot have components that allow them to move or go FTL)
[10:13:50][effect_impl_starbase.h:134]: Failed to create a starbase at ` file: events/test_spawn_events.txt line: 48`


what is wrong with this code.

Please help, who good knows code of this game :(
 

Attachments

  • test spawn.rar
    1,7 KB · Views: 0
Last edited:
Alright, I tried your example mod by starting new games spawning as many empires as possible, and I get the error too.

So I tried adding is_country_type = default to the limit (which should not be necessary, like you said) and... I don't get the error anymore.
I guess every_playable_country also includes some non-playable empires for some reason.
 
I have added "is_country_type = default" in "test spawn script" too... But, this error continue to appear.

I think you was lucky (i said before, that in 10% of situations game can start without this error). But chance is very low and i continue to see this messages about

[17:45:08][galaxy_generator.cpp:603]: Trying to create a starbase with an invalid starbase design for ship size starbase_outpost (note: starbases cannot have components that allow them to move or go FTL)
 
  • 1
Reactions:
i know that we can check difficulty with command: (is_difficulty > x)

But is there any way that mod will check the game setting "Difficulty Adjusted AI Modifiers" ?

Because, this new setting - completelly changes whole game (increase power of ai empires to 200-500%) and it is important for me to detect the activation of this setting with a mod.
 
Last edited:
The error log says this event is "invalid". I can't figure out why. Can someone help?
Code:
fleet_event = {
    id = mzilli_arch_events.81
    title = "mzilli_arch_events.81.name"
    desc = "mzilli_arch_events.81.desc"

    picture = GFX_evt_exploding_ship
    show_sound = event_ship_bridge
    location = FROM

    archaeology = yes
   
    is_triggered_only = yes
   
    option = {
        name = anomaly.625.a
        owner = {
            add_resource = { minor_artifacts = 2 }
            add_monthly_resource_mult = {
                resource = society_research
                value = @tier3researchreward
                min = @tier3researchmin
                max = @tier3researchmax
            }
        }
    }
}

EDIT: I moved the event into a different txt file and now it works perfectly. Idk why.
 
Last edited:
Hey, so some outdated mods seem to remove armor giving armor, I've looked around and others have said it's due to the armor changes. How would I go about fixing this within the mods? I'm not a modder, but I've looked around the files and haven't really found an obvious answer. In my case the main mod that I'm interested in getting working is Star Wars Ships 3.4.X. Any help would be much appreciated.
 
Hi.
I can't figure out how to add trait points using technology for a custom archetype. Can anyone tell me how to create/find the right property for this? I would be very grateful if someone could explain it to me...