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.
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
I'm not entirely sure what you want, but this is a great question that hasn't been handled very well in other threads. I'm sure someone will come looking for some information via the search bar. Anyways, here is some code from the Star-Spawn of Cthulhu mod for generating a custom space-faring empire and custom species when the game starts. I hope this helps someone.
Just change all the Cthulhu parts to meet your needs. =)
/common/on_actions/11_chr_on_actions.txt
===================================
Set-up a game start action so we can choose if we want our empire in this galaxy or not.
on_game_start = {
events = {
story.2900 #Creates window to check if we want to spawn our empire
}
}
/events/12_chr_story_events.txt
=========================
Makes the window appear for the game start choice (Spawn Cthulhu vs Burn the Necronomicon)
namespace = story
#Necronomicon (Full version in the actual mod, this is cut down to one choice)
country_event = {
id = story.2900
title = story.2900.title
picture = GFX_evt_necronomicon
show_sound = event_alien_nature
/events/11_chr_build_empires.txt
==========================
This is where I like to keep clean code for spawning the empires and replacing generated leaders.
namespace = buildempire
#Build Star-Spawn of Cthulhu Empire
country_event = {
id = buildempire.1
hide_window = yes
is_triggered_only = yes
#Add Cthulhu
country_event = {
id = buildempire.2901
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 }
kill_leader = { type = ruler show_notification = no }
}
#Add new Cthulhu
create_species = {
name = "Great Old One"
plural = "Great Old Ones"
adjective = "Great Old Onelike"
class = "PLA_CHR"
portrait = "cthulhu_oldone"
#homeworld = THIS
traits = {
trait = "chr_trait_strange_aeons"
trait = "chr_trait_cosmic_horrors"
}
}
create_leader = {
type = ruler #scientist governor
species = last_created
name = "Cthulhu"
skill = 0
set_age = 90000
traits = {
trait = trait_ruler_world_shaper
trait = trait_ruler_warlike
}
}
assign_leader = last_created_leader
remove_country_flag = add_cthulhu
}
}
/solar_system/initializers/11_chr_system.txt
==================================
This is the code where the acutal 'empire' is hidden. It won't spawn unless you force it to.
## Black Hole System
chr_cthulhu_system_npc = {
name = "Twenty Third Nebula"
class = "sc_black_hole"
asteroids_distance = 50
flags = { cthulhu_system cosmichorror_system}
max_instances = 1
usage_odds = 0 #No chance of spawning naturally. The opposite is like 20000? I think
planet = {
name = "The Wanderer"
count = 1
class = pc_black_hole
orbit_distance = 10
orbit_angle = 1
size = { min = 20 max = 20 }
has_ring = no
}
change_orbit = 10
#Binary Black Hole
planet = {
name = "Infernal Twin"
count = 1
class = pc_black_hole
orbit_distance = -10
orbit_angle = 180
size = { min = 20 max = 20 }
has_ring = no
}
planet = {
name = "Vhoorl"
class = pc_continental
orbit_distance = 60
orbit_angle = 340
size = 20
has_ring = no
entity = "continental_planet_01_entity"
tile_blockers = none
modifiers = none
planet = {
count = { min = 3 max = 3 }
orbit_distance = 25
class = random_non_colonizable
orbit_angle = { min = 90 max = 270 }
}
#neighbor_system = {
# distance = { min = 10 max = @distance }
# initializer = "neighbor_t1"
#}
#neighbor_system = {
# distance = { min = 10 max = @distance }
# initializer = "neighbor_t1_first_colony"
#}
}
/localisation/chr_I_english.yml
========================
This contains English words to use for our event window that appeared earlier.
#NECRONOMICON
#Beginning settings for the mod
story.2900.title:0 "Necronomicon Discovered"
story.2900.desc.1:0 "Through dreams most dark, your species has uncovered the location of a forbidden tome your people have loathsomely titled \"Necronomicon\". Within, it depicts rites of summoning the Old Ones."
story.2900.desc.2:0 "Following [Root.GetRulerTitle] [Root.GetRulerName]'s inexorable rise to power, the loathsomely titled \"Necronomicon\" has been claimed. As it falls into the outstretched vile clutches of [Root.GetRulerName], it is within their power to call other Old Ones to this plane of existence."
story.2900.option.1:0 "Host a grand summoning ritual"
story.2900.option.1.tooltip:0 "Brings forth Cthulhu."
story.2900.option.2:0 "Destroy it"
story.2900.option.2.tooltip:0 "Nothing happens... for now?"
What i want is to see how assigning portraits is handled+, and if i can limit duplicates or at least duplicates of player's species portrait.
Star-Spawn of C'thulu mod creates it's empire via event and just assigns C'thulu portrait to it's species so it is not very helpful.
As far as limiting duplicates goes, the game only has a 'randomized' flag that you can set to yes (default --spawn this species randomly) or no (only if spawned by an event or letting players use it) in the species classes file.
In species_classes, under your species just add this line of code under a custom species. randomized = no
And that will prevent the AI from utilizing the portraits randomly.