Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Mission Switch

 
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 >> Mods and Scenarios >> Lua Legion >> Mission Switch Page: [1]
Login
Message << Older Topic   Newer Topic >>
Mission Switch - 3/25/2021 9:07:46 PM   
Gunner98

 

Posts: 5469
Joined: 4/29/2005
From: The Great White North!
Status: offline
I'm wondering if there is a slicker way of doing a mission switch for units.

I've been using the following type code which works quite well and is simple enough:

---------------
for i=1,2 do
if ScenEdit_GetUnit({Side='NATO Support', Name="No.101 Sqn RAF #"..i,}) ~= nil then
ScenEdit_AssignUnitToMission("No.101 Sqn RAF #"..i, "Tanker Kef")
end
end
--------------

I am setting up a series of mission where 3 different groups of bombers first marshal and then on a trigger switch to a strike mission. So it is easy enough to do 3 different commands as above but is there a way of saying:

All units assigned to Mission X change to mission Y?

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/
Post #: 1
RE: Mission Switch - 3/26/2021 6:47:59 AM   
KnightHawk75

 

Posts: 1417
Joined: 11/15/2018
Status: offline
quote:

All units assigned to Mission X change to mission Y?

Sure you can use the unitlist in the mission wrapper to pull the list of units to move.
local missionX = ScenEdit_GetMission("NATO Support","Mission X")
if (missionX ~=nil) and missionX.unitlist ~=nil then
  for key,value in pairs(missionX.unitlist) do  --each value is just a guid in this case. 
    ScenEdit_AssignUnitToMission(value, "Tanker Kef")
  end
end



< Message edited by KnightHawk75 -- 6/16/2021 4:42:22 AM >

(in reply to Gunner98)
Post #: 2
RE: Mission Switch - 3/26/2021 9:07:46 AM   
Gunner98

 

Posts: 5469
Joined: 4/29/2005
From: The Great White North!
Status: offline
Thanks, I'll give that a try tonight.

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/

(in reply to KnightHawk75)
Post #: 3
RE: Mission Switch - 3/26/2021 5:53:18 PM   
Gunner98

 

Posts: 5469
Joined: 4/29/2005
From: The Great White North!
Status: offline
quote:

Sure you can use the unitlist in the mission wrapper to pull the list of units to move.


Worked the charm! Thank you very much once again.

_____________________________

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/

(in reply to KnightHawk75)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Mission Switch 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.146