I don't know anything about perlin noise but from the posts i read i figured out this code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
function getTemperatureAtPlayer(player)
pos= player:getpos()
noise = biome_lib.perlin_temperature:get2d({x=pos.x, y=pos.z})
heat= -noise * 55 + 30
return heat
end
-noise * 55 + 30 will (roughly) translate the value to celsius
I'm not really sure what i am doing, only what i want to accomplish :)
For my purpose even knowing the biome at the player position would suffice. No success with that either..