![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | ericsonwillians |
I’m having problems migrating from the 3.5 version of the engine to the 4.0 stable. I’ve solved the OpenSimplexNoise issue, but now I’m having problems with the TIleMap class, as set_cellv has been removed and I don’t know how to use set_cell in its place:
func set_tile(width, height):
RenderingServer.set_default_clear_color(Color("#22485c"))
for x in width:
for y in height:
var pos = Vector2(x, y)
var alt = altitude[pos]
var temp = temperature[pos]
var moist = moisture[pos]
#Ocean
if alt < 0.2:
biome[pos] = "ocean"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"ocean")])
#Beach
elif between(alt, 0.2, 0.25):
biome[pos] = "beach"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"beach")])
#Other Biomes
elif between(alt, 0.25, 0.8):
#plains
if between(moist, 0, 0.9) and between(temp, 0, 0.6):
biome[pos] = "plains"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"plains")])
#jungle
elif between(moist, 0.4, 0.9) and temp > 0.6:
biome[pos] = "jungle"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"jungle")])
#desert
elif temp > 0.6 and moist < 0.4:
biome[pos] = "desert"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"desert")])
#lakes
elif moist >= 0.9:
biome[pos] = "lake"
tilemap.set_cellv(pos, tiles[random_tile(biome_data,"lake")])
How can I convert this function that uses set_cellv to set the tiles?