• 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.
Victory screen vassal ahead of overlord

Any way to mod the game so a vassal is not considered to have a larger score than its overlord? I see some conditions in defines but not sure what to change. Would like to have a loyal vassal not be allowed to win but from what I can see that is not possible?

EDIT: I changed in defines.txt the SCORE_SUBJECTS from 0.5 to 1.0 so 100% of the vassals victory score gets added to the overlord's score. I think maybe the economic score should be less and the fleet score currently at 0 ??? should be higher but for now having 100% of the vassal be added to the overlord works. In a perfect world this would be 100% of a loyal vassal but there is apparently no way to mod that.

Could this have an adverse effect on origins like Scion where the player is a vassal?
 
For compatibility reasons, I want to use an event that fires at game start to add a secondary species to an empire. I don't want to modify the generate_start_pops function, although I know doing so will work. I cannot get it to properly scope to my secondary species.
I am exactly reusing the same code used by that function -

What's happening is it is using the last species generated by the game, IE the species of the last generated country, instead of my secondary. Yet if I were to put "owner_main_species" instead of "last_created_species" it will correctly grab my main species. The error log complains when i try to say species = {owner = {last_created_species}} ; if I don't use capital scope it also freaks out when i try to create pops (killing pops is fine in either case.)

Has anyone got some experience in the correct scope to apply (and where) to make this work? Yes, I correctly define the secondary species in game setup (think of a Syncretic or assimilator clone.)

You're saying that you want to create pops of a secondary species. Where is that species defined? Could you put the code for adding the pops the the capital world right after whatever code defines the secondary species? That should work so long as you know how to scope to the capital from wherever you define the secondary species. (I don't know why it works for the base game's code, presumably because the developers know that by the time that bit of code is called, the last created species is the secondary because they have a closer understanding of the game's processes...)

I think the error is happening because "last_created_species" doesn't belong to any game object, it's literally just whatever species was most recently created by the game. So it makes sense to only use it right after your code defines a new species.
 
Does the Corporate authority hard code governments of its type to only show governors as election candidates? The government definitions for the different kinds of megacorp seem to allow for rulers and governors, and I've defined a custom megacorp type that allows for other election candidates... but somehow, only governors show up.
 
