### Error Log Example Source: https://stellaris.paradoxwikis.com/Modding_tutorial Sample entry found in error.log when a resource is missing. ```text [18:22:15][government_civic_type.cpp:185]: Did not find an icon for civic: tutmod_civic ``` -------------------------------- ### Register Events in On Actions Source: https://stellaris.paradoxwikis.com/Modding_tutorial Configuration for triggering events at the start of a game. ```text on_game_start_country = { events = { tutmod.1 tutmod.2 } } ``` -------------------------------- ### Stellaris Localisation File Content Example Source: https://stellaris.paradoxwikis.com/Modding_tutorial Define localisation keys and their corresponding text. Use $ signs to reference other localisation keys, which Stellaris will automatically translate. ```yaml l_english: tutmod_civic: "Semper Exploro" tutmod_civic_desc: "This society prioritised scientific exploration over military expansion in the early space age." tutmod_civic_effects: "Start with a $science$ and assigned $scientist$ instead of $OUTLINER_FLEETS$." ``` ```yaml l_braz_por: tutmod_civic:0 "Semper Exploro" tutmod_civic_desc:0 "This society prioritised scientific exploration over military expansion in the early space age." tutmod_civic_effects:0 "Start with a $science$ and assigned $scientist$ instead of $OUTLINER_FLEETS$." ``` -------------------------------- ### Example Country Event Structure Source: https://stellaris.paradoxwikis.com/Modding_tutorial A sample country event demonstrating namespace, ID, trigger conditions, and immediate effects. ```text namespace = tutmod country_event = { id = tutmod.1 hide_window = yes fire_only_once = yes trigger = { NOT = { has_global_flag = tutmod_installed } } immediate = { set_global_flag = tutmod_installed } } ``` -------------------------------- ### Define a Stellaris Civic Source: https://stellaris.paradoxwikis.com/Modding_tutorial Example of a standard civic definition using potential, possible, and modifier blocks. ```text civic_beacon_of_liberty = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness } } authority = { NOT = { value = auth_corporate } } } possible = { authority = { value = auth_democratic } ethics = { OR = { text = civic_tooltip_egalitarian value = ethic_egalitarian value = ethic_fanatic_egalitarian } NOR = { text = civic_tooltip_not_xenophobe value = ethic_xenophobe value = ethic_fanatic_xenophobe } } } random_weight = { base = 5 } modifier = { country_unity_produces_mult = 0.15 } } ``` -------------------------------- ### Create Fleet Effect Block Source: https://stellaris.paradoxwikis.com/Modding_tutorial An isolated example of the create_fleet effect block used within a country event. ```text create_fleet = { effect = { set_owner = prev create_ship = { random_existing_design = science graphical_culture = owner } set_location = { target = owner.capital_scope.solar_system.starbase } assign_leader = last_created_leader } } ``` -------------------------------- ### Define Civic Description and Modifier Source: https://stellaris.paradoxwikis.com/Modding_tutorial Example of referencing a custom description key and applying a modifier. ```text # modifier = { # country_unity_produces_mult = 0.15 # } description = "tutmod_civic_effects" modifier = { ship_science_cost_mult = -0.25 } ``` -------------------------------- ### Stellaris Localisation File Declaration Source: https://stellaris.paradoxwikis.com/Modding_tutorial Localisation files must start with a language declaration. Supported declarations include 'braz_por', 'english', 'french', 'german', 'japanese', 'korean', 'polish', 'russian', 'simp_chinese', and 'spanish'. ```yaml l_english: ``` ```yaml braz_por english french german japanese korean polish russian simp_chinese spanish ``` -------------------------------- ### Define Civic Modifier Source: https://stellaris.paradoxwikis.com/Modding_tutorial Example of a basic modifier definition within a civic. ```text modifier = { country_unity_produces_mult = 0.15 } ``` -------------------------------- ### Count Empire Ships and Store Value Source: https://stellaris.paradoxwikis.com/Modding_tutorial Execute this effect script to count all owned ships of an empire and store the value in a variable on the selected planet. This example demonstrates scope manipulation and variable modification. ```script effect owner = { every_owned_ship = { prevprev = { change_variable = { which = tutmod_var_num_ships value = 1 } } } ``` -------------------------------- ### Stellaris EXE Debug Parameters Source: https://stellaris.paradoxwikis.com/Modding_tutorial Command-line arguments for the Stellaris executable to enable debugging features. ```text -script_debug - (Can ignore) -debug_mode - Extra logging -debugtooltip - Starts first game you enter with debugtooltip -logprefix - Modifies each log file name with the set prefix -logpostfix - Modifies each log file name with the set postfix -logall - Logs no longer fail to log duplicate string values ``` -------------------------------- ### Switch Scope with PREV Source: https://stellaris.paradoxwikis.com/Modding_tutorial Demonstrates using the PREV operator to return to the previous scope. ```text effect = { set_owner = prev ``` -------------------------------- ### Stellaris Mod Descriptor: Main File Source: https://stellaris.paradoxwikis.com/Modding_tutorial This is the primary descriptor file for a local Stellaris mod. It includes metadata, version information, and the crucial `path` directive pointing to the mod's root folder. ```plaintext version="0.1" tags={ "Gameplay" } name="Tutorial Mod" supported_version="v3.13.*" path="C:/Users/OldEnt/Documents/Paradox Interactive/Stellaris/mod/tutmod" ``` -------------------------------- ### Modify a Custom Civic Source: https://stellaris.paradoxwikis.com/Modding_tutorial Demonstrates how to comment out code using the # symbol and define a custom civic key. ```text # civic_beacon_of_liberty = { tutmod_civic = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness } } # authority = { # NOT = { # value = auth_corporate # } # } } possible = { authority = { value = auth_democratic } ethics = { OR = { text = civic_tooltip_egalitarian value = ethic_egalitarian value = ethic_fanatic_egalitarian } NOR = { text = civic_tooltip_not_xenophobe value = ethic_xenophobe value = ethic_fanatic_xenophobe } } } random_weight = { base = 5 } modifier = { country_unity_produces_mult = 0.15 } } ``` -------------------------------- ### Declare Event Namespace Source: https://stellaris.paradoxwikis.com/Modding_tutorial Every event file must begin with a namespace declaration to ensure unique event IDs. ```text namespace = tutmod ``` -------------------------------- ### Civic Icon File Path Source: https://stellaris.paradoxwikis.com/Modding_tutorial The expected file path for a custom civic icon. ```text \gfx\interface\icons\governments\civics\tutmod_civic.dds ``` -------------------------------- ### Second Event Placeholder Source: https://stellaris.paradoxwikis.com/Modding_tutorial A comment block for the second event in the mod file. ```text # Removes military fleets, grants science ship and scientist. # Scopes: ``` -------------------------------- ### Log Effect Usage Source: https://stellaris.paradoxwikis.com/Modding_tutorial Syntax for using the log effect to output strings to game.log. ```text log - Prints a message to game.log for debugging purposes log = Supported Scopes: all ``` -------------------------------- ### Stellaris Mod Descriptor: Root Folder File Source: https://stellaris.paradoxwikis.com/Modding_tutorial This descriptor file resides within the mod's root folder and contains metadata and version information. It omits the `path` directive, as it's intended for internal use within the mod's directory structure. ```plaintext version="0.1" tags={ "Gameplay" } name="Tutorial Mod" supported_version="v3.13.*" ``` -------------------------------- ### Stellaris Localisation File Naming Convention Source: https://stellaris.paradoxwikis.com/Modding_tutorial To support multiple languages, copy the base localisation file to language-specific folders and adjust the language declaration. File names should follow the pattern `localisation\\tutmod_l_.yml`. ```plaintext \localisation\english\tutmod_l_braz_por.yml \localisation\english\tutmod_l_english.yml \localisation\english\tutmod_l_french.yml \localisation\english\tutmod_l_german.yml \localisation\english\tutmod_l_japanese.yml \localisation\english\tutmod_l_korean.yml \localisation\english\tutmod_l_polish.yml \localisation\english\tutmod_l_russian.yml \localisation\english\tutmod_l_simp_chinese.yml \localisation\english\tutmod_l_spanish.yml ``` -------------------------------- ### Stellaris Modding: Missing Localisation Keys Source: https://stellaris.paradoxwikis.com/Modding_tutorial CWTools can highlight missing localisation keys, which appear in the VSCode window. Ensure all defined keys have corresponding entries in your localisation files. ```plaintext Localisation key tutmod_civic is not defined for English Localisation key tutmod_civic_desc is not defined for English ``` -------------------------------- ### Define Civic Conditions in Stellaris Modding Source: https://stellaris.paradoxwikis.com/Modding_tutorial Use OR, NOR, and other logic blocks to define the conditions under which a civic can be chosen. Ensure localisation keys exist for tooltips. ```plaintext OR = { text = civic_tooltip_materialist value = ethic_materialist value = ethic_fanatic_materialist } ``` ```plaintext # civic_beacon_of_liberty = { tutmod_civic = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness # No gestalt. } } # authority = { # NOT = { # value = auth_corporate # } # } } possible = { authority = { value = auth_democratic } ethics = { OR = { text = civic_tooltip_materialist value = ethic_materialist value = ethic_fanatic_materialist } OR = { text = civic_tooltip_egalitarian value = ethic_egalitarian value = ethic_fanatic_egalitarian } NOR = { text = civic_tooltip_not_xenophobe value = ethic_xenophobe value = ethic_fanatic_xenophobe } } } random_weight = { base = 5 } modifier = { country_unity_produces_mult = 0.15 } } ``` -------------------------------- ### Full Civic Definition Source: https://stellaris.paradoxwikis.com/Modding_tutorial Complete structure for a custom civic including potential, possible, and description fields. ```text # civic_beacon_of_liberty = { tutmod_civic = { potential = { ethics = { NOT = { value = ethic_gestalt_consciousness # No gestalt. } } # authority = { # NOT = { # value = auth_corporate # } # } } possible = { authority = { value = auth_democratic } ethics = { OR = { text = civic_tooltip_materialist value = ethic_materialist value = ethic_fanatic_materialist } OR = { text = civic_tooltip_egalitarian value = ethic_egalitarian value = ethic_fanatic_egalitarian } NOR = { text = civic_tooltip_not_xenophobe value = ethic_xenophobe value = ethic_fanatic_xenophobe } } } random_weight = { base = 5 } description = "tutmod_civic_effects" modifier = { shipclass_science_ship_build_cost_mult = -0.25 } # modifier = { # country_unity_produces_mult = 0.15 # } } ``` -------------------------------- ### Stellaris Modding: Useful Console Commands Source: https://stellaris.paradoxwikis.com/Modding_tutorial These console commands can be used in Stellaris to reload localisation tables and switch languages during mod development. ```plaintext reload text – reloads localisation table. switchlanguage english – switches used language and reloads localisation table. toggle_string_id - displays StringIDinstead of localisation. ``` -------------------------------- ### Define Scope States Source: https://stellaris.paradoxwikis.com/Modding_tutorial Representations of scope states at different points in the event execution. ```text root = country this = country ``` ```text root = country this = fleet prev = country ``` -------------------------------- ### Check Global Flag Trigger Source: https://stellaris.paradoxwikis.com/Modding_tutorial Checks if a specific global flag has been set. Supported in all scopes. ```text has_global_flag - Checks if a Global Flag has been set has_global_flag = Supported Scopes: all ``` -------------------------------- ### Define a Country Event Source: https://stellaris.paradoxwikis.com/Modding_tutorial A complete country event definition including triggers and immediate effects for fleet and leader management. ```text country_event = { id = tutmod.2 hide_window = yes is_triggered_only = yes # Fire only when called from elsewhere. trigger = { has_civic = tutmod_civic # Must have tutmod_civic civic. } immediate = { every_owned_fleet = { # Iterate through every owned fleet of THIS country. limit = { is_ship_class = shipclass_military # only fleets meeting shipclass_military criteria } delete_fleet = { target = this # Delete THIS fleet. kill_leader = no # Do not delete leader of THIS fleet (unassigns). } } create_leader = { # Create leader for THIS country. class = scientist # Specified scientist class. species = this # Where THIS is the scope of where effect was written in (country, therefore species will be main country species). } create_fleet = { # Create fleet for THIS country. effect = { # Execute list of effects for THIS fleet. set_owner = prev # Set owner of THIS fleet to PREV (PREV/previous scope being country we in previous brackets refered to as THIS). create_ship = { # Create ship for THIS fleet. random_existing_design = science # of random design which is science ship. graphical_culture = owner # Visual style of the ship is the same as OWNER of the fleet (can use PREV here). } set_location = { target = owner.capital_scope.solar_system.starbase # Set location of the fleet to owner's capital_scope's solar_system's starbase. # distance = 0 # angle = random # direction = out_system } assign_leader = last_created_leader # Assigns last created leader to the fleet. } } } } ``` -------------------------------- ### Set Global Flag Effect Source: https://stellaris.paradoxwikis.com/Modding_tutorial Sets an arbitrarily-named global flag. Supported in all scopes. ```text set_global_flag - Sets an arbitrarily-named global flag set_global_flag = Supported Scopes: all ``` -------------------------------- ### Test if Empire has a Civic Source: https://stellaris.paradoxwikis.com/Modding_tutorial Use this trigger script in the console to check if the current country possesses a specific civic. It includes a check for civic validation. ```script trigger OR = { has_civic = tutmod_civic has_valid_civic = tutmod_civic } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.