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

Aexrael

Captain
49 Badges
Nov 12, 2010
331
496
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Age of Wonders: Planetfall
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Shadowrun Returns
  • Surviving Mars: First Colony Edition
  • Cities: Skylines Industries
  • Stellaris: Megacorp
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Humanoids Species Pack
  • Age of Wonders: Planetfall Deluxe edition
  • Age of Wonders: Planetfall Premium edition
  • Age of Wonders: Planetfall Season pass
  • Age of Wonders: Planetfall Sign Up
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Cities: Skylines - Snowfall
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - After Dark
  • Surviving Mars
  • 500k Club
  • Age of Wonders: Shadow Magic
  • Age of Wonders
  • Age of Wonders II
  • Cities: Skylines - Green Cities
  • Leviathan: Warships
  • Majesty 2
  • Majesty 2 Collection
  • Cities: Skylines Deluxe Edition
  • Shadowrun: Dragonfall
  • Stellaris: Distant Stars
  • Crusader Kings II
  • Cities: Skylines
  • Age of Wonders: Planetfall - Revelations
  • Shadowrun: Hong Kong
Last night Axelius and I talked about why my two prescripted empires weren't working when both mods were enabled at the same time.

The pre-scripted empires were setup such that when you start playing as one of them, they would fire on_action_start and be granted certain technology.

Example
Code:
on_game_start={
    events = {
        synthetics_tech.1
    }
}
Code:
namespace = synthetics_tech

#event = {
    id = synthetics_tech.1
    hide_window = yes
    is_triggered_only = yes
    
    immediate = {
        every_country = {
            limit = { has_country_flag = synthetics }
            give_technology = tech_robotic_workers
            give_technology = tech_droid_workers
            give_technology = tech_synthetic_workers
            give_technology = tech_synthetic_leaders
        }
    }
}
But what happens when you have multiple separate mods using on_action triggers is that the one which is loaded last, is the only one working. This also, as per Aexlius' testing, seem to affect default on_action events, that is mods are overwriting the default on_action events.

Something you can do instead is avoid using on_actions all together, and set up events using country_event

Example
Code:
country_event = {
    id = synthetics_tech.1
    hide_window = yes
    fire_only_once = yes

    trigger = {has_country_flag = synthetics}
    immediate = {
            give_technology = tech_robotic_workers
            give_technology = tech_droid_workers
            give_technology = tech_synthetic_workers
            give_technology = tech_synthetic_leaders
        }
}

Alternatively, if you don't want the event to fire on the first consecutive day, you can insert

Code:
mean_time_to_happen = {days = 0}

And define a value greater than 0, it should trigger after that many subsequent days have passed since start.

Thanks to Axelius and Warial and others whom spend their time answering questions and helping out other modders. It's an uphill battle when there is so little information available on how to properly set up mods.
 
@Divine we really need a better system. At least for on_actions. Mods without replace command should be appending events and not overwriting one another (unless dependency is set of course), especially not vanilla events! Now modders have no option, but to combine mods into one and/or create compatibility patches. For some it might be better, but for others, who prefer to cherry-pick mods they want to use, it's a major issue.

Another thing is overwriting vanilla files. Right now you can either replace whole vanilla file or none. Could it be possible to make it so a duplicate record in an another file overwrites a previous one?

I know it's no small request, but from what I've seen over at EU4 forums, small mod incompatibility will be destructive for mod community.
 
It happens immediately, or well, after the first update the game does on a new day. That said, looking at it now it might be better performance wise to have it not have a trigger but a limit in the immediate instead, that way the event will fire for every country on the first update and then get discarded from memory. Although that is without knowing how the game handles memory allocation for the events.
 
Also, such a program would not take long to run, as it should know the location of every files and the file format is pretty simple. It could perhaps even be run as a part of the game on startup or as part of a mod manager.
 
Took a wrong turn and deleted my post... thanks for answering about event firing.
Also, such a program would not take long to run, as it should know the location of every files and the file format is pretty simple. It could perhaps even be run as a part of the game on startup or as part of a mod manager.

Yeah that was my reasoning too. But with steam auto-downloading updated mods, launching it on startup is a better solution I think. In the end it's just a bandaid, what we really need is having on_actions not override each other.
 
Yes this is an oversight. The on action entries in the on_actions folder will currently overwrite any entry already existing with the same name
(eg if we have already read on_game_start = { ... } somewhere then the next file that has a on_game_start = { ... } entry will overwrite that entry and take it's place).

The proper functionality should instead just append event IDs to the on_action lists if we read an entry multiple times. I'll try to work on a fix for that next week.
 
  • 7
  • 4
Reactions:
That is very likely. There tends to be some new ones accompanying new mechanics with patches for our previous games. And if you figure out some useful on_actions feel free to suggest them to the suggestion thread in this sub-forum: https://forum.paradoxplaza.com/forum/index.php?threads/modding-suggestions.928316/ and I and Captain Gars will try to add as many features as we have time to do. As a general rule of thumb it will also be helpful if the suggestions are as generic as possible because we tend to favor suggestions that would benefit more modders over super specific suggestions.
 
  • 1
Reactions: