Hello ! Following my old subject that @ShaneBee had solved, I made a map generation system. The problem is that it is slow, for example for a 1000x1000 map, it will take 16 minutes to generate itself !
Knowing that a chunk is 16x16, how to do better?
Here is my code
Old topic: https://forums.skunity.com/threads/chunk-generator.7906/#post-34203
Knowing that a chunk is 16x16, how to do better?
Here is my code
code_language.skript:
on load:
set {Game.LoadingWorld} to now
set {_x} to 0
set {_y} to 130
set {_z} to 0
set {_loc} to location({_x}, {_y}, {_z}, world("world"))
load chunk chunk at location of {_loc}
loop 1000 times:
set {_x} to {_x} + 1
set {_y} to 130
set {_z} to {_z} + 1
load chunk chunk at location of {_loc}
set {_x} to {_x} / -1
set {_y} to 130
set {_z} to {_z} / -1
set {_x} to {_x} + 2
set {_z} to {_z} + 2
load chunk chunk at location of {_loc}
add 1 to {_limit}
if {_limit} is 100:
wait 5 seconds
delete {Game.LoadingWorld}
on connect:
if {Game.LoadingWorld} is set:
kick player due to "&cThe map is being generated! Come back later"
Old topic: https://forums.skunity.com/threads/chunk-generator.7906/#post-34203