LUA for GUID of a manually selected contact?

All discussions & material related to Command's Lua interface

Moderators: angster, RoryAndersonCDT, michaelm75au, MOD_Command

Post Reply
msc
Posts: 108
Joined: Wed Jul 31, 2013 4:32 pm
Location: Austria

LUA for GUID of a manually selected contact?

Post by msc »

What is the LUA function to find out the GUID of a contact, which was manually selected (highlightend) on the map? (I looked into the documentation and forum, but was not able to find a solution.)
I want to select a contact with mouseclick (or multiple contacts with Shift+mousclick) on the map, start a "Special Action" and LUA should read the GUID for futher processesing.
Many thanks for your help!
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: LUA for GUID of a manually selected contact?

Post by michaelm75au »

You can highlight the contacts and press ctlr-c to put the ids into clipboard (but then it would contain the GUIDs), but I don't think any of the current functions take data from the clipboard.
Might be useful so I'll have a look to see how it could work - probably function to return a table of GUIDs, which can then be used as a source for calling the standard functions.
Michael
msc
Posts: 108
Joined: Wed Jul 31, 2013 4:32 pm
Location: Austria

RE: LUA for GUID of a manually selected contact?

Post by msc »

Thanks Michael,
an interesting method to find out the GUID quickly. (It would be nice to get the GUIDS out of the clipboard back into LUA...)

In the meantime I used this workaround:
I created a strike mission (just a dummy), where the player has to seclect his contacts (assign them as target).
Then when the player uses a "Special Action" Event, LUA can read out the GUID of the assigned targets for further processing.

Martin
Post Reply

Return to “Lua Legion”