PersonTheCat

Cave Generator Variable Structure B

Jan 2nd, 2021 (edited)
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. ------------------------------------- File Structure --------------------------------------
  2. /config/cavegenerator/imports/biomes.cave
  3. /config/cavegenerator/imports/tunnels.cave
  4. /config/cavegenerator/imports/common.cave
  5. /config/cavegenerator/presets/example.cave
  6.  
  7. --------------------------------------- biomes.cave ----------------------------------------
  8. # In this structure, variables are imported only from the imports folder.
  9. # In my opinion, this will take more effort to learn, but ultimately be
  10. # the safer choice. And it is my preferred choice.
  11. # No other fields are allowed in this file except `imports`.
  12. variables: {
  13. definitions: {
  14. # Here we're defining a reusable `biomes` object for forest biomes.
  15. FOREST_BIOMES: {
  16. types: ["FOREST"]
  17. }
  18. }
  19. }
  20.  
  21. -------------------------------------- tunnels.cave ----------------------------------------
  22. variables: {
  23. # Here, we're defining a couple of reusable tunnels objects.
  24. definitions: {
  25. # Copied from spirals.cave
  26. SPIRALS: {
  27. systemChance: 0.001
  28. noiseYReduction: false
  29. dYaw: {
  30. factor: 1
  31. randFactor: 0
  32. startVal: 5
  33. }
  34. dPitch: {
  35. factor: 1
  36. randFactor: 0
  37. }
  38. pitch: {
  39. startVal: 1
  40. startValRandFactor: 0
  41. }
  42. }
  43. # I'm leaving a description here to explain this and add some space
  44. # for readability.
  45. LARGE_TUNNELS: {
  46. resizeBranches: false
  47. scale: {
  48. startVal: 2.5
  49. startValRandFactor: 0.9
  50. }
  51. scaleY: {
  52. randFactor: 0.05
  53. startVal: 0.7
  54. }
  55. }
  56. }
  57. }
  58.  
  59. -------------------------------------- common.cave ----------------------------------------
  60. # This preset demonstrates how one import file can import from another.
  61. # Imports *do not* cascade. Therefore, two import files can import from
  62. # each other with no infinite recursion.
  63. variables: {
  64. imports: [
  65. biomes.cave
  66. tunnels.cave
  67. ]
  68. }
  69.  
  70. -------------------------------------- example.cave ---------------------------------------
  71. enabled: true
  72. # Inside of our preset, we can import definitions from any preset in the
  73. # imports folder. We do not lose out on local definitions, but we cannot
  74. # import from other regular cave presets.
  75. variables: {
  76. imports: [
  77. # Common already imports from biomes and tunnels, so we inherit everything.
  78. common.cave
  79. ]
  80. definitions: {
  81. # We're also defining a new cave block object to use in-house.
  82. LAVA: {
  83. states: [ "lava" ]
  84. maxHeight: 10
  85. }
  86. }
  87. }
  88. caveBlocks: [ "$LAVA" ]
  89. biomes: $FOREST_BIOMES
  90. blankSlate: false
  91. tunnels: [
  92. $SPIRALS
  93. $LARGE_TUNNELS
  94. ]
Add Comment
Please, Sign In to add comment