Page 1 of 1

LUA for GUID of a manually selected contact?

Posted: Thu Nov 01, 2018 1:42 pm
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!

RE: LUA for GUID of a manually selected contact?

Posted: Fri Nov 02, 2018 7:45 pm
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.

RE: LUA for GUID of a manually selected contact?

Posted: Sat Nov 03, 2018 9:20 am
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