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

unmerged(772538)

Private
30 Badges
Jul 22, 2013
10
21
  • Crusader Kings II
  • Stellaris - Path to Destruction bundle
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Prison Architect
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Crusader Kings II: Way of Life
  • Magicka
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
I'm trying to make a mod that adds a new Origin that lets the player start on a unique world with its own special modded planetary features and blockers. I've made the new planet type, I've made the origin, that's all done. But how do I ensure that the homeworld spawns in with the exact features I want it to?
 
Take a look at the following files and events for how Sol (Earth) is initialized. Planetary deposits and blockers are added at game start via an event. Specifically, this is the event in events/game_start.txt called game_start.12. That event executes a scripted effect that adds the unique deposits and blockers to planets. That scripted effect is located in common/scripted_effects/01_start_of_game_effects.txt generate_earth_deposits_and_blockers . Scripted effects are like functions, a block of text containing a bunch of actions that you can execute by writing the single line of code (i.e. generate_earth_deposits_and_blockers ). You don't need to use a scripted effect, but it helps cut down on the code bloat. Last the event is triggered by an on_action command. That is in common/on_actions/00_on_actions.txt command empire_init_capital_planet . To summarize, an on_action command triggers a game_start event that executes a scripted_effect. You should create your own copies of these files with unique but readable names to execute your code. Good luck and have fun.
 
  • 1
Reactions: