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

mac2636

Major
76 Badges
Mar 14, 2011
648
85
  • Crusader Kings II
  • Crusader Kings II: Reapers Due
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III Collection
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Cities in Motion
  • 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
  • Hearts of Iron IV: Together for Victory
  • Crusader Kings II: Monks and Mystics
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • BATTLETECH
  • Surviving Mars
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Age of Wonders
  • Age of Wonders II
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Hearts of Iron 4: Arms Against Tyranny
  • 500k Club
  • Victoria 2
So I dug through the Kerbal Space Program mod to try to learn how to set up events at the start game. I thought I had a handle on it, but I seam to be missing something. Even if I trigger it via console command it still does not do anything.
Does anyone notice what I am missing?
Thank you so much in advance for any help.


prescripted_countries
Code:
Federation = {
    name = "My Earth Federation"
    spawn_enabled = no # yes / no / always
   
    name_list = "Human"
    ship_prefix = "NCC"
   
    species_name = "Human"
    species_plural = "Humans"    #we should localize this!
    species_adjective = "Human"
    species_class = "MAM"
    trait = "trait_quick_learners"
    trait = "trait_nomadic"
    trait = "trait_innovative"
    trait = "trait_charismatic"   
    portrait = "human"
    adjective = "Human"
   
    government = "indirect_democracy"
    ethic = "ethic_xenophile"
    ethic = "ethic_fanatic_individualist"

    #flags = { human_1 custom_start_screen }
    flags = { MyFed_space_program }

events
Code:
namespace = MyFed

### Game Start Event
event = {
    id = MyFED.1
   
    hide_window = yes
    is_triggered_only = yes
   
    immediate = {
         ####Add My Feds
        every_country = {
            limit = {
                has_country_flag = MyFed_space_program
                #has_country_flag = add_MyFeds
            }
            country_event = { id = MyFed.2 }
        }
#       
#        ### Spawn Kerbol System
#        if = {
#            limit = {
#                NOT = {
#                    any_country = {
#                        species_portrait = kerbal
#                    }
#                }
#            }
#            random_system = {
#                limit = { NOT = { has_owner = yes } }
#                spawn_system = { initializer = "primitive_kerbol_init" }
#            }
#        }
#    }
}
country_event = {
    id = MyFed.2
   
    hide_window = yes
    is_triggered_only = yes
   
    immediate = {
        #Kill all exisiting leaders
        every_owned_leader = {
            kill_leader = { type = scientist show_notification = no }
            kill_leader = { type = governor show_notification = no }
        }
        #Add new ones       
        create_leader = {
            type = scientist
            species = owner_main_species
            name = "Jonathan Archer"
            skill = 5
            set_age = 52
            portrait = "human_male_01"
            traits = {
                trait = trait_ruler_charismatic
                trait = trait_ruler_deep_connections
            }
        }
        create_leader = {
            type = scientist
            species = owner_main_species
            name = "Ronnie McAlister"
            skill = 5
            set_age = 24
            portrait = "human_male_01"
            traits = {
                trait = leader_trait_meticulous
                trait = leader_trait_careful
            }
        }
        create_leader = {
            type = scientist
            species = owner_main_species
            name = "Mary McAlister"
            skill = 0
            set_age = 24
            portrait = "human_male_01"
            traits = {
                trait = leader_trait_careful
                trait = leader_trait_expertise_computing
            }
        }
        create_leader = {
            type = scientist
            species = owner_main_species
            name = "Christine Putnam"
            skill = 0
            set_age = 25
            portrait = "human_female_01"
            traits = {
                trait = leader_trait_roamer
                trait = leader_trait_meticulous
            }
        }
        create_leader = {
            type = governor
            species = owner_main_species
            name = "John Watkins"
            skill = 0
            set_age = 45
            portrait = "human_male_01"
        }
        remove_country_flag = add_MyFeds
    }
}

common\on_actions
Code:
# Triggers when the game starts
on_game_start = {
    events = {
        MyFed.1
       
        game_start.1
        game_start.2
        game_start.3
        game_start.4
    }
}
 
Seems namespace can not be uppercase and your forget a }

This works when you trigger "event myfed.1" or "event myfed.2" in the console:

Code:
namespace = myfed

### Game Start Event
event = {
  id = myfed.1
   
  hide_window = yes
  is_triggered_only = yes
   
  immediate = {
  ####Add My Feds
  every_country = {
  limit = {
  #has_country_flag = MyFed_space_program
  #has_country_flag = add_MyFeds
         is_ai = no
  }
  country_event = { id = myfed.2 }
  }
#   
#  ### Spawn Kerbol System
#  if = {
#  limit = {
#  NOT = {
#  any_country = {
#  species_portrait = kerbal
#  }
#  }
#  }
#  random_system = {
#  limit = { NOT = { has_owner = yes } }
#  spawn_system = { initializer = "primitive_kerbol_init" }
#  }
#  }
  }
}
country_event = {
  id = myfed.2
   
  hide_window = yes
  is_triggered_only = yes
   
  immediate = {
  #Kill all exisiting leaders
  every_owned_leader = {
  kill_leader = { type = scientist show_notification = no }
  kill_leader = { type = governor show_notification = no }
  }
  #Add new ones   
  create_leader = {
  type = scientist
  species = owner_main_species
  name = "Jonathan Archer"
  skill = 5
  set_age = 52
  portrait = "human_male_01"
  traits = {
  trait = trait_ruler_charismatic
  trait = trait_ruler_deep_connections
  }
  }
  create_leader = {
  type = scientist
  species = owner_main_species
  name = "Ronnie McAlister"
  skill = 5
  set_age = 24
  portrait = "human_male_01"
  traits = {
  trait = leader_trait_meticulous
  trait = leader_trait_careful
  }
  }
  create_leader = {
  type = scientist
  species = owner_main_species
  name = "Mary McAlister"
  skill = 0
  set_age = 24
  portrait = "human_male_01"
  traits = {
  trait = leader_trait_careful
  trait = leader_trait_expertise_computing
  }
  }
  create_leader = {
  type = scientist
  species = owner_main_species
  name = "Christine Putnam"
  skill = 0
  set_age = 25
  portrait = "human_female_01"
  traits = {
  trait = leader_trait_roamer
  trait = leader_trait_meticulous
  }
  }
  create_leader = {
  type = governor
  species = owner_main_species
  name = "John Watkins"
  skill = 0
  set_age = 45
  portrait = "human_male_01"
  }
  remove_country_flag = add_MyFeds
  }
}

If it still does not work on game start it's maybe a problem with your flag.