Page 1 of 1

Sonobuoy under UAV

Posted: Sun Jan 17, 2021 10:15 am
by Parel803
Good afternoon,
Struggling with the changes of weapon, mounts, etc. Hope someone can help me.
I have a Campcopter initiated by LUA and wanna assign him to a ASW mission with an Active sonobouy. With previous learned bearing/distance from ZZ
I finally came up with changing the LoadoutID from another airborne unit.
local Brg1 = 100; local Dist1=35
local ZZUnit = ScenEdit_GetUnit({name='xxx', guid='50PVO4-xxx-U2T2SG'});
local pt = World_GetPointFromBearing( {LATITUDE=ZZUnit.latitude,LONGITUDE=ZZUnit.longitude,BEARING=Brg1, DISTANCE=Dist1} )
local Unit1 = ScenEdit_AddUnit({side='Blueland', Type='Aircraft', Name='Gull Three', Guid='50PVO4-Gull3-0HM5BECGABQF6', proficiency=2, dbid=3445, loadoutid= 22232, lat=pt.latitude,lon=pt.longitude, Heading=180, speed=25, altitude=50})

Now I wanna change the amount of Dicass to 2.

ScenEdit_SetLoadout({name='Gull Three', guid='50PVO4-Gull3-0HM5BECGABQF6', loadoutid=13531, wpn_dbid=2480, Remove=6})

If it is possible, what am I'm doing wrong?

with regards GJ


RE: Sonobuoy under UAV

Posted: Sun Jan 17, 2021 8:02 pm
by KnightHawk75
Couple things.

1. you can't swap loadout's in the air, you have to do that while it's hosted. Set it when you create the air unit or while it's on the ground.

2. As for the modification of the existing loadout in the air you can do that, there you just had a syntax problem.
loadoutid didn't = 0 and you need number=X remove=true to remove the number vs add it when remove=false or missing.

ScenEdit_SetLoadout({unitname=Unit1.guid, loadoutid=0, wpn_dbid=2480, number=6, Remove=true}) -- loadout0= means 'use current\no change'

RE: Sonobuoy under UAV

Posted: Mon Jan 18, 2021 5:17 am
by Parel803
thx again. appriciate your time for doing this
Works great, sorry for the sometimes stupid Q's
with regards GJ

RE: Sonobuoy under UAV

Posted: Mon Jan 18, 2021 4:46 pm
by KnightHawk75
ORIGINAL: Parel803

thx again. appriciate your time for doing this
Works great, sorry for the sometimes stupid Q's
with regards GJ

Not stupid, it's not necessarily obvious that you can't do that and the error indicates more of a weapon problem than a "you can't do that!" problem. I wish we could though I understand spending coding time to allow for things that don't really happen is a super low priority, but it sure would come in handy. :)

The syntax part for what it's worth is documented, just takes getting used too, comes with time, and I make head scratching syntax screw ups too, sometimes you just need a second set of eyes to see the problem.

RE: Sonobuoy under UAV

Posted: Mon Jan 18, 2021 5:13 pm
by Parel803
thx for the kind words. It's fun to do :-)

RE: Sonobuoy under UAV

Posted: Sat Jan 23, 2021 9:12 am
by Parel803
Follow-up Q if I may:
Got the swap of loadouID inn air, not possible.
But I can chage the nr with remove=true.
I cannot change the nr of by remove=true when AUV still on deck of ship. Just try to find out if that is the truth?
I gave my UAV, on deck, a different loadout. Not the DB one. But wanna give het less torpedo's and Sonobuoys.

Thanks again and regards
GJ

RE: Sonobuoy under UAV

Posted: Sat Jan 23, 2021 4:48 pm
by KnightHawk75
I think that's right, I'd have to double check, you can drop the optional parts of loadouts but may not be able to change the amounts.

RE: Sonobuoy under UAV

Posted: Sun Jan 24, 2021 5:59 am
by Parel803
thx again