What does colon ":" and pipe "|" mean in stellaris script language?

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

lynх

Private
23 Badges
Mar 18, 2021
11
12
  • Surviving Mars: Digital Deluxe Edition
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Distant Stars
  • Stellaris
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Surviving Mars
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
I am writing mod and come to see colon and pipe in stellaris files. How do i read it and what it does specifically?
Examples:
Stellaris/common/technology/00_soc_tech.txt
factor = value:tech_weight_likelihood
Code:
tech_hive_confluence = {
    cost = @tier3cost2
    area = society
    category = { statecraft }
    tier = 3
    prerequisites = { "tech_hive_cluster" "tech_colonial_centralization" }
    weight = @tier3weight2

    weight_modifier = {
        modifier = {
            factor = value:tech_weight_likelihood
            research_leader = {
                area = society
                has_trait = "leader_trait_expertise_statecraft"
            }
        }
    }

    ai_weight = {
        modifier = {
            factor = 1.25
            research_leader = {
                area = society
                has_trait = "leader_trait_expertise_statecraft"
            }
        }
    }
}
Stellaris/common/pop_jobs/01_ruler_jobs.txt
mult = value:scripted_modifier_mult|MODIFIER|pop_job_trade_mult|
Code:
executive = {
    category = ruler
    condition_string = RULER_JOB_TRIGGER
    building_icon = building_capital
    clothes_texture_index = 1

    possible_pre_triggers = {
        has_owner = yes
        is_enslaved = no
        is_being_purged = no
        is_being_assimilated = no
        is_sapient = yes
    }

    possible_precalc = can_fill_ruler_job

    resources = {
        category = planet_executives
        produces = {
            unity = 6
        }
        upkeep = {
            consumer_goods = 2
        }
    }

    triggered_planet_modifier = {
        potential = {
            always = yes
        }
        trade_value_add = 4
        mult = value:scripted_modifier_mult|MODIFIER|pop_job_trade_mult|
    }

    triggered_planet_modifier = {
        potential = {
            always = yes
        }
        planet_amenities_add = 3
        mult = value:scripted_modifier_mult|MODIFIER|pop_job_amenities_mult|
    }

    weight = {
        weight = @ruler_job_weight
        mult = value:job_weights_modifier|JOB|executive|RESOURCE|unity|
        mult = value:scripted_modifier_job_weight_mult|MODIFIER|pop_job_amenities_mult|
        mult = value:scripted_modifier_job_weight_mult|MODIFIER|pop_job_trade_mult|
        modifier = {
            factor = 5
            has_job = executive
        }
        # crisis purge
        modifier = {
            factor = 0.01
            exists = planet
            exists = planet.controller
            planet.controller = {
                OR = {
                    is_country_type = swarm
                    is_country_type = ai_empire
                }
            }
            OR = { # contingency won't purge itself
                NOT = { exists = event_target:custodian_bot }
                AND = {
                    exists = event_target:custodian_bot
                    NOT = { species = { is_same_value = event_target:custodian_bot } }
                }
            }
        }
    }
}
 
This are parametised inline scripts new in 3.6, scripted values new in 3.3. You can find a bit of info in common\script_values\00_script_values.txt.
There is still no info on wiki. :-/
 
Last edited:
  • 2
Reactions:
Thanks i guess that covers colon. With some grepping i now somewhat understand where it comes from. And as for pipe i guess it something alike parentheses for functions for parameter passing to the called script. First thing after pipe is variable name in the inline script and after it is a value as far as i understand.
 
  • 1
Reactions:
This are parametised inline scripts new in 3.6, scripted values new in 3.3. You can find a bit of info in common\script_values\00_script_values.txt.
There is still no info on wiki. :-/
Thanks i guess that covers colon. With some grepping i now somewhat understand where it comes from. And as for pipe i guess it something alike parentheses for functions for parameter passing to the called script. First thing after pipe is variable name in the inline script and after it is a value as far as i understand.
The code mult = value:job_weights_modifier|JOB|translucer|RESOURCE|rare_crystals| uses job_weights_modifier as the input of value, which has 2 parameters job and resource. In the file script_values/00_script_values.txt defines:
Code:
job_weights_modifier = {
    complex_trigger_modifier = {
        trigger = check_economic_production_modifier_for_job
        parameters = {
            job = $JOB$
            resource = $RESOURCE$
        }
        mode = add
        [[FACTOR]
            mult = $FACTOR$
        ]
    }
    add = value:job_weights_manual_corrections|JOB|$JOB$|
    add = 1
    min = 0
    pow = 3 #we need it to have a bit more impact

    modifier = {
        owner = {
            has_deficit = $RESOURCE$
        }
        mult = @\[ 10 * $FACTOR|1$ ]
    }
}
That's why the pipe symbol here works like value:my_value|PARAM1|value1|PARAM2|value2|
 
Last edited:
  • 1
Reactions: