Page 1 of 1

Escort missions

Posted: Fri Aug 03, 2018 8:49 am
by Gunner98
Hay guys

This should be a simple one but I'm doing something wrong with it.



for i=1,18 do
if ScenEdit_GetUnit({Side='WP', Name="582nd IAP #"..i,}) ~= nil then
ScenEdit_AssignUnitToMission("582nd IAP #"..i, "Laage AB", escort=True)
end
end


Everything is working except for assigning the units as escort. Assigning to the base mission is fine, so its probably a syntax issue with the Boolean statement for assigning to escort. Have tried various combinations of ' & } to no effect.


Any help would be appreciated.


Thanks


RE: Escort missions

Posted: Fri Aug 03, 2018 11:28 am
by stilesw
Gunnar98,

Think I found it. The syntax does not want the word "escort" (go figure). I tested this and it worked:

ScenEdit_AssignUnitToMission ("F-15I-1", "Strike-Baghdad", true)

-Wayne

RE: Escort missions

Posted: Fri Aug 03, 2018 11:47 am
by Gunner98
Thanks Wayne

Weird - also had an issue with using a capital 'T'! So true has to be all lower case.

Thanks


B

RE: Escort missions

Posted: Fri Aug 03, 2018 1:37 pm
by stilesw
I found that also. Also several cases where the Lua documentation names do not match what's needed such as in the unit wrapper - the example provided uses unit.class where you actually must use unit.classname. Just shows that the more complex the system the more "minor" glitches can occur.

-Wayne

RE: Escort missions

Posted: Fri Aug 03, 2018 8:18 pm
by michaelm75au
ScenEdit_AssignUnitToMission("582nd IAP #"..i, "Laage AB", escort=True)
The 'xxx=yyy' as a parameter is really only relevant to Lua tables. The core Lua interpreter usually works on specific keywords and is mainly case sensitive.
Where possible, table parameters are treated as case insenitive

RE: Escort missions

Posted: Sat Aug 04, 2018 10:16 am
by stilesw
Thanks for the explanation. That helps.

-Wayne

RE: Escort missions

Posted: Sat Aug 04, 2018 4:29 pm
by Gunner98
Thanks for that

B