Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

Help adding a customised helo to a ship?

 
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 >> Help adding a customised helo to a ship? Page: [1]
Login
Message << Older Topic   Newer Topic >>
Help adding a customised helo to a ship? - 2/8/2022 4:45:14 PM   
Pipski

 

Posts: 2
Joined: 2/8/2022
Status: offline
Hi guys. I'm working on my first ever scenario at the moment, and it's been going well but I've run into a problem.

The precise model of helicopter I need isn't present in the database. No biggie -- I can make an equivalent by renaming a civilian model that is available and then bunging a searchlight on it -- however, I can't find a way to then start that modified helicopter on a ship or in a hangar, or to add one to a ship or airbase in the usual way, with [ctrl+F6], and then edit it once it's on/in there to change the name and sensors.

Is there an alternative way to accomplish this, that I'm just not thinking of? Or am I going to have to start them off nearby with orders to immediately land where I want them? (And yes, I know it's an anally retentive thing to obsess about, but it'll just annoy me every time I load the mission if I can't make it work!)

Any suggestions gratefully received.
Post #: 1
RE: Help adding a customised helo to a ship? - 2/8/2022 6:33:26 PM   
KnightHawk75

 

Posts: 1450
Joined: 11/15/2018
Status: offline
Yes once stored at a base you can't select the unit to make modifications, so either add the customization via Lua (ScenEdit_UpdateUnit), or edit them before placing them into their hosting units during development.

For example adding a searchlight to 10 choppers with similar names who are sitting in a base:
local function addSpotlight(unitbasename,sidename,start,stop)
  local arcT={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'}; 
  local arcD={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'}; 
  local arcM={'360'};
  for i = start,stop do
    local u = ScenEdit_GetUnit({side=sidename,name=unitbasename..i});
    ScenEdit_UpdateUnit({guid=u.guid,mode="add_sensor",dbid=1080,arc_detect=arcD,arc_track=arcT, arc_mount=arcM}) --Generic spotlight 360 view
  end
end
addSpotlight("Chopper #","Red",1,10) --- add a spotlight to 'Chopper #1' through 'Chopper #10';

If customizing manually and you're just asking how to shove a unit into a base when done adding and customizing it:
You can call ScenEdit_HostUnitToParent({HostedUnitNameOrID='GUIDOF-THEUNITHEREXX',SelectedHostNameOrID='GUIDOF-THEBASEHEREXX'}) on each unit to insert them to a base\hosting unit. You can easily get the guid of a unit in the editor by pressing ctrl-c and pasting into the console. You could use names as well but they'll have to be globally unique names as there is no side specifier.
local function insertUnitsIntoBase(unitbasename,sidename,destinationGuid,start,stop)
  for i = start,stop do
    local u = ScenEdit_GetUnit({side=sidename,name=unitbasename..i});
    ScenEdit_HostUnitToParent({HostedUnitNameOrID=u.guid,SelectedHostNameOrID=destinationGuid})
  end
end
insertUnitsIntoBase("Chopper #","Red","GUIDOF-BASEHERE",1,10)

Or do it all at once create, add the sensor and insert in one go.
local function addMyCustomChoppersToBase(unitbasename,type,sidename,number,dbid,loadout,baseguid)
  local arcT={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'}; 
  local arcD={'PB1','PB2','SB1','SB2','SMF1','SMF2','SMA1','SMA2','SS1','SS2','PS1','PS2','PMA1','PMA2','PMF1','PMF2'}; 
  local arcM={'360'};
  for i = 1,number do
    local u = ScenEdit_AddUnit({side=sidename,type=type,name=unitbasename..i,dbid=dbid,loadoutID=loadout,latitude=0.0,longitude=0.0,altitude=0}); -- create unit.
    u = ScenEdit_UpdateUnit({guid=u.guid,mode="add_sensor",dbid=1080,arc_detect=arcD,arc_track=arcT, arc_mount=arcM}); --Generic spotlight 360 view
    ScenEdit_HostUnitToParent({HostedUnitNameOrID=u.guid,SelectedHostNameOrID=baseguid}); --insert into base
  end    
end
addMyCustomChoppersToBase("GlobalRanger #","Aircraft","Red",10,4848,26432,'4FH7PU-0HMFB711P8969'); --add 10, with customization to base specified.


< Message edited by KnightHawk75 -- 2/8/2022 6:34:00 PM >

(in reply to Pipski)
Post #: 2
RE: Help adding a customised helo to a ship? - 2/8/2022 6:46:56 PM   
Pipski

 

Posts: 2
Joined: 2/8/2022
Status: offline
Outstanding, thank you! I will play around with that code and give it a go -- much obliged, dude. :-)

e; worked like a charm!

< Message edited by Pipski -- 2/9/2022 5:12:41 PM >

(in reply to KnightHawk75)
Post #: 3
RE: Help adding a customised helo to a ship? - 2/21/2022 1:33:39 PM   
benefant

 

Posts: 93
Joined: 6/5/2015
From: Austria
Status: offline
I use simple methode:

Set the Base and the aircraft to another continent. Modifify aircraft in flight with Sensors and weapons - a Cessna with guns and ironie bombe etc.

Return to base and then move the base back.

(in reply to Pipski)
Post #: 4
Page:   [1]
All Forums >> [New Releases from Matrix Games] >> Command: Modern Operations series >> Mods and Scenarios >> Help adding a customised helo to a ship? 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

1.656