So if the loadout you want exists for any aircraft you can assign that loadout to another aircraft unit.
For example if I want to give the j11d flanker b a lrasm loadout from a b-1b..
Code: Select all
local u = ScenEdit_AddUnit({type = 'Aircraft', name = 'MySide' .. ' j-11d #1', loadoutid = 22743,
heading = 0, dbid = 4039, side = 'NATO', Latitude="N2.00.00",Longitude="W4.55.00",
altitude="40000 ft",autodetectable="false",holdfire="true",proficiency=4,speed=350});
--## Tomahawk Command Datalink 1600 160ch
--ScenEdit_UpdateUnit({guid=tostring(u.guid),mode='add_comms',dbid='134'});
Other than that, in the truest sense the answer is no.
Only way if one doesn't exist to match what you want is to fake it. By adding a new mount to j-11, then inserting the weapons you want into the mount. Then removing the original weapons. The problem is when it lands it'll get the original weapons loaded back on or no loadout at all (though your customization gets retained), so you have to manage that somehow. The other downside is what's on the new mount will not count toward your aircraft's weight or external profile. Now if this is an aircraft you will control and not the ai, you can just leave the original weapons and tell yourself not use them and let it eat the normal amount of gas.
To do the mount trick you can either do it manually via weapons, add mount. Keep in mind different mounts come with different default firing times (on top of what the weapon may have). My personal favorite is 3017 a vls mounts, which is the fastest with hot-reloading capable of the larger mounts, that said you can look for one that it more to your needs there are some 12x ones that fire fast as I recall as well. Once you add it you then add the weapon record for your as-17's in your case look for entries that are 2/2 - note the weapon record id in the gui.
You said via lua. Plop the attached script into the console, then at the very end add the following after the ---add additional here --- line. I'm assuming you're doing this upon creation but just adjust using GetUnit if an existing unit, though this specific example is tied to the j-11d having the 20129 loadout so that the script properly removes it's default as-17s. Obviously change the side and aircraft names etc.
Code: Select all
--local u = ScenEdit_GetUnit({name='j-11d #Special1', side='MySide'})
local u = ScenEdit_AddUnit({type = 'Aircraft', name = 'j-11d #Special1'', loadoutid = 20129,
heading = 0, dbid = 4039, side = 'MySide', Latitude="N2.00.00",Longitude="W4.55.00",
altitude="40000 ft",autodetectable="false",holdfire="true",proficiency=4,speed=350});
AddCleanVLS3017(u);
local mguid = FindFirstMatchingMountIdByDBID(u,3017)
if(mguid ~=nil) then
ScenEdit_UpdateUnit({guid=u.guid,mode='add_weapon',dbid=871,mountid=mguid}); --dbid is weapon record id not weapon id.
ScenEdit_UpdateUnit({guid=u.guid,mode='add_weapon',dbid=7890,mountid=mguid});
ScenEdit_SetLoadout({unitname=u.guid,LoadoutID=0,wpn_dbid=276,number=2,remove=true}); --wpn_dbid here is actual weapon dbid
else
print('mguid was empty there was a problem.')
end
u=nil; mguid=nil;
I really wish we could have direct access to the loadout completely modifiable as a mount, even if it was a quasi 'unsupported' feature.
I hope this helps.