Page 1 of 1
Quick Turnaround Selector
Posted: Thu Jun 25, 2020 1:48 pm
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.
RE: Quick Turnaround Selector
Posted: Thu Jun 25, 2020 2:59 pm
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
RE: Quick Turnaround Selector
Posted: Thu Jun 25, 2020 4:03 pm
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?
RE: Quick Turnaround Selector
Posted: Thu Jun 25, 2020 9:09 pm
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.
RE: Quick Turnaround Selector
Posted: Fri Jun 26, 2020 3:56 pm
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.
I've attached my scenario for reference.
RE: Quick Turnaround Selector
Posted: Fri Jun 26, 2020 9:19 pm
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?
RE: Quick Turnaround Selector
Posted: Sat Jun 27, 2020 1:42 am
by wqc12345
Thanks Knight. Figured as much.
Do you know how to turn on that check box in my screen shot?
RE: Quick Turnaround Selector
Posted: Sat Jun 27, 2020 2:08 am
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.