Quick Turnaround Selector

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
wqc12345
Posts: 176
Joined: Mon Dec 07, 2015 2:56 pm
Location: San Francisco, CA

Quick Turnaround Selector

Post by wqc12345 »

I'm not sure how the "Enable Quick Turnaround" check box gets selected for a given unit via Lua?

I tried the following:

Code: Select all

 m = ScenEdit_GetUnit({name='Kimberley #1',side='SA'})
 ScenEdit_SetDoctrine({side=m.side, unitname=m.name}, {quick_turnaround_for_aircraft=0, ignore_plotted_course=true})

This does not result in the check box getting selected? Is this even possible in Lua?

update> setting "2" does DISABLE the doctrine for Quick Turnaround, but 0/1 does not select the check-box.
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Quick Turnaround Selector

Post by KnightHawk75 »

ORIGINAL: wqc12345

I'm not sure how the "Enable Quick Turnaround" check box gets selected for a given unit via Lua?

I tried the following:

Code: Select all

 m = ScenEdit_GetUnit({name='Kimberley #1',side='SA'})
 ScenEdit_SetDoctrine({side=m.side, unitname=m.name}, {quick_turnaround_for_aircraft=0, ignore_plotted_course=true})

This does not result in the check box getting selected? Is this even possible in Lua?

update> setting "2" does DISABLE the doctrine for Quick Turnaround, but 0/1 does not select the check-box.

You want the box checked meaning you want the editable setting, you can access with the following:

quick_turnaround_for_aircraft_player_editable= true | false




User avatar
wqc12345
Posts: 176
Joined: Mon Dec 07, 2015 2:56 pm
Location: San Francisco, CA

RE: Quick Turnaround Selector

Post by wqc12345 »

ok, tried that with just adding it as an attribute to the above code and no joy.

Is this another method? SetUnit? or something else other than doctrine?
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Quick Turnaround Selector

Post by KnightHawk75 »

Worked perfectly for me, I tried it before posting.

Code: Select all

local myunit = SE_GetUnit({guid='4FH7PU-0HM0LV5RLV4JO'})
 ScenEdit_SetDoctrine({guid=myunit.guid}, {quick_turnaround_for_aircraft=1})
 ScenEdit_SetDoctrine({guid=myunit.guid}, {quick_turnaround_for_aircraft_player_editable=false})
 print(ScenEdit_SetDoctrine({guid=myunit.guid,actual=true},{} ))
 
 
Set it to Fighters\ASW and Unchecked the previously checked box just as expected.

User avatar
wqc12345
Posts: 176
Joined: Mon Dec 07, 2015 2:56 pm
Location: San Francisco, CA

RE: Quick Turnaround Selector

Post by wqc12345 »

Thanks Knight.. again, I'm not saying you are not seeing a check-box clicked, but I'm not.. I run the exact code above on an aircraft with NO mission assigned (please note, NO mission, just sitting ready).. and no check-box is clicked. I pass in the guid and I can get it to disable, but I can never get the check-box to turn on.

Image

I've attached my scenario for reference.
Attachments
CubanCiga..la1989.zip
(111.06 KiB) Downloaded 12 times
KnightHawk75
Posts: 1850
Joined: Thu Nov 15, 2018 7:24 pm

RE: Quick Turnaround Selector

Post by KnightHawk75 »

I'm talking about the checkbox on the WRA screen which is what related to you doing SetDoctrine, your actually asking about a different checkbox on the airops screen. One enables if you can, one enables if you actually are using it. The latter I don't think can be done by lua at the moment, unless there is an undocumented way with setloadout params?

Image

Attachments
WRA_QT.jpg
WRA_QT.jpg (57.59 KiB) Viewed 471 times
User avatar
wqc12345
Posts: 176
Joined: Mon Dec 07, 2015 2:56 pm
Location: San Francisco, CA

RE: Quick Turnaround Selector

Post by wqc12345 »

Thanks Knight. Figured as much.

Do you know how to turn on that check box in my screen shot?
User avatar
michaelm75au
Posts: 12464
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Quick Turnaround Selector

Post by michaelm75au »

No, that option isn't available in Lua. It actually is on the aircraft so would need to add to the SE_SetUnit() and/or unit wrapper.
Michael
Post Reply

Return to “Lua Legion”