Escort missions

All discussions & material related to Command's Lua interface

Moderators: RoryAndersonCDT, michaelm75au, angster, MOD_Command

Post Reply
User avatar
Gunner98
Posts: 5996
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

Escort missions

Post 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

Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
User avatar
stilesw
Posts: 1572
Joined: Wed Jun 25, 2014 10:08 pm
Location: Hansville, WA, USA

RE: Escort missions

Post 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
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”

Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)
User avatar
Gunner98
Posts: 5996
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Escort missions

Post by Gunner98 »

Thanks Wayne

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

Thanks


B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
User avatar
stilesw
Posts: 1572
Joined: Wed Jun 25, 2014 10:08 pm
Location: Hansville, WA, USA

RE: Escort missions

Post 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
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”

Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)
User avatar
michaelm75au
Posts: 12463
Joined: Sat May 05, 2001 8:00 am
Location: Melbourne, Australia

RE: Escort missions

Post 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
Michael
User avatar
stilesw
Posts: 1572
Joined: Wed Jun 25, 2014 10:08 pm
Location: Hansville, WA, USA

RE: Escort missions

Post by stilesw »

Thanks for the explanation. That helps.

-Wayne
“There is no limit to what a man can do so long as he does not care a straw who gets the credit for it.”

Charles Edward Montague, English novelist and essayist
~Disenchantment, ch. 15 (1922)
User avatar
Gunner98
Posts: 5996
Joined: Fri Apr 29, 2005 12:49 am
Location: The Great White North!
Contact:

RE: Escort missions

Post by Gunner98 »

Thanks for that

B
Check out our novel, Northern Fury: H-Hour!: http://northernfury.us/
And our blog: http://northernfury.us/blog/post2/
Twitter: @NorthernFury94 or Facebook https://www.facebook.com/northernfury/
Post Reply

Return to “Lua Legion”