How change ruler traits on start of game?

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

Nerz

Second Lieutenant
7 Badges
Jul 10, 2016
120
0
  • Magicka 2
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
Hi! I whant to create a little mod for myself. I knew, how make event works on start of game and how to remove all traits of ruler, but i don't know how to add 3 traits. How can i do this?
 

primem0ver

Major
16 Badges
Jul 15, 2015
563
70
  • Stellaris
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • 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 - Green Cities
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Stellaris: Synthetic Dawn
I just found this on the Stellaris Wiki Effects list:
Code:
leader = { add_trait = leader_trait_carefree }
 

Nerz

Second Lieutenant
7 Badges
Jul 10, 2016
120
0
  • Magicka 2
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
Don't work :c
Looks like event isn't working completly.

Code of event(yep, i just trying to rewrite an event from "Select starting ruler traits"):
Code:
namespace = TOW_leader_start_traits

country_event = {
    id = TOW_leader_start_traits.1
    immediate = {
        every_owned_leader = {
            limit ={ leader_class = ruler }
            remove_trait = trait_ruler_corvette_focus
            remove_trait = trait_ruler_warlike
            remove_trait = trait_ruler_architectural_sense
            remove_trait = trait_ruler_home_in_the_sky
            remove_trait = trait_ruler_industrialist
            remove_trait = trait_ruler_deep_connections
            remove_trait = trait_ruler_charismatic
            remove_trait = trait_ruler_champion_of_the_people
            remove_trait = trait_ruler_expansionist
            remove_trait = trait_ruler_fertility_preacher
            remove_trait = trait_ruler_investor
            remove_trait = trait_ruler_space_miner
            remove_trait = trait_ruler_explorer
            remove_trait = trait_ruler_veteran_politician
            remove_trait = trait_ruler_scientific_mind
            remove_trait = trait_ruler_visionary
            remove_trait = leader_trait_adaptable
            remove_trait = leader_trait_resilient
            remove_trait = leader_trait_eager
            remove_trait = trait_mixed_money_on_the_mind
            remove_trait = trait_mixed_progressive
            remove_trait = trait_mixed_young_flame
            remove_trait = trait_mixed_meditations
            remove_trait = trait_ruler_secret_society
            remove_trait = trait_ruler_inspirational
            remove_trait = trait_ruler_diplomancer
            remove_trait = trait_ruler_leader_of_leaders
            remove_trait = trait_ruler_swagger
            remove_trait = trait_ruler_veteran_politician
            remove_trait = trait_ruler_visionary
            remove_trait = trait_ruler_great_wit
            remove_trait = trait_ruler_micromanager
            remove_trait = trait_ruler_navy_focus
            remove_trait = trait_ruler_army_veteran
            remove_trait = trait_ruler_navy_veteran
            remove_trait = trait_ruler_scientist
            remove_trait = trait_ruler_civil_engineer
            remove_trait = trait_ruler_talented_administrator
            remove_trait = ruler_trait_mark_of_infinity
            remove_trait = ruler_trait_resource_extraordinaire
            leader = { add_trait = ruler_trait_resource_extraordinaire }
            leader = { add_trait = ruler_trait_mark_of_infinity }
            leader = { add_trait = trait_ruler_talented_administrator }
            }
        }
    }
}
 

Nerz

Second Lieutenant
7 Badges
Jul 10, 2016
120
0
  • Magicka 2
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
Remove. but it still isn't work. Just spaming an empty window. Like on picture below
YtUchzZjYwU.jpg

And not remowe and not add any traits.
Remove leader = from last three lines, as it's already in leader (ruler) scope.
 

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
The event is empty because it has no title, desc, picture and option set. There is also an extra } at the end of event, though it causes no problem. I don't see any other obvious error in that code. What is in error.log?
 

Nerz

Second Lieutenant
7 Badges
Jul 10, 2016
120
0
  • Magicka 2
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
The event is empty because it has no title, desc, picture and option set.
But why window is showing? And why it opend evry game day?
What is in error.log?
Code:
[18:18:09][eventwindow.cpp:193]: Triggered Event TOW_leader_start_traits.1 has no valid options!
[18:18:10][eventwindow.cpp:193]: Triggered Event TOW_leader_start_traits.1 has no valid options!
[18:18:17][eventwindow.cpp:193]: Triggered Event TOW_leader_start_traits.1 has no valid options!
[18:18:18][eventwindow.cpp:193]: Triggered Event TOW_leader_start_traits.1 has no valid options!
Actualy its changing traits now, but event not finishing.
Code:
namespace = TOW_leader_start_traits

