Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Getting GUID of Aircraft on the Ground

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Getting GUID of Aircraft on the Ground Page: [1]
Login
Message << Older Topic   Newer Topic >>
Getting GUID of Aircraft on the Ground - 3/5/2018 8:20:42 PM   
SeaQueen


Posts: 1451
Joined: 4/14/2007
From: Washington D.C.
Status: offline
Is there a way to copy/paste the unit ID of an aircraft at an airbase in the scenario editor the same way you can copy/paste it with other units? (I.e. Right click the unit -> Scenario Editor -> Copy unit ID to clipboard)

< Message edited by SeaQueen -- 3/6/2018 12:30:29 PM >
Post #: 1
RE: Getting GID of Aircraft on the Ground - 3/6/2018 12:54:23 AM   
ExNusquam

 

Posts: 513
Joined: 3/4/2014
From: Washington, D.C.
Status: offline
It isn't clean, but try this in the console:
unit=ScenEdit_GetUnit({side="Test Side", unitname="Test #1"})
print(unit.guid)

(in reply to SeaQueen)
Post #: 2
RE: Getting GID of Aircraft on the Ground - 3/6/2018 2:45:27 AM   
SeaQueen


Posts: 1451
Joined: 4/14/2007
From: Washington D.C.
Status: offline
Darn... I was hoping I wouldn't have to resort to that.

(in reply to ExNusquam)
Post #: 3
RE: Getting GID of Aircraft on the Ground - 3/6/2018 3:25:44 AM   
Randomizer


Posts: 1473
Joined: 6/28/2008
Status: offline
If you create a SBR Template (NOT a Delta Template), you will find the aircraft listed by name and GUI in the facilities where they live. You can then copy/paste as needed. A bit of detective work may be necessary but still probably quicker than repeating Lua scripts in the console. Example:
quote:

<Unit_fcfb0dc5-eacc-41cb-8e64-238ae9bb97d4>
<!--Kremovo-MiG #27 (MiG-21F-13 Fishbed C [125])-->

Try a word search of the *.ini file using the name of the aircraft in question.

-C

< Message edited by Randomizer -- 3/6/2018 3:27:06 AM >

(in reply to SeaQueen)
Post #: 4
RE: Getting GID of Aircraft on the Ground - 3/6/2018 4:39:37 AM   
Rory Noonan

 

Posts: 2816
Joined: 12/18/2014
From: Brooklyn, NY
Status: offline
I wrote a quick function for you to use. It's not quite as simple as point and click--but still pretty darn easy!
quote:

function ListAircraft(groupTable)
groupData = ScenEdit_GetUnit({guid=groupTable.guid})
hostedAircraft = groupData.hostedUnits.Aircraft
for k,v in pairs (hostedAircraft) do
local unit = ScenEdit_GetUnit({guid=v})
print ("{name='"..unit.name.."', guid='"..unit.guid.."'},")
end
end

To use this, paste the above into your Lua console. Then select your group or unit with hosted aircraft, and copy the unit/group GUID as you mentioned above (ctrl+C or use the Edit>Unit>Copy Data to Clipboard), then type into the console ListAircraft(), click between the brackets and paste your unit data. Should look like this (obviously different names and IDs):
quote:

ListAircraft({name='Melbourne Intl', guid='f1784395-fb52-4712-851a-f5fec5a66e29'})

Click run and you'll have a list of name and GUID for all the aircraft hosted to that unit or base.

Hope that helps.

< Message edited by apache85 -- 3/6/2018 4:42:06 AM >


_____________________________


(in reply to Randomizer)
Post #: 5
RE: Getting GID of Aircraft on the Ground - 3/6/2018 6:33:41 PM   
SeaQueen


Posts: 1451
Joined: 4/14/2007
From: Washington D.C.
Status: offline
That may be the perfect solution! Thanks!

(in reply to Rory Noonan)
Post #: 6
RE: Getting GID of Aircraft on the Ground - 3/7/2018 1:51:10 AM   
ExNusquam

 

Posts: 513
Joined: 3/4/2014
From: Washington, D.C.
Status: offline
That's pretty slick apache, thanks for sharing.

(in reply to SeaQueen)
Post #: 7
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Getting GUID of Aircraft on the Ground Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.688