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

El-Lobo

Recruit
28 Badges
May 22, 2016
4
2
  • Sword of the Stars
  • Sword of the Stars II
  • Magicka
  • Stellaris: Synthetic Dawn
  • Stellaris: Necroids
  • Stellaris: Federations
  • Age of Wonders: Planetfall - Revelations
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall Season pass
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Shadowrun: Hong Kong
  • Shadowrun: Dragonfall
  • Shadowrun Returns
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Age of Wonders III
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Tyranny: Archon Edition
  • Stellaris
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines
A) Are the @something=3 that can be found in some of the moddable txt files constants of variables?
Is there a way to modify them later in the same file?
B) What syntax/code is used in these files? any ressources on that? (i know the wiki and the resources stickied in reddit/stellarimods)
C) Is there a way to read such a constant out of another file? ( In order to make a general settings file in a bigger mod)
D) Looking at following code snippet (simplified example) out of 00_star_classes.txt:
Code:
@oink=2
# Blue Stars
sc_b = {
    class = b_star
    planet = pc_b_star
    spawn_odds = 10000
    num_planets = { min = 4 max = 10 }

     #switch = {
     #      trigger = @oink 
     #          1 = { pc_tundra = { spawn_odds = 1 } }
     #          2 = { pc_arid     = { spawn_odds = 1 } }
            }

     switch = {
            trigger = check_variable = { which = @oink value }
                1 = { pc_tundra = { spawn_odds = 1 } }
                2 = { pc_arid     = { spawn_odds = 1 } }
            }

    }

I'm trying to modify what planets can spawn in specific systems. These should be modified only by editing the @Oink constant/variable. The switch stuff won't work in both ways. Can someone tell me what I am missing?
 
A) Are the @something=3 that can be found in some of the moddable txt files constants of variables?
Is there a way to modify them later in the same file?

No, they're basically constants.

B) What syntax/code is used in these files? any ressources on that? (i know the wiki and the resources stickied in reddit/stellarimods)

It's Paradox's own internal scripting language. The resources you mention are more or less it (along with reading through the files for a few hours to get the hang of the syntax). It's not hard to pick up.

C) Is there a way to read such a constant out of another file? ( In order to make a general settings file in a bigger mod)

No.
D) Looking at following code snippet (simplified example) out of 00_star_classes.txt:
I'm trying to modify what planets can spawn in specific systems. These should be modified only by editing the @Oink constant/variable. The switch stuff won't work in both ways. Can someone tell me what I am missing?

Well, the
trigger = check_variable = { which = @Oink value }

line is just bad code. It should be trigger = { check_variable ={ which = [some variable name] value = [some value] } }.

But I'm also not entirely sure what you're hoping to do. Trigger = 2 doesn't make any sense. The Oink value can't be modified by anything when the game is running, either, so it will always equal 2 and so there's nothing to trigger the switch.
 
Well, basicly my longterm plan is/was making the galaxy creation easily modifyable by editing only a few constants that switch between multiple sets for e.g. amount and type of habitable planets per system type, amount of planets/system. since these things are spread around multiple files a centralized settings file for the mod would have been great.

Oh, and thanks a lot! When I'm concentrated I'm always forgetting the social conformities, like hello, got a question.... :)
 
Last edited:
Here's an examle of a working switch:

Code:
                switch = {
                    trigger = has_leader_flag
                    gained_leader_trait_adaptable = { text = leader.24.desc.adaptable }
                    gained_leader_trait_resilient = { text = leader.24.desc.resilient }
                    gained_leader_trait_stubborn = { text = leader.24.desc.stubborn }
                    gained_leader_trait_substance_abuser = { text = leader.24.desc.substance_abuser }
                    gained_leader_trait_arrested_development = { text = leader.24.desc.arrested_development }
                    gained_leader_trait_defender = { text = leader.24.desc.defender }
                    gained_leader_trait_attacker = { text = leader.24.desc.attacker }
                    gained_leader_trait_charismatic = { text = leader.24.desc.charismatic }
                    gained_leader_trait_butcher = { text = leader.24.desc.butcher }
                    gained_leader_trait_glory_seeker = { text = leader.24.desc.glory_seeker }
                    gained_leader_trait_army_logistician = { text = leader.24.desc.army_logistician }
                    gained_leader_trait_armchair_commander = { text = leader.24.desc.armchair_commander }
                    default = { text = "ERROR" }
                }


So, we have the switch itself, which looks at has_leader_flag as a trigger. The gained_leader_trait stuff are the names of the flags it looks for, and the stuff in the braces that follows is what it does in reaction (in this case, printing a text description).

So in your case, I think it would be something closer to:

switch = {
trigger = @Oink
1 = {something}
2= {something}
3 = {something}
}

But Oink needs to be set up as a different type of variable - not a constant like in the files, but as an actual variable. This would be done by creating the variable elsewhere with something like the following:

set_variable = {
name = myVar
value = 1
}

and then incrementing it on something with:


add_variable = {
name = myvar
value = 1
}

This is probably not 100% correct, but is indicative of how the code structure works.
 
Last edited: