• 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.
Showing developer posts only. Show all posts in this thread.

Divine

Tech Lead
Paradox Staff
33 Badges
Dec 26, 2005
593
1.094
  • Semper Fi
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Europa Universalis III Complete
  • Magicka
  • March of the Eagles
  • Europa Universalis III Complete
  • Victoria: Revolutions
  • For the Motherland
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Magicka 2 - Signup Campaign
  • Stellaris Sign-up
  • Crusader Kings II
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Diplomacy
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
This thread is meant to keep you updated on what modding features the Usermod Coordinators (currently myself and @Captain Gars). We will regularly post here on what we implement to the game. Feel free to comment or ask questions about the things that we have implemented in this thread. However this is NOT the thread for making suggestions for modding features or reporting bugs there are other threads for that purpose already.

FAQ:
Q:
When will we get these features that you post about?
A: In an upcoming patch. We don't really have too much to say about when our stuff will hit the live versions but if we deem them important or game-breaking for mods we are probably already pushing for releasing our fixes.
 
  • 12
  • 1Like
  • 1
Reactions:
There are some fixes in it that will not be posted here but should be available in the changelog for the patch. But from now on we will try to keep this thread updated with most of the relevant modding additions.

Updates:
- Added num_energy trigger.
- Reading a single on_action entry from multiple files will now append the events to the list entry rather than overwriting it. This should allow more mods to be compatible.
- Prescripted countries can now set the attribute "disallow_editing = yes" to disable the edit button in the Empire selection view before game start.
 
  • 9
Reactions:
Will you be adding the dummydefines.lua to the game like in ck2? I think it would make modding the defines a lot clearer to noobs and i believe Captain Gars had commented on the idea.
We've added a header comment in the 00_defines.lua explaining how to go about when modding define values.

If you want to replace a specific on_action, how can you do that after this change?
You have two options. The straight-forward version is to replace the 00_on_actions.txt with your own on_actions file (either by using the same name or by using replace_path in the .mod file). This will however require you to keep your own on_actions file with all the relevant on_action entries that you want to keep alive and will likely make your mod incompatible with other mods that are replacing the on_actions file.

The other way would be to instead replace the event files that keep the events that are fired from the on_action entry you would like to avoid. If you remake these events to hide_window events with either an empty immediate or option they are basically null events that will have no effect. If they have a place in the random events list then also make sure to put a modifier on the events weight_modifier with an always = yes trigger and factor = 0.

It will still be a bit messy to replace things in the on_actions file but at least it's easier to append things now. I hope this will help some modding efforts.
 
  • 4
Reactions:
On appending items to random_events in on_actions:

I would like to add some random colony events but I would like to keep the overall frequency the same. At the moment, in on_colony_1_year_old, the first line of random_events is "300 = 0", and the total weight of other events in core is around 25, leading to 10% event chance.

Let's say I now add another 25 total weight of new events, leading to roughly 50 event weight total in the modded version. Would I be able to add another "300 = 0" line in the modded on_colony_1_year_old.random_events, so that the total weight of "no event" is 600, and thus the original ratio of 10% is preserved?

Thanks!
Yes, from reading the code I think it should be possible to have multiple empty entries (actually it also seems possible to have multiple entries with the same event-ids).

Where would be the best place to request new effects/triggers or just more modding abilities in general?

Some effects I would love to see:
get_species_name =
set_species_name =
change_founder_species = (change_dominant_species seems to do nothing/be broken)

And the ability to set weights on species_classes being chosen by ai (rather than just randomized = yes/no)

Got plenty more, but I don't want to spam the thread if this isn't the place for it.
https://forum.paradoxplaza.com/forum/index.php?threads/modding-suggestions.928316/
This thread is supposed to be dedicated to modding improvement suggestions.
 
  • 1
Reactions:
- The Ruler entry in pre-scripted countries now allow ruler traits to be defined.
- change_dominant_species now allows last_created as argument.
- create_new_species effect now allows a namelist entry. Valid right-hand-side arguments for namelists are random which picks a random namelist, random_class which picks a random namelist but limits it to the same class (namelists must be named <tag># to be considered as a member of that classtag), a tag for a namelist or a scope of country/pop/species/leader-type.
 
Last edited:
That already works? I'm using the line:
Code:
change_dominant_species = last_created_species
And it works perfectly already. Did you mean something else?

And can these changes be expected when 1.1 comes out or are we looking at 1.2?
Oh, you learn something new every day. I actually meant that last_created should now be a valid argument. Another modder pointed out that last_created worked in some other effects but not this one. So at least now it's consistently overdone with other effects.

About the relevant patch for our changes it's not in our power and we don't know either unless we're pushing a fix for specific problems that would be total showstoppers for modders. So it's just to keep an eye on the changelogs.

Does max_influence exist as a modifier, or can it be added?
max_influence exists as a modifier and should work in the same way as max_energy or max_minerals. Trying to keep things tidy in this thread however I would prefer if these questions are asked in the quick questions thread and if it's a non-existent mod functionality that you would request then post in the suggestions thread. This thread is meant to give the possibility to comment or ask questions about the implemented changes.
 
Last edited:
- Added calc_true_if trigger.
Example usage:
Code:
calc_true_if = {
    amount = 2
    has_monthly_income = { 
        resource = energy
        value > 5
    }
    has_monthly_income = { 
        resource = minerals
        value > 5
    }
    has_monthly_income = { 
        resource = influence
        value > 5
    }
}
Which will return true if you have more than 5 monthly income in at least 2 out the three resources designated by the triggers. Inside the calc_true_if block any trigger should work.
 
  • 2
  • 1
Reactions:
So like this?

Code:
    # Ruler
    ruler={
        gender=female
        name="Kathleen Savage"
        portrait="human_female_04"
        texture=0
        hair=1
        clothes=4
        ruler_title="King"
        ruler_title_female="Queen"
        trait="trait_ruler_logistic_understanding"
        trait="leader_trait_fleet_organizer"
    }
Yes and no. Right now you can only define ruler traits for the leader. But the syntax is correct.
 
- Added new localisation promotions.
- Added new localisation functions in SpeciesScope; GetNamePlural, GetClass, GetClassPlural, GetNameInsult, GetNamePluralInsult, GetNameCompliment, GetNamePluralCompliment, GetSpawnName, GetSpawnNamePlural, GetOrganName, GetMouthName, GetRandomSpeciesSound.
- Added new localisation function in LeaderScope: GetRulerTitle.
- Added trigger has_spaceport_construction.
- Added trigger is_researching_technology.

The localisation promotions added are the following:
(Armyscope).Leader -> (Leaderscope)
(Armyscope).Planet -> (PlanetScope)
(EmpireScope).Ruler -> (LeaderScope)
(EmpireScope).Heir -> (LeaderScope)
(EmpireScope).Species -> (SpeciesScope)
(ShipScope).Fleet -> (FleetScope)
(FleetScope).Leader -> (LeaderScope)
(FleetScope).System -> (SystemScope)
(SystemScope).Owner -> (EmpireScope)
(SystemScope).Sector -> (SectorScope)
(LeaderScope).Species -> (SpeciesScope)
(PlanetScope).Leader -> (LeaderScope)
(PlanetScope).Sector -> (SectorScope)
(PopScope).Species -> (SpeciesScope)
(SectorScope).Leader -> (LeaderScope)
 
  • 1
  • 1
Reactions:
I took the leader_trait from 00_ruler_traits.txt it may be that leader_trait_fleet_organizer, leader_trait_nervous and leader_trait_hive_mind are missplaced in that file and should be in 00_generic_leader_traits.txt instead then, or should infact be ruler traits and should be changed to trait_ruler_ instead of leader_trait_.
My mistake. You are indeed correct. I thought it was a generic leader trait because of the tag but it does seem like it's actually a ruler trait.
 
As I understand it, we have:

set_building
remove_blocker
create_spaceport
set_spaceport_module

but only:
add_building_construction

Will be new effects like:
add_spaceport_construction
add_spaceport_module _construction
add_blocker_removing
?
Can you please check for me that it's posted in the suggestions thread. I will probably prioritize it quite high for the sake of consistency but it might get lost if it's not on the list.
 
- Fixed an issue with random_owned_fleet effect.
- Added every_owned_fleet effect to complement random_owned_fleet.
- Added is_subject and is_overlord triggers.
- Fixed an issue with the potential trigger in country edicts not always hiding the edicts.
- Debug tooltips should now also show event flags and variables for countries and event flags for fleets and ships.
- Added any_subject trigger.
- Added every_subject, random_subject effects.
 
  • 4
Reactions:
Update:

- Added subtract_variable effect
- Added multiply_variable effect
- Added divide_variable effect
- Variable effects and triggers can take a scope as value
- Variable effects and triggers can take a variable name as value

Code:
multiply_variable = { which = test1 value = test2 }
subtract_variable = { which = test1 value = FROM }

The first example will multiply test1 with test2. The second one will subtract FROM's test1 from test1.
 
  • 7
Reactions:
- Added clear_resources effect.
- Added set_species_homeworld effect.

Example usage:
Code:
planet_event = {
    ...
    immediate = {
        every_tile = {
            clear_resources = yes
        }
    }
}

Code:
country_event = {
    ...
    immediate = {
        species = {
            set_species_homeworld = event_target:my_planet_scope
        }
    }
}
 
  • 3
  • 1
Reactions:
So clear_resources made it in to Asimov beta. Yay!

But...

Code:
planet_event = {
    id = synthetic_empire_event.4
    is_triggered_only = yes
    hide_window = yes

    immediate = {
        every_tile = {
            limit = { has_building = "building_hydroponics_farm_1" }
            remove_building = yes
            set_building = "building_power_plant_1"
            clear_resources = yes
            add_deposit = d_rich_energy_deposit
        }
        every_tile = {
            limit = { has_deposit = "d_farmland_deposit" }
            clear_resources = yes
            add_deposit = d_energy_deposit
        }
    }
}

The first every_tile works, but I can't get the other to work. I suspect it's because has_deposit either doesn't work like this or because the starting planet resources are called something entirely different. Any suggestions Divine, I want to replace the +1 Food tiles with +1 Energy?

Unfortunately the +1 food and the other initial spawn tile resources are not added using deposits. They are using the older system with resources instead. It's confusing that it's using an overlapping system.
I would try to identify the tile with:
Code:
has_resource = {
    type = food
    amount > 0
}

@Divine so no chance we will get targeted decisions? We could seriously use the ability to add new right click functionality :D

There's a plan down the line to add more functionality to the custom script buttons. We'll see if that covers the intended usage of targeted decisions.
 
I know I'm not the best at posting in the suggestions thread but I'm reading it and planning new additions according to the posts in that thread. It's however an impossible job to implement everything. This thread is however meant to be an early channel for me to tell about upcoming mod-changes and to comment on the implemented functionality so please try to keep this thread on topic.
 
  • 2
Reactions:
Any hope of the scopes being fixed by Asimov's release? Or is this something that we're gonna have to wait awhile for? This is a game changing feature for modders, so it'd be nice to actually be able to fully explore it while you are all on vacation.
Unfortunately I think it won't make it to Asimov's release. I'm currently occupied by implementing some mod features for CK before my focus is back to Stellaris and I don't think anyone else has time to look at it before Asimov. However once I get back on Stellaris it's one of the top things I want to look at.