Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Adding Groups to a Mission

 
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 >> Adding Groups to a Mission Page: [1]
Login
Message << Older Topic   Newer Topic >>
Adding Groups to a Mission - 4/27/2021 3:04:58 AM   
ProdigyofMilitaryPride

 

Posts: 103
Joined: 4/17/2015
Status: offline
I'm planning to use LUA for a Soviet bomber raid on a US carrier group [that's defending the western Iceland from Soviet aggression] after being detected by patrol aircraft near Iceland.
How is it supposed to be done? What strings do I need? What specialized lines of code might be required?

_____________________________

"The courageous must protect freedom." - Dwight D. Eisenhower
"Anything built by human hands can be destroyed. This is no exception." - Kei "Edge" Nagase, Ace Combat 5: The Unsung War
Post #: 1
RE: Adding Groups to a Mission - 4/27/2021 4:04:08 AM   
boogabooga

 

Posts: 457
Joined: 7/18/2018
Status: offline
Greetings.

You really should read the manual and practice mission building a little. Experiment.

But to answer your question-

You may not even need Lua at all, or even a scripted event. Is that carrier group the Soviets' only possible target? If so, you could just assign the bombers to an ASuW Strike mission with no specific target. The strike will launch as soon as suitable targets are detected.

Try to get familiar with the C:MO mission system before anything else.

(in reply to ProdigyofMilitaryPride)
Post #: 2
RE: Adding Groups to a Mission - 4/28/2021 5:08:46 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
If it's basic you don't need much, maybe 3 lines, the rest you can do with events, depends on how dynamic you need it to be and how dynamic the scene will be though, the more complex and dynamic the more code, but you can cover a lot ground with just a couple lines.

Attached a simple little sample that highlights a basic detection and mission activation, along with a two line action that adds the detected things to premade missions targetlist as it detects each at a certain level. It's just meant to show you what's already built in with nearly no LUA, recon detects ships, ships get added, strike mission begins while more are still being detected.

db488 required v1147.20+
TesRig-AddTargetsToMissionOnDetection-SampleMinimalLua2_posted5009303.zip

As for the specific question of how to add a group to a mission, simple way is a one-liner.
ScenEdit_AssignUnitToMission("SomeUniqueGroupNameHere","TheUniqueStrikeMissionName");
-- If one or neither 'names' are unique in the total scene, but are at least on the side then:
local g = ScenEdit_GetUnit({side="USSR",name="TheGroupNameHere"});
local m = ScenEdit_GetMission('USSR','TheMissionName');
ScenEdit_AssignUnitToMission(g.guid,m.guid)


Attachment (1)

< Message edited by KnightHawk75 -- 4/28/2021 5:38:33 PM >

(in reply to ProdigyofMilitaryPride)
Post #: 3
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Lua Legion >> Adding Groups to a Mission 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.668