Carrier Strike Group
Moderators: michaelm75au, angster, RoryAndersonCDT, MOD_Command
Carrier Strike Group
Hello,
Im building a Carrier Strike Group with random names and proficiency (aircraft, destroyers, submarines and so on). I would like to center as much as possible around lat/long of the carrier so i just need input the carriers lat/lon and then use "relativeTo" or "World_GetPointFromBearing" for the other ships.Sombody has a easy solution to make Henry J Kaiser and USS Chicago bearing and distance to George Bush? So i dont need to change like 10 lat/lon coordinates when i need the group in some other part of the world...
--ADD CARRIER
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude="N69.00.00",Longitude="E10.00.00", altitude="0 ft", speed=0,proficiency=4})
--ADD Support ship
ScenEdit_AddUnit({type='Ship', name='Henry J. Kaiser 187', heading =180, speed=0, dbid =26, side ='USA', Latitude="N68.59.10",Longitude="E10.01.30", altitude="0 ft",proficiency=4})
--ADD Submarine SSN 700 Dallas [Los Angeles Class] 2008
ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude="N69.03.10",Longitude="E10.00.00", altitude="-300 ft",proficiency=3})
Im building a Carrier Strike Group with random names and proficiency (aircraft, destroyers, submarines and so on). I would like to center as much as possible around lat/long of the carrier so i just need input the carriers lat/lon and then use "relativeTo" or "World_GetPointFromBearing" for the other ships.Sombody has a easy solution to make Henry J Kaiser and USS Chicago bearing and distance to George Bush? So i dont need to change like 10 lat/lon coordinates when i need the group in some other part of the world...
--ADD CARRIER
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude="N69.00.00",Longitude="E10.00.00", altitude="0 ft", speed=0,proficiency=4})
--ADD Support ship
ScenEdit_AddUnit({type='Ship', name='Henry J. Kaiser 187', heading =180, speed=0, dbid =26, side ='USA', Latitude="N68.59.10",Longitude="E10.01.30", altitude="0 ft",proficiency=4})
--ADD Submarine SSN 700 Dallas [Los Angeles Class] 2008
ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude="N69.03.10",Longitude="E10.00.00", altitude="-300 ft",proficiency=3})
- TitaniumTrout
- Posts: 469
- Joined: Mon Oct 20, 2014 9:06 am
- Location: Michigan
Re: Carrier Strike Group
This is a fairly quick way to do it by using variables and random.Zyph wrote: ↑Mon Mar 20, 2023 11:15 pm Im building a Carrier Strike Group with random names and proficiency (aircraft, destroyers, submarines and so on). I would like to center as much as possible around lat/long of the carrier so i just need input the carriers lat/lon and then use "relativeTo" or "World_GetPointFromBearing" for the other ships.Sombody has a easy solution to make Henry J Kaiser and USS Chicago bearing and distance to George Bush? So i dont need to change like 10 lat/lon coordinates when i need the group in some other part of the world...
Code: Select all
local lat = '23.8611'
local lon = '-131.8288'
math.randomseed(os.time())
--ADD CARRIER
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude=lat,Longitude=lon, altitude="0 ft", speed=0,proficiency=4})
--ADD Support ship
ScenEdit_AddUnit({type='Ship', name='Henry J. Kaiser 187', heading =180, speed=0, dbid =26, side ='USA', Latitude=((math.random(10)/10)+lat+.020),Longitude=((math.random(5)/5)+lon-0.10), altitude="0 ft",proficiency=4})
--ADD Submarine SSN 700 Dallas [Los Angeles Class] 2008
ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude=((math.random(10)/10)+lat+0.30),Longitude=((math.random(6)/6)+lon+0.11), altitude="-300 ft",proficiency=3})
CMO WIKI - https://wiki.weaponsrelease.com
Re: Carrier Strike Group
Thank you! Not just optimal for what i have in mind. The plan is to have the USS Chicago 5 nm 0 degree in front of the carrier, Ticonderoga also front then Arleigh Burke classes on 45, 135, 225, 315 degrees from the Carrier with a distance around 6 nm from carrier and two Support ships just behind...TitaniumTrout wrote: ↑Tue Mar 21, 2023 12:39 amThis is a fairly quick way to do it by using variables and random.Zyph wrote: ↑Mon Mar 20, 2023 11:15 pm Im building a Carrier Strike Group with random names and proficiency (aircraft, destroyers, submarines and so on). I would like to center as much as possible around lat/long of the carrier so i just need input the carriers lat/lon and then use "relativeTo" or "World_GetPointFromBearing" for the other ships.Sombody has a easy solution to make Henry J Kaiser and USS Chicago bearing and distance to George Bush? So i dont need to change like 10 lat/lon coordinates when i need the group in some other part of the world...
Code: Select all
local lat = '23.8611' local lon = '-131.8288' math.randomseed(os.time()) --ADD CARRIER ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude=lat,Longitude=lon, altitude="0 ft", speed=0,proficiency=4}) --ADD Support ship ScenEdit_AddUnit({type='Ship', name='Henry J. Kaiser 187', heading =180, speed=0, dbid =26, side ='USA', Latitude=((math.random(10)/10)+lat+.020),Longitude=((math.random(5)/5)+lon-0.10), altitude="0 ft",proficiency=4}) --ADD Submarine SSN 700 Dallas [Los Angeles Class] 2008 ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude=((math.random(10)/10)+lat+0.30),Longitude=((math.random(6)/6)+lon+0.11), altitude="-300 ft",proficiency=3})
- Attachments
-
- Screenshot 2023-03-21 095252.jpg (393.26 KiB) Viewed 751 times
Re: Carrier Strike Group
Have been trying this out but cant get it to work...Zyph wrote: ↑Tue Mar 21, 2023 1:45 amThank you! Not just optimal for what i have in mind. The plan is to have the USS Chicago 5 nm 0 degree in front of the carrier, Ticonderoga also front then Arleigh Burke classes on 45, 135, 225, 315 degrees from the Carrier with a distance around 6 nm from carrier and two Support ships just behind...TitaniumTrout wrote: ↑Tue Mar 21, 2023 12:39 amThis is a fairly quick way to do it by using variables and random.Zyph wrote: ↑Mon Mar 20, 2023 11:15 pm Im building a Carrier Strike Group with random names and proficiency (aircraft, destroyers, submarines and so on). I would like to center as much as possible around lat/long of the carrier so i just need input the carriers lat/lon and then use "relativeTo" or "World_GetPointFromBearing" for the other ships.Sombody has a easy solution to make Henry J Kaiser and USS Chicago bearing and distance to George Bush? So i dont need to change like 10 lat/lon coordinates when i need the group in some other part of the world...
Code: Select all
local lat = '23.8611' local lon = '-131.8288' math.randomseed(os.time()) --ADD CARRIER ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude=lat,Longitude=lon, altitude="0 ft", speed=0,proficiency=4}) --ADD Support ship ScenEdit_AddUnit({type='Ship', name='Henry J. Kaiser 187', heading =180, speed=0, dbid =26, side ='USA', Latitude=((math.random(10)/10)+lat+.020),Longitude=((math.random(5)/5)+lon-0.10), altitude="0 ft",proficiency=4}) --ADD Submarine SSN 700 Dallas [Los Angeles Class] 2008 ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude=((math.random(10)/10)+lat+0.30),Longitude=((math.random(6)/6)+lon+0.11), altitude="-300 ft",proficiency=3})
local dist=6
local bear=45
local position = World_GetPointFromBearing({latitude='George Bush'.latitude,longitude='George Bush'.longitude,distance=dist,bearing=bear})
ScenEdit_AddUnit({type='Submarine', name='USS Chicago', heading =0, speed=0, dbid =533, side ='USA', Latitude=position.latitude, Longitude=position.latitude, altitude="-300 ft",proficiency=3})
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Carrier Strike Group
I haven't tried it myself.
But would this work ...
1. Add the units in a bunch.
2. Then set the formation detail of each unit in the group giving the distance/bearing of the units from the group lead with the flag to jump to the location.
But would this work ...
1. Add the units in a bunch.
2. Then set the formation detail of each unit in the group giving the distance/bearing of the units from the group lead with the flag to jump to the location.
Michael
Re: Carrier Strike Group
Found a solution after many trial and error:michaelm75au wrote: ↑Tue Mar 21, 2023 5:57 pm I haven't tried it myself.
But would this work ...
1. Add the units in a bunch.
2. Then set the formation detail of each unit in the group giving the distance/bearing of the units from the group lead with the flag to jump to the location.
--CVN 77 GEORGE BUSH - (mothership)
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4})
--ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush)
local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='USA', heading =0, speed=0, altitude=0, proficiency=4, latitude=90.0000, longitude=135.0000})
local point = ScenEdit_AddReferencePoint({side='USA',name='Unit Placeholder2',RelativeTo='George Bush', bearing=315, distance=7})
ScenEdit_DeleteReferencePoint({name='Unit Placeholder2', side='USA'})
u.latitude = point.latitude
u.longitude = point.longitude
for x = 1, 2, 1 do
local name = 'Knighthawk 21-'..math.random(100,999)
local proficiency = math.random(2,3)+1
ScenEdit_AddUnit({type='Aircraft', side='USA', name=name, dbid =5337, loadoutid =13430, base='Bainbridge', AddUnit='DDG'})
end
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Carrier Strike Group
Here is the use of the formation method I was referring to.
Note that the 'transpose' option is not in the latest build - it was missing. Currently it would place the formation marker but the ship would move there. Once the 'transpose' option is in place, it will teleport to the location.
Note that the 'transpose' option is not in the latest build - it was missing. Currently it would place the formation marker but the ship would move there. Once the 'transpose' option is in place, it will teleport to the location.
Code: Select all
--CVN 77 GEORGE BUSH - (mothership)
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='blue', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4, group = "CVN TG"})
--ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush)
local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='blue', heading =0, speed=0, altitude=0, proficiency=4, Latitude='N69.00.00',Longitude='E10.00.00', group = "CVN TG"})
u.formation = {type='rotating', bearing=315, distance=7, transpose=true} -- station = relative bearing 315 deg at 7 NM from lead
Michael
Re: Carrier Strike Group
Naah i see that you use lat and lon for bainbridge, that is what i trying to avoid. I want a code so i just need to change the carriers coordinates and all the ships will move to location relativeTo the carrier.michaelm75au wrote: ↑Sat Mar 25, 2023 12:55 am Here is the use of the formation method I was referring to.
Note that the 'transpose' option is not in the latest build - it was missing. Currently it would place the formation marker but the ship would move there. Once the 'transpose' option is in place, it will teleport to the location.
Code: Select all
--CVN 77 GEORGE BUSH - (mothership) ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='blue', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4, group = "CVN TG"}) --ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush) local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='blue', heading =0, speed=0, altitude=0, proficiency=4, Latitude='N69.00.00',Longitude='E10.00.00', group = "CVN TG"}) u.formation = {type='rotating', bearing=315, distance=7, transpose=true} -- station = relative bearing 315 deg at 7 NM from lead
Re: Carrier Strike Group
Use the carrier latitude,longitude with the method GetPointFromBearing to get the latitude/longitude of the other ships
Re: Carrier Strike Group
I did with this code, don't know how clean it is but it works:))blu3s wrote: ↑Sat Mar 25, 2023 9:31 am
Use the carrier latitude,longitude with the method GetPointFromBearing to get the latitude/longitude of the other ships
--CVN 77 GEORGE BUSH - (mothership)
ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4})
--ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush)
local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='USA', heading =0, speed=0, altitude=0, proficiency=4, latitude=90.0000, longitude=135.0000})
local point = ScenEdit_AddReferencePoint({side='USA',name='Unit Placeholder2',RelativeTo='George Bush', bearing=315, distance=7})
ScenEdit_DeleteReferencePoint({name='Unit Placeholder2', side='USA'})
u.latitude = point.latitude
u.longitude = point.longitude
for x = 1, 2, 1 do
local name = 'Knighthawk 21-'..math.random(100,999)
local proficiency = math.random(2,3)+1
ScenEdit_AddUnit({type='Aircraft', side='USA', name=name, dbid =5337, loadoutid =13430, base='Bainbridge', AddUnit='DDG'})
end
Top
Re: Carrier Strike Group
You don't need to create a RP. You store your carrier in a variable an with GetPointFromBearing you can get the ddg position with your cv position, bearing and distance as desired. Hope it helpsZyph wrote: ↑Sat Mar 25, 2023 12:38 pm I did with this code, don't know how clean it is but it works:))
--CVN 77 GEORGE BUSH - (mothership)
local cv = ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4})
--ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush)
local ddg_pos = World_GetPointFromBearing( { latitude = cv.latitude, longitude = cv.longitude,
distance = 7, bearing = 315} )
local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='USA', speed=0, proficiency=4, latitude=ddg_pos.latitude, longitude=ddg_pos.longitude})
...
Re: Carrier Strike Group
Very nice! Thank you, have a nice evening!blu3s wrote: ↑Sat Mar 25, 2023 2:43 pmYou don't need to create a RP. You store your carrier in a variable an with GetPointFromBearing you can get the ddg position with your cv position, bearing and distance as desired. Hope it helpsZyph wrote: ↑Sat Mar 25, 2023 12:38 pm I did with this code, don't know how clean it is but it works:))
--CVN 77 GEORGE BUSH - (mothership)
local cv = ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='USA', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4})
--ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush)
local ddg_pos = World_GetPointFromBearing( { latitude = cv.latitude, longitude = cv.longitude,
distance = 7, bearing = 315} )
local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='USA', speed=0, proficiency=4, latitude=ddg_pos.latitude, longitude=ddg_pos.longitude})
...
- michaelm75au
- Posts: 12457
- Joined: Sat May 05, 2001 8:00 am
- Location: Melbourne, Australia
Re: Carrier Strike Group
In order to add a ship, you need to give it a location. I gave it the same location as the CVN, and then set the formation information for each ship. This would then reposition the ship.michaelm75au wrote: ↑Sat Mar 25, 2023 12:55 am Here is the use of the formation method I was referring to.
Note that the 'transpose' option is not in the latest build - it was missing. Currently it would place the formation marker but the ship would move there. Once the 'transpose' option is in place, it will teleport to the location.
Code: Select all
--CVN 77 GEORGE BUSH - (mothership) ScenEdit_AddUnit({type='Ship', name='George Bush', heading =0, dbid =3225, side ='blue', Latitude='N69.00.00',Longitude='E10.00.00', altitude='0 ft', speed=20,proficiency=4, group = "CVN TG"}) --ADD DDG 96 BAINBRIDGE AND 2 x Lynx (one of the 8 ship around George Bush) local u = ScenEdit_AddUnit({type='Ship', name='Bainbridge', heading =0, speed=20, dbid =2873, side ='blue', heading =0, speed=0, altitude=0, proficiency=4, Latitude='N69.00.00',Longitude='E10.00.00', group = "CVN TG"}) u.formation = {type='rotating', bearing=315, distance=7, transpose=true} -- station = relative bearing 315 deg at 7 NM from lead
Michael