Terrain type. Obtain with LUA?

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
Bandura1
Posts: 32
Joined: Sun Dec 11, 2016 5:46 am

Terrain type. Obtain with LUA?

Post by Bandura1 »

it is possible to obtain terrain of unit location?

Any code similar to World_GetElevation (location) but to terrain type.

Thanks.
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Terrain type. Obtain with LUA?

Post by KnightHawk75 »

Great question.
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Terrain type. Obtain with LUA?

Post by michaelm75au »

Has been added to the request list
Michael
User avatar
tjhkkr
Posts: 2431
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

RE: Terrain type. Obtain with LUA?

Post 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!
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
User avatar
michaelm75au
Posts: 12457
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Terrain type. Obtain with LUA?

Post 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.
Michael
Bandura1
Posts: 32
Joined: Sun Dec 11, 2016 5:46 am

RE: Terrain type. Obtain with LUA?

Post by Bandura1 »

Thanks [&o]
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Terrain type. Obtain with LUA?

Post by KnightHawk75 »

Thanks for this very useful addition.
Post Reply

Return to “Lua Legion”