Advertisement
Guest User

Untitled

a guest
May 24th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 KB | None | 0 0
  1. # This is a full example of system initializers and initializer trees
  2. # A system initializer is used to initialize each solar system in the game by creating planets, setting names and values on everything.
  3. # The system also has a tree structure that allows one initializer decide how neighboring systems should be initialized ( see the 'neighbor_system' part further down ).
  4. #
  5. # All numeric values can be scripted as 'x = 10' or 'x = { min = 5 max = 15 }', except within the triggers and effects
  6. #
  7. # Useful console commands:
  8. # 'Draw.Clusters' will toggle clusters on/off. Some clusters are created in the beginning and will be used for placing empires. Clusters can(will) also be created from effects and events
  9. # 'Draw.SystemInit' will print the initializer used for each system, as well as lines to show which initializer triggered another
  10.  
  11.  
  12. example_initializer = {
  13. name = "Example System" #Name of the system. Use localization tags rather than strings for translation purposes.
  14. class = "rl_standard_stars" #system's star class. ["name_of_class"] picks a specific class. ["name_of_random_list"] picks a random class from the specified random_list ( random_list are found in the same files as the star classes )
  15. asteroid_belt = {
  16. type = rocky_asteroid_belt
  17. radius = 60
  18. } #asteroid field distance from center
  19. flags = { example_system } #flags that can be used in triggers and effects
  20.  
  21. #Initializers can specify how the game can use them.
  22. #valid values are:
  23. #usage = empire_init #game can pick this initializer randomly to initialize systems for regular empires ( i.e the player(s) or regular AI empires ) that do not specify a specific initializer
  24. #usage = misc_system_init #game can pick this initializer randomly when initializing misc systems. i.e systems that have not been initialized by empires or fallen empires
  25. #you can specify multiple usages for an initializer.
  26. #By not specifiying any usage the game won't use this initializer except when explicitly told to from another script ( if a prescripted species or an effect specify an initializer by name )
  27. usage_odds = 20 #if a 'usage = x' is specified the usage_odds is used to control the odds of this initializer being picked over another.
  28. max_instances = 10 #This initializer can at most be used 10 times. leave blank or negative for infinite. Note that this limit is also applied when spawning systems from effects, i.e if the galaxy starts with 9 instances you can only create 1 system with this initializer from effects.
  29. #when all planets have been created and the system is initialized the init_effect will be executed
  30. #you can use this to spawn mining drones etc
  31. #the scope will be a galactic_object scope, with prev being set to the previous system that was initialized by this tree ( if any ). Root will point to the first system in the tree.
  32. init_effect = {
  33. set_name = "Name set from an effect"
  34. }
  35.  
  36. #create the sun first. This is the minimum script required for a sun
  37. planet = {
  38. class = star
  39. orbit_distance = 0
  40. }
  41.  
  42. #create a planet
  43. planet = {
  44. count = 1 #defaults to 1, if you have count = { min = x max = y } then a random number ( between x-y ) of planets will be created.
  45. name = "Example Planet" #leave blank to use the games default naming
  46.  
  47. #set the planet class of the planet
  48. class = star #picks the planet class that matches the systems star class
  49. #class = ideal_planet_class #if initializing for an empire or fallen empire, picks the ideal planet class for their species. Otherwise picks a planet class randomly
  50. #class = random_non_ideal #picks a random class that is not the ideal planet class for the empire/fallen empire currently initializing for
  51. #class = random #picks a planet class randomly, based on orbit distance and system star class. See common/star_classes/ for which planet classes can be picked for each star class
  52. #class = random_colonizable #picks a random colonizable planet class
  53. #class = random_non_colonizable #picks a random non-colonizable planet class
  54. #class = random_asteroid #picks a random asteroid planet_class
  55. #class = none #valid, but this planet will not be generated. It will affect orbit of other planets though
  56. #class = "pc_barren" #use the "pc_barren" planet class
  57. ###
  58. # Please not that all "class = random*" will use the star class' settings for randomization.
  59. # This means that if you try to use for instance random_colonizable with planets that are super close to the sun
  60. # it will likely fail. Failing leads to the same behavior as scripting 'class = none'.
  61. # You can start the game with the -script_debug to get error logs whenever it fails
  62. ###
  63.  
  64. orbit_distance = { min = 40 max = 50 } #distance from center, relative to previous planets orbit. ( if the previous planet was placed at distance 100 from the center, orbit_distance = 10 would put us 110 from the center ).
  65. orbit_angle = 1 #orbit angle from previous planet, in degrees. orbit_distance and orbit_angle together makes the polar coordinate of the planet
  66. size = 30 #planet size. remember that all numeric values support { min = x max = y } syntax
  67. has_ring = no
  68.  
  69. modifier = "pm_dangerous_wildlife" #planet modifier
  70. anomaly = "IRASSIA" #anomaly on this planet
  71.  
  72. home_planet = yes #this is a valid home planet for empires and fallen empires
  73.  
  74. flags = { example_planet } #flags usable by effects and triggers
  75.  
  76. #A moon works the same as planets, with the only exception that they orbit the parent planet instead of the system center
  77. moon = {
  78. class = random
  79. orbit_distance = 10 #orbit for moons are only relative to other moons around this planet
  80. size = 1
  81. }
  82. #spawn 1-3 random moons
  83. moon = {
  84. count = { min = 1 max = 3 }
  85. orbit_distance = 2.5
  86. size = 1
  87. }
  88.  
  89. #when the planet is done initializing the init_effect will be executed
  90. #use this to spawn mining drones or whatever else you want to do
  91. #The scope will be a planet scope, with prev being the system. prevprev will be the system that triggered this system's initialization ( if any ). Root will be the first system in this initializer tree
  92. init_effect = {
  93. set_name = "init_effect example name"
  94. }
  95. }
  96.  
  97. #change_orbit = X is a shortcut and equivalent to 'planet = { class = none orbit_distance = X }'
  98. #useful when spawning a random amount of planets
  99. change_orbit = 30
  100.  
  101.  
  102. #this is where the tree part comes in in 'Initializer Tree'
  103. #Each initializer can have any number of child initializers scripted with in a "neighbor_system" body
  104. neighbor_system = {
  105. #The game will test all systems within the distance limit
  106. #untill it finds a system that fulfills the trigger ( see below ).
  107. #it will do this in a nearest-first order by euclidean distance
  108.  
  109. distance = { min = 10 max = 100 } # euclidean distance
  110. hyperlane_distance = { min = 1 max = 20 } # total hyperlane distance, distance inside systems are not included.
  111. hyperlane_jumps = { min = 1 max = 20 } # number of jumps
  112.  
  113. #if the trigger is left empty it will always succeed. The first closest system that is within the distance limits will be picked
  114. trigger = {
  115. #scope = galactic_object ( parent ). root = root gal obj. prev = closest parent. prev prev = grand parent...
  116. #check stuff
  117. }
  118.  
  119. #finally the initializer to be used for the picked system
  120. initializer = "example_neighbor"
  121. }
  122. neighbor_system = {
  123. distance = { min = 10 max = 100 }
  124. initializer = "example_neighbor"
  125. }
  126. }
  127.  
  128. example_neighbor = {
  129. name = "Example Neighbor"
  130. class = "rl_standard_stars" #system's star class. ["name_of_class"] picks a specific class
  131.  
  132. #this initializer does not specify any 'usage = ..' so it will only be used explicitly ( like in example_initializer's neighbor_system script )
  133.  
  134. change_orbit = 30
  135. planet = {
  136. count = 5
  137. size = { min = 10 max = 30 }
  138. }
  139. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement