Lua question: How to determine GUID

Post new mods and scenarios here.

Moderator: MOD_Command

Post Reply
Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

Lua question: How to determine GUID

Post by Rory Noonan »

Wading a bit deeper into Lua... It seems like using the GUID would cut down a lot of repetitive typing work. How do I determine the GUID of a unit or reference point?
Image
mx1
Posts: 76
Joined: Thu Jan 16, 2014 6:01 pm

RE: Lua question: How to determine GUID

Post by mx1 »

You can use GetUnit/GetReferencePoint function from the script console - example:

Code: Select all

 var = ScenEdit_GetReferencePoint({side='NATO',name='RP-2194'})
 print(var.guid)
 
 186a6e85-9be3-4a6b-96bb-32ea33db3c2d

or (for units only) go to menu 'Editor'->'SBR'-> 'Generate Template'. The saved XML file contains guids of all units in the scenario.

Rory Noonan
Posts: 2418
Joined: Thu Dec 18, 2014 1:53 am
Location: Brooklyn, NY

RE: Lua question: How to determine GUID

Post by Rory Noonan »

Fantastic. Thanks very much!!!
Image
Post Reply

Return to “Mods and Scenarios”