• 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.
Any tutorials out there for that? Not somthing I've done before.
Don't know of a specific guide for Events in particular, but there's the general modding guide:

If you understand the basics of modding, understanding events shouldn't be too hard, though, since the coding language is designed to be easy to read.

The main thing to understand is that usually an on_action (in the Common Folder) is used to trigger an event in the events folder, and that you can use the error.log in Documents\Paradox Interactive\Stellaris\logs to find the mistakes you're making. From that point onwards, it's most just trial and error, and using the game files (or similar mods) as reference points.
 
Don't know of a specific guide for Events in particular, but there's the general modding guide:

If you understand the basics of modding, understanding events shouldn't be too hard, though, since the coding language is designed to be easy to read.

The main thing to understand is that usually an on_action (in the Common Folder) is used to trigger an event in the events folder, and that you can use the error.log in Documents\Paradox Interactive\Stellaris\logs to find the mistakes you're making. From that point onwards, it's most just trial and error, and using the game files (or similar mods) as reference points.

Looking at existing examples is generally a big part of how i learn so i get that. the issue is I've never done anything event scripting related at all in stellaris. So i'm not sure where to start or even where to find something that does anything similar to use as an example to learn from.
 
Certain buildings in particular or the entire set?

The base bio trophy building, i'm creating a mod to test out putting bio trophy jobs on city districts, so now that building isn't needed at the start, but i want to leave it in as somthing you can still build on planets as an option for flexibility.
 
The base bio trophy building, i'm creating a mod to test out putting bio trophy jobs on city districts, so now that building isn't needed at the start, but i want to leave it in as somthing you can still build on planets as an option for flexibility.

The initial placement of the organic sanctuary is in \common\scripted_effects\01_start_of_game_effects.txt line 1246.

The buildings themselves are in \common\buildings\08_unity_buildings.txt line 2180 onwards.
 
The initial placement of the organic sanctuary is in \common\scripted_effects\01_start_of_game_effects.txt line 1246.

The buildings themselves are in \common\buildings\08_unity_buildings.txt line 2180 onwards.

Cheers, riyka had already given me that info, but thanks all the same. Now trying to figure out how to make a script to replace said building after game start so i don't have to edit the start of game effects file. I think i can write most of it, just not sure what i need to do to make it run once only at the start of the game before the player can do anything.
 
You do that by creating an on_action (common\on_actions), since on_actions trigger events when specific conditions are met.

In this case, you probably want to hook your event into on_game_start_country, which allows you to hook a country_event to it that can do all the necessary checks and replace the building.
 
  • 1Like
Reactions:
You do that by creating an on_action (common\on_actions), since on_actions trigger events when specific conditions are met.

In this case, you probably want to hook your event into on_game_start_country, which allows you to hook a country_event to it that can do all the necessary checks and replace the building.

Thank you that helps enormously.
 
Is there a way to steal diplomatic weight from other empires? I am aware of the function used in federations, but was thinking of the galactic empire if a resolution could tax other empires a certain amount of diplomatic power and give it to the emperor?
 
Is there a way to steal diplomatic weight from other empires? I am aware of the function used in federations, but was thinking of the galactic empire if a resolution could tax other empires a certain amount of diplomatic power and give it to the emperor?

I don't think you can steal diplomatic weight because it is tied to the empire's military, economic, tech, and population. Though you can "borrow" it by using favors.
 
Hello,

I am trying to create new ship models. I managed to create the .mesh-files and the materials in Blender, which look really nice. I also manged to import the models into Stellaris and bake some textures. The diffuse and normal textures look fine in game. But I do not understand the specular texture or better how the different channels interact.

