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.