Page 1 of 1
Terrain type. Obtain with LUA?
Posted: Sun Nov 17, 2019 12:02 pm
by Bandura1
it is possible to obtain terrain of unit location?
Any code similar to World_GetElevation (location) but to terrain type.
Thanks.
RE: Terrain type. Obtain with LUA?
Posted: Sun Nov 17, 2019 9:30 pm
by KnightHawk75
Great question.
RE: Terrain type. Obtain with LUA?
Posted: Mon Dec 02, 2019 5:15 am
by michaelm75au
Has been added to the request list
RE: Terrain type. Obtain with LUA?
Posted: Thu Dec 05, 2019 12:19 am
by tjhkkr
ORIGINAL: Bandura1
it is possible to obtain terrain of unit location?
Any code similar to World_GetElevation (location) but to terrain type.
Thanks.
What a fantastic idea!
RE: Terrain type. Obtain with LUA?
Posted: Mon Dec 09, 2019 9:59 pm
by michaelm75au
Note on new Lua method:
Sea
print(World_GetLocation({latitude='-16.4183855919871', longitude='111.506732704337'}))
{ altitude = -4937, cz = { 4 = 96, 1 = 24, 2 = 48, 3 = 72 }, layer = { strength = 0.61, ceiling = -123, floor = -207 } }
Land
print(World_GetLocation({latitude='51.5052833557129', longitude='-2.27636313438416'}))
{ slope = 0, cover = { value = 12, text = 'Land: Croplands ' }, altitude = 128 }
Additional table items may be added later.
---
It is basically trying to show the details available in the cursor block from the map.
RE: Terrain type. Obtain with LUA?
Posted: Tue Dec 10, 2019 4:55 pm
by Bandura1
Thanks [&o]
RE: Terrain type. Obtain with LUA?
Posted: Thu Dec 12, 2019 12:25 am
by KnightHawk75
Thanks for this very useful addition.