I searched the web an found this description (https://forum.paradoxplaza.com/forum/threads/issues-with-textures-models.1140675/#post-25059483):

3. The specular map has material data in it's channels
R - Nation color (Not in active use, left black)
G - Specular (fill material areas with distinct values, leather should be one value, metal another. We usually block these in and avoid making gradients)
B - Metalness (Anything that isn't metal should be black, metal areas are filled in with a higher value, giving it reflectiveness)
A - Gloss (How 'polished' the area is, black (0) means the surface looks rough, white (255) means the area looks polished, and thus also more reflective)


From Blender I bake 4 textures - diffuse, normal, emission, roughness and metalness (metal information pluged into roughness and baked as roughness).

I then try to generate the specular texture with the last two textures:

red - left black
green - metalness (I only have different metals)
blue - metalness
alpha - roughness inverted

But then in game the rough not so metal whiteish iron parts reflect the sunlight quite drastically and the polished golden parts are rather dim and dark, which is not what I had expected.

I played around with setting all three channels (green, blue, alpha) to either complete white or complete black, to somehow understand how the refelectiveness is determined in game. But had no success.

Is there somewhere an in depth description, how exactly to set up the specular maps? How to set the material values for the green channel? .. And how do the reflectivenesses (??) of the last two channels interact/depend on each other (and also maybe with the colour of the diffuse texture) - or am I getting something completely wrong?
 
Hello again,

I have a different question concerning ship models.

What would be the best strategy for getting the best game performance - or how does Stellaris load the ship textures?

As far as I know, the game engine can not cope with huge models. In order to import such models into Stellaris, it is possible to separate the model in different scenes in Blender (maybe called layers in Maya). Now, I can unwrap every scene and bake the 3 textures (diffuse, normal, specular) for it.

But I could also only bake three textures for the complete model and do the separation into scenes afterwards. This would leave me with less textures and thus - possibly - less files and lower disk space used. Resolution aside, how does Stellaris load the textures? Would it load the complete-model-textures only once and assign the relevant parts of the texture to the model-scenes or would it load it for every scene?
 
I would like megacorporations that are Subsidiary of another megacorporation to adopt oligarchic government with the Civic Merchant Guilds.
I looked around the creation of an event, yeah, I don't understand everything.
n short, it gave this:

Code:
namespace = fixcorporation

country_event = {
    id = fixcorporation.1
    hide_window = yes
    is_triggered_only = yes
    
    trigger = {
        is_subject_type = subsidiary
        has_authority = auth_corporate
    }
    
    immediate = {
        change_government = {
        authority = auth_oligarchic
        civics = {
                civic = civic_merchant_guilds
                civic = random
            }
        remove_invalid_civics = yes
        }
     }
}

As an error, I have: [18:08:14][event.cpp:665]: Script Error, attempting to fire country scope event fixcorporation.1 on no_scope

If anyone can help, it will warm the heart of a nice lithoids.
 
Good day. Can you please tell me how to add planetary features?
I want to edit the guaranteed colonies of Sirius and Alpha Centauri in sol_initializers and add a certain number of planetary features to these planets.
For example, I want to add deposit features called "Isolated Valley" to Sirius, how do I do that? How do I add several of the same features? How to make it so that no other features appear besides those that I added? Thanks in advance.
 
As an error, I have: [18:08:14][event.cpp:665]: Script Error, attempting to fire country scope event fixcorporation.1 on no_scope
This likely means you're trying to use an on_action that does not have a scope (or are trying to trigger it from another scope-less event).

Depending on what you're hooked into, you either need to use the version of the on_action that has a _country at the end (if it exists), or use the on_action in combination with an event = {}, instead of a country_event = {}, and then loop through all countries via every_country = {}.
 
Good day. Can you please tell me how to add planetary features?
I want to edit the guaranteed colonies of Sirius and Alpha Centauri in sol_initializers and add a certain number of planetary features to these planets.
For example, I want to add deposit features called "Isolated Valley" to Sirius, how do I do that? How do I add several of the same features? How to make it so that no other features appear besides those that I added? Thanks in advance.

Example (Alpha Centauri):
Code:
    planet = {
        count = 1
        orbit_distance = 30
        class = ideal_design_class
        orbit_angle = { min = 90 max = 270 }
        size = { min = 12 max = 18 }

        init_effect = {
            set_planet_flag = prescripted_ideal        # used by code, do not remove
            add_deposit = d_alien_pets_deposit
        }
    }
 
  • 1
Reactions:
Ok trying to do somthing a bit different. (Given whats been announced for lem so far i'm back burning my rouge servitor mod, nearly had somthing i was ready to share :( ), but thats moved my next project to the front of the queue. Making starbases and especially defence platforms less wimpy and doing some tweaking of military in general. One of the things i want to do is apply modifiers, (specifically flat additive amounts of shield, armour, and health) to them based on certain techs having been researched. The ship_sizes files don't support "triggered_modifier", so i'm not sure how to do it. Is this another scripting one or just i need to be doing the work elsewhere?

Edit Note: some of the effects i want to apply will rely on more than one tech being researched.
 
Hi all.
Using in-game console I type RUN command. The invoked file contains smth like this:
add_trait_leader 0 leader_trait_ruler_machine_intelligence
add_trait_leader 0 leader_trait_flexible_programming
add_trait_leader 0 leader_trait_newboot
Is there any way to parametrise 0 to some variable like in shell-scripts?
 
Unrelated to the above. Is there any way to write a mod that will output data, (specifically current research per month and research rate modifiers) to a logfile at set intervals?