Get unit description / actual unit type

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

Get unit description / actual unit type

Post by Whicker »

Is it possible to get what the actual unit is? not just the name or dbid but the actual thing it is - like `MiG-29K Fulcrum D - 2015` or `SSBN 726 Ohio - 1992, Trident C4`.
I am logging losses to the luahistory log and want to know what the lost unit is - all I can get is something like `Lightning #2, Type: Aircraft`, but the name doesn't have much to do with what it actually is - or at least not always.

For Contact I see `type_description` which sounds promising, but that doesn't exist on Unit.

In the normal log it does show what the unit is ` Lightning #2 (F-35A Lightning II) has been destroyed!`. That is what I am trying to get.

I didn't see a way to convert a dbid into a description either.
Whicker
Posts: 665
Joined: Tue Jun 19, 2018 9:54 pm

RE: Get unit description / actual unit type

Post by Whicker »

this is in the unit wrapper now - classname. As of 998.10

Thanks!
Post Reply

Return to “Lua Legion”