You're saying that you want to create pops of a secondary species. Where is that species defined?
It's defined in the game setup menu by the player, just like secondary species origin/civics in the vanilla game. This option is from adding the block has_secondary_species={} to the origin or civic. (That block has a note, #see game_start.11, but I can't find that in the game start events. it jumps from 10 to 12.)
I'm not actually sure where game setup info lives once the game has started- I am doing the classic on_game_start calls my setup event to create the pops of my secondary species. Perhaps just having that setup menu option isn't sufficient to define it? (Although i cannot see any other tricks the vanilla civics use.)
Could you put the code for adding the pops the the capital world right after whatever code defines the secondary species? That should work so long as you know how to scope to the capital from wherever you define the secondary species. (I don't know why it works for the base game's code, presumably because the developers know that by the time that bit of code is called, the last created species is the secondary because they have a closer understanding of the game's processes...)
The exact scope that generate_start_pops has may be special to it. Based on what it does it SHOULD be country scope, I mean it refers to owner_main_species.
But country_events also have country scope, so why it suddenly loses context for last_created_species is beyond me. There's no other way to specifically refer to your secondary, either. In generate_start_pops it actually sets a flag for the syncretic species, but it can only do that by referring to it as the last created species.
I really just want to avoid getting another tide of "muh compatibility" comments when I upload this mod. Obviously i try but I am quite limited.
Does the Corporate authority hard code governments of its type to only show governors as election candidates? The government definitions for the different kinds of megacorp seem to allow for rulers and governors, and I've defined a custom megacorp type that allows for other election candidates... but somehow, only governors show up.
The government type defined in common.governments/00_governments doesn't in any way seem bound by your authority. I created a mod that has the feature of a megacorp government type using scientists. Just loading a new game and calling an emergency election, my choices are the current ruler and my 3 scientists assigned to physics/society/engineering.
1589816630982.png

1589816653028.png
Here's the code for this government type:
Code:
gov_optimized_venture = {
    ruler_title = RT_CHAIRMAN
    ruler_title_female = RT_CHAIRWOMAN
    
    should_force_rename = yes
    
    leader_class = scientist
    
    election_candidates = {
        modifier = {
            add = 100
            leader_class = ruler
        }
        modifier = {
            add = 10
            leader_class = scientist
        }
    }

    possible = {

            AND = {
                has_authority = auth_corporate
                OR = {
                    has_valid_civic = civic_automated_workforce
                    has_valid_civic = civic_science_syndicate
                    has_valid_civic = civic_efficiency_expert
                }
            }
        
    }

    weight = {
        base = 1200
    }
}
It's from my mod Venture Politics on steam.
 
Could this have an adverse effect on origins like Scion where the player is a vassal?

Sorry I do not know. I just think it is strange that a vassal by conquest can have a higher victory score than their overlord. Paradox needs to allow us more mod options for victory conditions. I never noticed this before the 2.7 patches so maybe something new? At the same time I do see very old posts on the web complaining about the same thing so maybe it used to be a problem then fixed then broke again or maybe it has always been there and I did not notice.
 
Is there a way to add a my own prescripted empire in to common ground origin, not just use randomly generated empire?
Lost Colony has an exception that makes the UNE if you play the commonwealth of man.
I haven't studied that code, but you might be able to inject a similar exception into common ground. I think the event origin.55 or thereabouts is common ground's setup, off the top of my head.
 
  • 1Like
Reactions:
Lost Colony has an exception that makes the UNE if you play the commonwealth of man.
I haven't studied that code, but you might be able to inject a similar exception into common ground. I think the event origin.55 or thereabouts is common ground's setup, off the top of my head.

Yeah, it's event origin.55, thanks. But I could not find the code for this exception from lost colony. I literally opened all the event files but keyword search found nothing, except non-human start.
 
I believe 2.6.2 broke the COM's unique start, so it might not be possible to find at present. But if you go into federations_event_effects, there are scripted effects for generating Common Ground neighbors that you could certainly rework with your own conditions and the like.
 
But I could not find the code for this exception from lost colony. I literally opened all the event files but keyword search found nothing, except non-human start
UNE and CoM are called "humans1" and "humans2" in prescripted_countries. I'm assuming you looked at origin.100. I think the key to look for is how this flag is allocated:
lost_colony_parent_of@root
Which may be a federation event effect.
I don't know a lot about empire generation but you should be able to look for an effect that matches this: "federation_origin_planet_setup" and see how it's making those empires, and then try to inject your own thing.
 
Does modding Defines prevent multiplayer?

For example:
NCamera = {
EDGE_SCROLLING_PIXELS = 0
}

Made a simple mod which did this, but others were unable to join my game. Tried with everyone having mod, only me having mod, etc. All ended in same result. Something like "Host is running different version of the game".

Some other mods (Tiny Outliner v2 for example) which don't modify Defines seem to work, regardless of who has them (including host). So is modding Defines off limits in multiplayer?

Thanks
 
Last edited:
Some other mods (Tiny Outliner v2 for example) which don't modify Defines seem to work, regardless of who has them (including host). So is modding Defines off limits in multiplayer?

Thanks
Verify your checksum is the same as your other players.
Mods which change purely graphical stuff generally don't adjust it. Mods that change content do.
You need to have the same mods in the same load order, excepting things like tiny outliner which is graphics only.
 
Hey guys, I hope someone can answer this beginner question for me. So I want to make a mod that adds vassal diplomatic weight (or maybe a percentage) to that of their overlord. I see that transferring of diplomatic weight is a mechanic in Federations, which I do have. So my question is this:

Code:
president_diplo_weight_steal_1 = {
    federation_modifier = {
        description = president_diplo_weight_steal_1_effect
        federation_leader_diplo_weight_from_members_mult = 0.10

Where is the variable 'federation_leader_diplo_weight_from_members_mult' being defined? I guess it is defined there, as it is defined as equal to 0.1, but I mean where do I locate the function that steals the diplomatic weight?

I guess what I should ask is how I call a subjects diplomatic weight. If anyone can help me that'd be awesome.
 
Hi

Rather new to the more complex aspects of stellaris modding and was hoping to get some help here on how to check the functionality of a mod, more specifically a variable.

I have a code which is designed to count how many traditions have been unlocked. It simply adds 1 to the number in a variable every time a tradition is unlocked.

Question is, if I can somehow visualize the current variable number on screen to see if it works?

\Skodkim
 
Where is the variable 'federation_leader_diplo_weight_from_members_mult' being defined? I guess it is defined there, as it is defined as equal to 0.1, but I mean where do I locate the function that steals the diplomatic weight?

I guess what I should ask is how I call a subjects diplomatic weight. If anyone can help me that'd be awesome.
Stellaris' language isn't really a programming language per se. It's a weird mix of functions and well, basically data tables/assignment. Almost everything in the entire game is a modifier attaching itself to something.

When you see something inside modifier = { }, the things in it are already defined effects that you are 1) assigning a magnitude to and 2) assigning to a scope. For an easy example, a civic like Efficient bureaucracy will assign a modifier - a multiplier on admin cap - of magnitude +10% to the owner of that civic.

However, keep in mind that Stellaris files are not exactly optimized, so sometimes you encounter choppy stuff like what you quoted. President_diplo_weight_steal_1 is kind of like a function. What does this do? It adds a modifier to the federation entity, which has the effect of
federation_leader_diplo_weight_from_members_mult. This effect, in some deeper level of code (very likely not exposed to us) is almost certainly conditionally checking to see which empire is the president and who are the other members.
Technically, they could have done something like setting the scope of the modifier to the actual president, instead of the federation as a whole, and applying a similar effect.

Unfortunately, because this system is very new, the modding ability for federations is pretty weak.

What you want to do is find out how to scope to countries that are your vassals, (that's an empire level scope) and grab the diplo weight of that empire. Presumably, this is pretty routinely done by the game. You may want to check Galactic community files for that.

But it's also possible the ability to access that isn't exposed to us yet. IDK, I haven't really poked around it.

Question is, if I can somehow visualize the current variable number on screen to see if it works?
Can you give yourself an empire modifier with a magnitude equal to the variable? Something obscure like dark matter income or something? You can always check that in game while you do other stuff.
 
*snip*
helpful stuff was here
*snip*

When I first opened these files I thought they looked kinda weird. I'll look into what you said, thanks. I really appreciate you taking the time to reply. When you say the Galactic community files, is there any specific folder you mean? For example. the resolutions are in their own folder called 'resolutions,' but I can't find much more than that. If not no worries, you've already pointed me in the right direction.
 
Last edited:
Hi

Rather new to the more complex aspects of stellaris modding and was hoping to get some help here on how to check the functionality of a mod, more specifically a variable.

I have a code which is designed to count how many traditions have been unlocked. It simply adds 1 to the number in a variable every time a tradition is unlocked.

Question is, if I can somehow visualize the current variable number on screen to see if it works?

\Skodkim

There is a log statement that will work like this:

Code:
log = "Variable value is: [this.your_var_name]"

The log messages show up in Documents\Paradox Interactive\Stellaris\logs\game.log (file path may be different on your computer).

Keep in mind that variables are scope bound and to use a variable created in one scope in another, you'll need to "re-initialize" it in the new scope, see: https://stellaris.paradoxwikis.com/Variables
 
Is there any way to apply a flat bonus (instead of a percentile bonus) to weapons damage and/or defense HP, say through technology or through a utility component?
I've never heard of such a thing but iirc certain components applying percentile bonuses to stats like tracking, whereas some apply a flat value. You could try using that syntax. And don't forget that our hull technologies give flat HP boosts too. (as do armor and shield components, but I'm guessing you want the target of the effect to be the shield component itself.)
 
Hello, is it possible to add a notification whenever a starbase finishes its ship construction queue (i.e. basically revert what Paradox has done to the notifications sometime post Megacorp)? I have come across this, but as far as I can tell this has the effect of adding a notification for every single ship (or an army) that gets built which is not entirely ideal. I know very little about modding and so far I haven't been successfull trying to figure it out just by reading the game files so thanks for pointing me in the right direction.

Code:
namespace = pdn_event

# A ship has been built
# Root = Ship
# From = Planet
ship_event = {
    id = pdn_event.10
    hide_window = yes
    is_triggered_only = yes
       
    immediate = {
   
        from = { solar_system = { starbase = { save_event_target_as = m_starbase } } }
   
        create_message = {
            type = STARBASE_CONSTRUCTION_MESSAGE_TYPE
            localization = PdnMessageShipConstructed_desc
            days = @PdnConstNotificationTeam
            target = event_target:m_starbase
            variable = {
                type = name
                localization = PLANET
                scope = event_target:m_starbase
            }
        }
    }
}

planet_event = {
    id = pdn_event.20
    hide_window = yes
    is_triggered_only = yes
       
    immediate = {
        create_message = {
            type = BUILDING_CONSTRUCTION_MESSAGE_TYPE
            localization = PdnMessageBuildingConstructed_desc
            days = @PdnConstNotificationTeam
            target = this
            variable = {
                type = name
                localization = PLANET
                scope = this
            }
        }
    }
}

planet_event = {
    id = pdn_event.30
    hide_window = yes
    is_triggered_only = yes
       
    immediate = {
        create_message = {
            type = BUILDING_CONSTRUCTION_MESSAGE_TYPE
            localization = PdnMessageDistrictConstructed_desc
            days = @PdnConstNotificationTeam
            target = this
            variable = {
                type = name
                localization = PLANET
                scope = this
            }
        }
    }
}

planet_event = {
    id = pdn_event.40
    hide_window = yes
    is_triggered_only = yes
       
    immediate = {
        create_message = {
            type = ARMY_RECRUITMENT
            localization = PdnMessageArmyConstructed_desc
            days = @PdnConstNotificationTeam
            target = this
            variable = {
                type = name
                localization = PLANET
                scope = this
            }
        }
    }
}