Stellaris

Stellaris

Origins Civics
Denne tråd er blevet låst
cbshing  [udvikler] 1. maj 2018 kl. 19:06
Creating Your Custom Origins Civics Addon
Introduction

Hello! You’ve arrived at this page because you may be interested in building your own Origins Civics mod/addon. With the 1.4 Update to Origins Civics this is now easier to do! Introduced in 1.4, there are two methods that you can employ to build your mod.

  • Scripted Triggers – Building an Addon with Origins Civics as the base mod, download "oc01_cbshing_origins_compatch_scripted_triggers.txt" here[drive.google.com]
  • Scripted Effects – Building a Derived mod with some of the existing code (Origins Civics is not needed as a base mod), download "oc_origins_civics_generic_scripted_effects.txt" here[drive.google.com]

Scripted Triggers

In 1.4 to create the Unbalanced and Untested submod, Origins Civics was streamlined so the majority of the code run using scripted triggers. A scripted trigger is a standalone block of triggers typically used as part of an “if” statement or a “trigger” statement that is checked to determine if the script should execute the function under that effect. It is located in the
common\scripted_triggers
folder. These “scripted triggers” are typically triggers that are used in a number of events where retyping each line of code would clutter the event file. For example, in the base game there is a scripted trigger called “has_militarist_government”, which incorporates all of the different militarist government types and is used to check which dialogue text for an event should appear.

In the Origins Civics 1.4 update, a generic scripted trigger file called “oc01_cbshing_origins_compatch_scripted_triggers.txt” was added. Within the file is a set of scripted triggers that when copied to your mod and by replacing the generic “has_country_flag = invalid_origins_country_flag” with your specific country flag or valid country scope object (e.g. custom civic), your mod can inherit the code of the Origins Civics mod. Please copy this file to your mod and rename it so that the file begins with ASCII characters that are greater than the "oc01" (e.g. you can rename the file to be "pc01") since load order is important for the file to work. There cannot be two mods using the same compatch files unfortunately, so if you want to build 2 addon mods please inform me and I'll generate more of these "blank" files.

For example, if your addon mod was to start as a lost colony on habitat in a system with a wormhole and wormhole start tech and have the same events as the Lost Colony civic from the Origins Civics mod, you should replace the following scripted triggers to add your unique country flag or civic:

*Note this assumes you created a separate civic file that contains a civic called "mycustom_lostcolonyhabwormhole_civic"

is_origins_compatch_origins_lost_colony_start_country = { OR = { has_valid_civic = mycustom_lostcolonyhabwormhole_civic } } is_origins_compatch_origins_lost_colony_event_country = { OR = { has_valid_civic = mycustom_lostcolonyhabwormhole_civic } } is_origins_compatch_wormhole_start_country = { OR = { has_valid_civic = mycustom_lostcolonyhabwormhole_civic } } is_origins_compatch_habitat_country = { OR = { has_valid_civic = mycustom_lostcolonyhabwormhole_civic } }


Scripted Effects
In 1.4 the various scripted effects were combined into fewer files with a single file "oc_origins_civics_generic_scripted_effects.txt" containing the majority of the scripted effects for this mod. A "scripted effect" is a snippet of code that performs a particular function. It is found in the
common\scripted_effects
folder. These functions can vary from simple things such as "origins_give_megaengineering_technology", which allows your nation to begin with megaengineering, to something complicated like "make_earth_this_species_home", which if Earth exists in the galaxy it makes it your country's homeworld and makes any of the occupants of Earth be considered the same species as you. I

To use the scripted effects, copy the file "oc_origins_civics_generic_scripted_effects.txt" to your mod's common\scripted_effects folder. Please do not change the contents of the file since it will mess with compatibility with Origins Civics, but you may copy the contents to another file and make edits (with a new name). To use the scripted effect, you must call it out from the script file (event file typically) using the text "example_effect = yes". For example, if I had an event where I wanted my species to start with tomb world preference, with wormhole travel capabilities, and a wormhole in their home system I would write the code as follows:

*Note this assumes you have built a separate game_start on action trigger that calls out "my_test_event.1"

