Transferring CMO map to TOAW map

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
DracheTek
Posts: 46
Joined: Sun Jul 05, 2020 11:55 am

Transferring CMO map to TOAW map

Post by DracheTek »

I wrote up a piece of code like following:

Code: Select all

 
 startN = 26
 startE = 119.3
 
 N = startN
 E = startE
 incN = *something that looked like phone number to the forum system*
 incE = *something that looked like phone number to the forum system*
 
 
 for e = 1,200 do 
     for n = 1,150 do
         terrain = World_GetLocation({latitude = N, longitude = E})
         if terrain.cover ~= nil then
         print(e..":"..n.."  :"..terrain.cover.text)
         else if terrain.altitude ~= nil then
             if terrain.cz~=nil then
                 print(e..":"..n.."  :Deep Water")
             else print (e..":"..n.."  :Shallow Water")
             end
         else print (e..":"..n.."  :ERROR")
         end
         end
         --ScenEdit_AddReferencePoint({side = 'BLUE', name = n..":"..e, lat = N, lon = E, highlighted = true})
         N=N+incN
         --break
     end
     N = startN
     E = E+incE
     --break
 end
 
 

Obviously it can grab the location info of a CMO map and return ground type or "water" in the form of string, but I currently cannot figure out how to transfer this into TOAW ground type. the structure of mml file of TOAW is pretty straightforward, but it lacks of documentation and I am pretty stuck.

If here is anyone who is familiar with TOAW XML, please help. Thank you very much in advance.
Post Reply

Return to “Lua Legion”