--add a cleaned out 3017 vls mount capacity 64 quick firing time. local function AddCleanVLS3017(theUnitobj) 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'}; specialMountId = 3017 ScenEdit_UpdateUnit({guid=tostring(theUnitobj.guid),mode='add_mount',dbid=specialMountId,arc_detect=arcD, arc_track=arcT, arc_mount=arcM}); local tcount = #theUnitobj.mounts local myList = {}; -- hold the items to remove. local bflag = false; for i = 1,tcount do if (theUnitobj.mounts[i]["mount_dbid"] == specialMountId) and (#theUnitobj.mounts[i]["mount_weapons"] > 0) then for wp=1,#theUnitobj.mounts[i]["mount_weapons"] do --if (theUnitobj.mounts[i]["mount_weapons"][wp]["wpn_dbid"] == dbid) then --dbid is weaponDBID. --remove all entries of this weapontype on this typemount. --print('AddCleanVLS(): adding entry scoped by mountid i: ' .. i .. ' wp:' .. wp .. ' ' .. theUnitobj.mounts[i]["mount_weapons"][wp]["wpn_guid"] .. ' name: ' .. theUnitobj.mounts[i]["mount_weapons"][wp]["wpn_name"]); table.insert(myList,{Wguid=theUnitobj.mounts[i]["mount_weapons"][wp]["wpn_guid"], Mguid=theUnitobj.mounts[i]["mount_guid"], wpn_dbid=theUnitobj.mounts[i]["mount_weapons"][wp]["wpn_dbid"]}); bflag=true; --end end end end if (bflag == true) then print('AddCleanVLS(): there are '.. #myList .. ' weapons to remove') for k,v in pairs(myList) do ScenEdit_UpdateUnit({guid=theUnitobj.guid,mode='remove_weapon',dbid=v.wpn_dbid,mountid=v.Mguid,weaponid=v.Wguid}); --must give mountid end print('AddCleanVLS(): removed weapons'); end end local function FindFirstMatchingMountIdByDBID(unit,matchdbid) if (unit ~=nil and matchdbid ~=nil) then for i =1,#unit.mounts do if(unit.mounts[i]["mount_dbid"] == matchdbid) then return unit.mounts[i]["mount_guid"] end end end end local function b1bWithAim260(theside,thename,incMissingComms,incSensors,incWeapons) if incMissingComms ==nil then incMissingComms = false; end local u = ScenEdit_AddUnit({type = 'Aircraft', name = thename, side = theside, dbid=4909,loadoutid = 27465, Latitude='S20.51.55', Longitude = 'W119.43.21', heading = 0, altitude="36000 FT",autodetectable="false",holdfire="false", proficiency=4, speed=350}) 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'}; local arcT2={'PB1','PB2','SB1','SB2','SMF1','SMF2','PMF2','PMF1'}; local arcD2={'PB1','PB2','SB1','SB2','SMF1','SMF2','PMF2','PMF1'}; if incMissingComms then --## Tomahawk Command Datalink 1600 160ch needed for re-attack\post launch control of lrsm etc ScenEdit_UpdateUnit({guid=tostring(u.guid),mode='add_comms',dbid='134'}); --## AIM 120 Command Datalink [two-way offboard] 8 ch? [act like e2-d remote control] ScenEdit_UpdateUnit({guid=tostring(u.guid),mode='add_comms',dbid='317'}); --## AIM 120 Command Datalink [two-way offboard] --ScenEdit_UpdateUnit({guid=tostring(myunit.guid),mode='add_comms',dbid='317'}); end if incSensors then ScenEdit_UpdateUnit({guid=u.guid,mode='add_sensor',dbid=4477,arc_detect=arcD2,arc_track=arcT2,arc_mount=arcM}) end if incWeapons then AddCleanVLS3017(u) local mguid = FindFirstMatchingMountIdByDBID(u,3017) if mguid ~=nil then --12 pack of aim-260 ScenEdit_UpdateUnit({guid=u.guid,mode='add_weapon',dbid=8962,mountid=mguid}); --must give mountid --12 pack of aim-120d's ScenEdit_UpdateUnit({guid=u.guid,mode='add_weapon',dbid=8636,mountid=mguid}); --must give mountid --6 pack of aim-9x block III's ScenEdit_UpdateUnit({guid=u.guid,mode='add_weapon',dbid=8925,mountid=mguid}); --must give mountid else print("failed to find 3017 mount."); end end print("b1 done.") end b1bWithAim260('Blue','MegaMaidBomber #1',true,true,true)