country_event = {
    id = TOW_leader_start_traits.1
    immediate = {
        every_owned_leader = {
            limit ={ leader_class = ruler }
            remove_trait = trait_ruler_corvette_focus
            remove_trait = trait_ruler_warlike
            remove_trait = trait_ruler_architectural_sense
            remove_trait = trait_ruler_home_in_the_sky
            remove_trait = trait_ruler_industrialist
            remove_trait = trait_ruler_deep_connections
            remove_trait = trait_ruler_charismatic
            remove_trait = trait_ruler_champion_of_the_people
            remove_trait = trait_ruler_expansionist
            remove_trait = trait_ruler_fertility_preacher
            remove_trait = trait_ruler_investor
            remove_trait = trait_ruler_space_miner
            remove_trait = trait_ruler_explorer
            remove_trait = trait_ruler_veteran_politician
            remove_trait = trait_ruler_scientific_mind
            remove_trait = trait_ruler_visionary
            remove_trait = leader_trait_adaptable
            remove_trait = leader_trait_resilient
            remove_trait = leader_trait_eager
            remove_trait = trait_mixed_money_on_the_mind
            remove_trait = trait_mixed_progressive
            remove_trait = trait_mixed_young_flame
            remove_trait = trait_mixed_meditations
            remove_trait = trait_ruler_secret_society
            remove_trait = trait_ruler_inspirational
            remove_trait = trait_ruler_diplomancer
            remove_trait = trait_ruler_leader_of_leaders
            remove_trait = trait_ruler_swagger
            remove_trait = trait_ruler_veteran_politician
            remove_trait = trait_ruler_visionary
            remove_trait = trait_ruler_great_wit
            remove_trait = trait_ruler_micromanager
            remove_trait = trait_ruler_navy_focus
            remove_trait = trait_ruler_army_veteran
            remove_trait = trait_ruler_navy_veteran
            remove_trait = trait_ruler_scientist
            remove_trait = trait_ruler_civil_engineer
            remove_trait = trait_ruler_talented_administrator
            remove_trait = ruler_trait_mark_of_infinity
            remove_trait = ruler_trait_resource_extraordinaire
            add_trait = ruler_trait_resource_extraordinaire
            add_trait = ruler_trait_mark_of_infinity
            add_trait = trait_ruler_talented_administrator
            }
    }


}
 

Risa

Lt. General
92 Badges
Mar 2, 2005
1.242
278
  • Semper Fi
  • Europa Universalis III Complete
  • Knights of Pen and Paper +1 Edition
  • Lead and Gold
  • The Kings Crusade
  • Magicka
  • Majesty 2
  • Europa Universalis III Complete
  • Penumbra - Black Plague
  • Europa Universalis IV: Res Publica
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • Rome Gold
  • Heir to the Throne
  • Sengoku
  • Ship Simulator Extremes
  • Sword of the Stars
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • 500k Club
  • Cities: Skylines
  • Surviving Mars: First Colony Edition
  • Europa Universalis III
  • Hearts of Iron II: Armageddon
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Commander: Conquest of the Americas
  • East India Company Collection
  • Arsenal of Democracy
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
It fires every day it doesn't have is_triggered_only = yes line or fire_only_once = yes line. The first line makes the event only triggered by other things (such as other events / special projects / on_action triggers / console / etc) instead of fires spontaneously. The second line makes the event fires only once, instead of indefinitely.
So you either use the first line, and add the event to on_game_start trigger; or use the second line.
 

Nerz

Second Lieutenant
7 Badges
Jul 10, 2016
120
0
  • Magicka 2
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
It fires every day it doesn't have is_triggered_only = yes line or fire_only_once = yes line. The first line makes the event only triggered by other things (such as other events / special projects / on_action triggers / console / etc) instead of fires spontaneously. The second line makes the event fires only once, instead of indefinitely.
So you either use the first line, and add the event to on_game_start trigger; or use the second line.
All works, thanks!