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

ShadowDragon868

Captain
61 Badges
Jun 11, 2012
395
431
  • Crusader Kings II
  • A Game of Dwarves
  • Stellaris: Synthetic Dawn
  • Stellaris: Lithoids
  • Age of Wonders III
  • Steel Division: Normand 44 - Second Wave
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Surviving Mars: Digital Deluxe Edition
  • Steel Division: Normandy 44 -  Back to Hell
  • BATTLETECH - Digital Deluxe Edition
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Surviving Mars: First Colony Edition
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Imperator: Rome
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • Knights of Pen and Paper 2
  • Battle for Bosporus
  • Stellaris: Federations
  • Hearts of Iron 4: Arms Against Tyranny
  • Stellaris: Nemesis
  • Crusader Kings III
  • Hearts of Iron IV: La Resistance
  • Knights of Pen and Paper +1 Edition
  • Hearts of Iron IV: By Blood Alone
  • 500k Club
  • Magicka: Wizard Wars Founder Wizard
  • Stellaris: Necroids
  • BATTLETECH: Heavy Metal
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • BATTLETECH
The events system in this game is ridiculously obtuse, and I couldn't find any useful guides.

Of course, I'm also painfully exhausted, but anyway.

Say I wanted an event to fire once and only once, after the game started. How would I go about making it check every race to see if they had a specific trait, and if they did, adding another specific trait?

Or, say I wanted to make it fire for everybody, after they research a specific tech, and have it then add another tech to the "always drawn, has a small % already researched" list at the bottom of the tech tree, like if they had reverse-engineered something. Would that be possible, too?
 
  • 1
  • 1
Reactions:
Say I wanted an event to fire once and only once, after the game started. How would I go about making it check every race to see if they had a specific trait, and if they did, adding another specific trait?

Can't write everything for everyone, but since the first was easy:

Code:
event = {
    id = my_event.1
    hide_window = yes
    is_triggered_only = yes
    fire_only_once = yes

    immediate = {
        every_country = {
            limit = { has_trait = "trait_to_check" }
            add_trait = trait_to_add
        }
    }
}

And fire it from on_actions with:
Code:
on_game_start = {
    events = {
        my_event.1
    }
}

But you should look through other mods and the default game files and you can pick up the event coding fairly easily.