screenshot.lua 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. -- Usage:
  2. -- - Create a new world
  3. -- - Set world mapgen: v6
  4. -- - Set world seed: 2625051331357512570
  5. -- - Enable the moretrees mod
  6. -- - Edit the moretrees source
  7. -- - Disable all trees in default_settings.lua
  8. -- - Recommended: make saplings grow fast in default_settings.lua:
  9. -- sapling_interval = 5
  10. -- sapling_chance = 1
  11. -- - Apply the patch below to moretrees
  12. -- (so that jungle trees are always large, and differently-colored):
  13. -- use 'git apply --ignore-space-change'
  14. -- - Make sure this file (you are reading) will be loaded when minetest starts !
  15. -- (e.g. add 'dofile(modpath.."/screenshot.lua")' to init.lua)
  16. -- - Start minetest
  17. -- - Goto 700,y,-280 (approximately)
  18. -- - Make sure the world is loaded between x = 650 .. 780 and z = -350 .. -180
  19. -- - Give the chat command '/make-scene'
  20. -- - Wait & walk/fly around until all trees have grown
  21. -- - goto the platform at 780, 30, -277
  22. -- - Set the viewing range to 300, with fog enabled
  23. -- - Take a screenshot.
  24. -- Patch to apply to moretrees
  25. --[[
  26. diff --git a/init.lua b/init.lua
  27. index 8189ffd..afd4644 100644
  28. --- a/init.lua
  29. +++ b/init.lua
  30. @@ -225,9 +225,12 @@ moretrees.ct_rules_b1 = "[-FBf][+FBf]"
  31. moretrees.ct_rules_a2 = "FF[FF][&&-FBF][&&+FBF][&&---FBF][&&+++FBF]F/A"
  32. moretrees.ct_rules_b2 = "[-fB][+fB]"
  33. +local jleaves = 1
  34. function moretrees.grow_jungletree(pos)
  35. local r1 = math.random(2)
  36. local r2 = math.random(3)
  37. + r1 = jleaves
  38. + jleaves = jleaves % 2 + 1
  39. if r1 == 1 then
  40. moretrees.jungletree_model.leaves2 = "moretrees:jungletree_leaves_red"
  41. else
  42. @@ -235,6 +238,7 @@ function moretrees.grow_jungletree(pos)
  43. end
  44. moretrees.jungletree_model.leaves2_chance = math.random(25, 75)
  45. + r2=3
  46. if r2 == 1 then
  47. moretrees.jungletree_model.trunk_type = "single"
  48. moretrees.jungletree_model.iterations = 2
  49. ]]
  50. minetest.register_chatcommand("make-scene", {
  51. func = function()
  52. minetest.place_node({x=780, y=30, z=-277}, {name="default:obsidian"})
  53. minetest.place_node({x=780, y=30, z=-278}, {name="default:obsidian"})
  54. minetest.place_node({x=781, y=30, z=-277}, {name="default:obsidian"})
  55. minetest.place_node({x=781, y=30, z=-278}, {name="default:obsidian"})
  56. minetest.place_node({x=781, y=30, z=-276}, {name="default:obsidian"})
  57. minetest.place_node({x=780, y=30, z=-276}, {name="default:obsidian"})
  58. for z = -360, -300 do
  59. local dy=2
  60. for x = 630 + (-z - 360)/3, 660 + (-z - 300)/3 do
  61. for y = 5, 22 do
  62. minetest.place_node({x=x, y=y, z=z}, {name="default:desert_stone"})
  63. end
  64. for y = 23, 25 + dy do
  65. minetest.place_node({x=x, y=y, z=z}, {name="default:desert_sand"})
  66. end
  67. dy = 0
  68. end
  69. end
  70. minetest.place_node({x=717, y=2, z=-298}, {name = "moretrees:palm_sapling"})
  71. minetest.place_node({x=713, y=2, z=-302}, {name = "moretrees:palm_sapling"})
  72. minetest.place_node({x=713, y=2, z=-307}, {name = "moretrees:palm_sapling"})
  73. minetest.place_node({x=717, y=2, z=-318}, {name = "moretrees:palm_sapling"})
  74. minetest.place_node({x=723, y=2, z=-320}, {name = "moretrees:palm_sapling"})
  75. minetest.place_node({x=645, y=26, z=-314}, {name="moretrees:date_palm_sapling"})
  76. minetest.place_node({x=653, y=26, z=-322}, {name="moretrees:date_palm_sapling"})
  77. minetest.place_node({x=649, y=26, z=-334}, {name="moretrees:date_palm_sapling"})
  78. minetest.place_node({x=662, y=26, z=-342}, {name="moretrees:date_palm_sapling"})
  79. minetest.place_node({x=672, y=5, z=-305}, {name="moretrees:oak_sapling"})
  80. minetest.place_node({x=690, y=6, z=-322}, {name="moretrees:oak_sapling"})
  81. minetest.place_node({x=695, y=7, z=-335}, {name="moretrees:oak_sapling"})
  82. minetest.place_node({x=699, y=4, z=-301}, {name="moretrees:oak_sapling"})
  83. minetest.place_node({x=751, y=5, z=-254}, {name="moretrees:apple_tree_sapling"})
  84. minetest.place_node({x=729, y=3, z=-275}, {name="moretrees:apple_tree_sapling"})
  85. minetest.place_node({x=747, y=4, z=-270}, {name="moretrees:apple_tree_sapling"})
  86. minetest.place_node({x=671, y=5, z=-283}, {name="default:junglesapling"})
  87. minetest.place_node({x=680, y=4, z=-287}, {name="default:junglesapling"})
  88. minetest.place_node({x=702, y=4, z=-288}, {name="default:junglesapling"})
  89. minetest.place_node({x=646, y=12, z=-199}, {name="moretrees:spruce_sapling"})
  90. minetest.place_node({x=644, y=14, z=-177}, {name="moretrees:spruce_sapling"})
  91. minetest.place_node({x=678, y=9, z=-211}, {name="moretrees:spruce_sapling"})
  92. minetest.place_node({x=663, y=10, z=-215}, {name="moretrees:spruce_sapling"})
  93. minetest.place_node({x=637, y=3, z=-263}, {name="moretrees:sequoia_sapling"})
  94. minetest.place_node({x=625, y=3, z=-250}, {name="moretrees:sequoia_sapling"})
  95. minetest.place_node({x=616, y=3, z=-233}, {name="moretrees:sequoia_sapling"})
  96. minetest.place_node({x=635, y=3, z=-276}, {name="moretrees:sequoia_sapling"})
  97. minetest.place_node({x=681, y=11, z=-260}, {name="moretrees:sequoia_sapling"})
  98. minetest.place_node({x=682, y=10, z=-247}, {name="moretrees:sequoia_sapling"})
  99. minetest.place_node({x=737, y=7, z=-195}, {name="moretrees:cedar_sapling"})
  100. minetest.place_node({x=720, y=8, z=-189}, {name="moretrees:cedar_sapling"})
  101. minetest.place_node({x=704, y=7, z=-187}, {name="moretrees:cedar_sapling"})
  102. minetest.place_node({x=731, y=2, z=-227}, {name="moretrees:poplar_sapling"})
  103. minetest.place_node({x=721, y=2, z=-233}, {name="moretrees:poplar_sapling"})
  104. minetest.place_node({x=712, y=1, z=-237}, {name="moretrees:poplar_sapling"})
  105. minetest.place_node({x=743, y=3, z=-228}, {name="moretrees:poplar_small_sapling"})
  106. minetest.place_node({x=750, y=3, z=-230}, {name="moretrees:poplar_small_sapling"})
  107. minetest.place_node({x=731, y=5, z=-233}, {name="moretrees:poplar_small_sapling"})
  108. minetest.place_node({x=702, y=2, z=-274}, {name="moretrees:birch_sapling"})
  109. minetest.place_node({x=697, y=2, z=-271}, {name="moretrees:birch_sapling"})
  110. minetest.place_node({x=696, y=2, z=-264}, {name="moretrees:birch_sapling"})
  111. minetest.place_node({x=710, y=2, z=-265}, {name="moretrees:birch_sapling"})
  112. minetest.place_node({x=707, y=8, z=-247}, {name="moretrees:fir_sapling"})
  113. minetest.place_node({x=699, y=10, z=-254}, {name="moretrees:fir_sapling"})
  114. minetest.place_node({x=729, y=5, z=-261}, {name="moretrees:fir_sapling"})
  115. minetest.place_node({x=732, y=5, z=-252}, {name="moretrees:fir_sapling"})
  116. minetest.place_node({x=741, y=4, z=-262}, {name="moretrees:fir_sapling"})
  117. minetest.place_node({x=751, y=2, z=-286}, {name="moretrees:willow_sapling"})
  118. minetest.place_node({x=760, y=5, z=-223}, {name="moretrees:rubber_tree_sapling"})
  119. minetest.place_node({x=762, y=5, z=-230}, {name="moretrees:rubber_tree_sapling"})
  120. minetest.place_node({x=766, y=5, z=-243}, {name="moretrees:rubber_tree_sapling"})
  121. minetest.place_node({x=764, y=6, z=-252}, {name="moretrees:rubber_tree_sapling"})
  122. end
  123. })
  124. --[[
  125. The following is a search/replace command suitable for vi (/vim) or sed, to convert minetest log
  126. messages to equivalent lua commands:
  127. s/.*\(\(moretrees\|default\)[^ ]*\) at (\([-0-9]\+\),\([-0-9]\+\),\([-0-9]\+\)).*/\t\tminetest.place_node({x=\3, y=\4, z=\5}, {name="\1"})/
  128. E.g. a minetest log line of the following kind:
  129. 2016-07-03 11:30:50: ACTION[Server]: singleplayer places node moretrees:rubber_tree_sapling at (760,5,-223)
  130. Becomes:
  131. minetest.place_node({x=760, y=5, z=-223}, {name="moretrees:rubber_tree_sapling"})
  132. (Except that the example log line above has an extra space added, so it won't be converted)
  133. vi/vim users: Add the minetest log lines to this file, then enter the following command, with
  134. <expression> replaced with the search/replace expression above.
  135. :%<expression>
  136. sed users: Add the minetest log lines to this file, then execute the following command at the shell
  137. prompt with <expression> replaced by the search/replace expression above. Don't forget the
  138. single-quotes.
  139. sed '<expression>' < screenshot.lua > screenshot-new.lua
  140. Windows users: You're probably out of luck. And the effort of doing such a thing is probably
  141. larger anyway than the effort of copying an existing line and typing things manually.
  142. ]]