country_event = { id = my_test_event.1 hide_window = yes is_triggered_only = yes trigger = { has_valid_civic = mycustom_earthcolonywormhole_civic } immediate = { origins_give_species_tomb_world_preference = yes origins_allow_country_to_travel_wormhole = yes capital_scope.solar_system = { origins_spawn_natural_wormhole = yes } } }

The various scripted effects as of 1.4 included in the "oc_origins_civics_generic_scripted_effects.txt" file are listed below and which scope is necessary to execute them:
Country Scope
  • origins_give_megaengineering_technology : grants mega engineering tech
  • origins_allow_country_to_travel_wormhole : enables country to travel through a wormhole & grants wormhole stabilization tech
  • origins_allow_country_to_activate_gateway : enables country to activate and travel through gateways & grants gateway activation tech
  • origins_allow_country_to_build_gateways : enables country to build gateways, granting gateway construction & megaengineering tech - must use with activate gateway effect to travel gateways.
  • origins_give_ascension_theory_technology : grants ascension theory tech
  • origins_make_current_capital_homeworld : changes the current capital to be the homeworld of the species (thus granting the homeworld habitability bonus, use if capital is on a different planet (e.g. ringworld, habitat, etc).
  • origins_nuke_all_colonies : used typically at game start, it removes all colonies and leaves on the capital.
  • origins_give_species_habitat_preference : changes the species to have habitat preference
  • origins_give_species_tomb_world_preference : changes the species to have tomb world preference
  • make_earth_this_species_home : if Earth exists, Earth will be this species homeworld and the occupants of Earth will be considered the same species as this species
Planet Scope
  • origins_add_vanilla_tile_blockers : adds the vanilla tile blockers back to the planet if the home planet was changed to the correct tiles
  • origins_remove_food_resources : removes food bonuses from this planet's tiles
  • origins_reset_start_buildings_and_blockers_habitat : resets necessary tiles for habitat users
  • origins_reset_start_buildings_and_blockers_machine_world : resets necessary tiles for machine worlds (used by Machine World civic due to change in planet size)
Solar System Scope
  • origins_remove_random_hyperlanes_to_neighbors : removes a hyperlane from this star to a random neighbor star
  • origins_add_hyperlane_to_random_neighbors : adds a hyperlane from this star to a random neighbor star
  • origins_remove_all_hyperlanes_to_neighbors : removes all hyperlanes from this star to all neighboring stars (isolates this star)
  • origins_spawn_natural_wormhole : spawns a natural wormhole in this system and connects to a newly spawned wormhole a Eucledian distance 50 to 200 away from this star
  • origins_spawn_deactivated_gateway : spawns a deactivated gateway in this system
  • origins_activate_random_gateway : activates a random gateway in the galaxy
  • origins_spawn_gateway_under_construction : spawns a gateway under construction in this system with the owner being the owner of the system
  • origins_spawn_gateway_completed : spawns a completed gateway in this system with the owner being the owner of the system
  • origins_spawn_habitat_over_capital : spawns an unoccupied habitat over the capital planet
  • origins_spawn_random_habitat_in_system: spawns an unoccupied habitat over a random planet in the system

Please if you have any questions leave a message below and I will try my best to answer you. If you make a mod using one of the two methods above, please leave a message and I will try to periodically update the Origins Civics page so there is a link to your mod. hope you could use these tools to your advantage to build your mods and I look forward to seeing your mods on the workshop soon!
Sidst redigeret af cbshing; 1. maj 2018 kl. 19:10
< >
Viser 1-2 af 2 kommentarer
Kamenev 5. sep. 2018 kl. 23:06 
Hey cbshing, I got back into a Mass Effect kick recently and basically wanted to make a Andromeda Initiative civic. The goal was to basically combine the Codominent Evolution with the Habitat start over ruined home world. Every time I boot it, it only loads my primary race. After reading a bit of your instructions, Im guessing its not liking the face that there are no farms or mines on the habitat so it doesnt know what to replace with the secondary species. Any ideas or help on how I might could get around this? Working with the scripted_triggers.txt above. Thanks =P
cbshing  [udvikler] 7. okt. 2018 kl. 14:55 
@Kamenev, I can take a look again on how I wrote the base code. I know I wrote some special scripting for a secondary species on a habitat, but I might not have enabled it for Codominant.
< >
Viser 1-2 af 2 kommentarer
Per side: 1530 50