Wrapper Contact
Retreiving the Contact details
Wrapper Doctrine
Retreiving the mission doctrine object
local d = ScenEdit_GetDoctrine( { side='united states', mission='AEW East' } )
print(d)
local d = ScenEdit_GetDoctrine({side='united states',mission='AEW East',actual='yes'})
print(d)
Wrapper DoctrineWRA
Retreiving a Doctrine WRA
There is a WRA_??? item for each weapon system in the LEVEL selected, in this case a unit, and for the type of target selected ( 2000 = 'Aircraft_Unspecified').
It can be filtered by using the weapon DBID in which case the WEAPON_DBID and WEAPON_NAME (from WRA) will be shown on the parent side with LEVEL and TARGET_TYPE.
local a = local a = ScenEdit_GetDoctrineWRA({guid='a1a52edf-3541-4b55-bea4-58d4e1ab11dc',target_type=2000})
print(a)
Wrapper Event
1. Showing the full attributes of the event
local a = ScenEdit_GetEvent( "Aircraft entering ship's exclusion zone" )
for k,v in pairs(a.fields) do
if string.find(k,'property_') ~= nil then -- is a property
local vt = {}
local i = 0
for w in string.gmatch(v,'%g+[^, ]') do
vt[i] = w
i=i+1
end
print("\r\n[object] = " .. string.sub(vt[0],2) ) -- property name
if vt[3] == 'True' then
print( a[ string.sub(vt[0],2) ] ) -- value of property
else
print( 'no get function' ) -- value of property
end
end
end
2. Retreiving some details from the Event
local f = ScenEdit_EventX() -- the event that has triggered
print("EventID: " .. string.format('%s (\'%s\')',f.description, f.guid))
print("Active: " .. string.format('%s',f.isActive))
print("Shown: " .. string.format('%s',f.isShown))
print("Repeats: " .. string.format('%s',f.isRepeatable))
print("Trigger(s):")
print(f.triggers)
print("Conditions(s):")
print(f.conditions)
print("Action(s):")
print(f.actions)
EventID: Turkish FFG destroyed ('cf4eb993-25bd-4626-a944-b2b3cf6ae3b6')
Active: true
Shown: False
Repeats: True
Trigger(s)
{ [1] = { UnitDestroyed = { TargetFilter = { TargetType = '2', TargetSubType = '3303', ID = '88b4407d-f90f-4161-abea-357a69a66f13', TargetSide = '257e0c83-c955-4ab8-841b-49a46544b54f' }, ID = '4e5f16f3-8e65-40fe-b7e0-f95e99910eb1', Description = 'Turkish FFG destroyed' } } }
Conditions(s)
{ }
Action(s)
{ [1] = { Points = { Description = 'United States plus 01000 points', SideID = '2b7905cd-e798-494b-95fb-a01f5d9f4eec', ID = 'b1a3e26e-5c88-48a5-a866-88a7f7d737df', PointChange = '1000' }, type = 'Points' } }
The active event has one trigger (UnitDestroyed) and one action (update points).
Wrapper Group
Retreiving the Group details
local u = ScenEdit_GetUnit({name='CVN BG', guid='9506a165-6e44-40dd-b721-f9c07e056bdb'})
print("Group [" .. u.group.name .. "] \r\n" .. " Lead ship is " .. ScenEdit_GetUnit({ guid= u.group.lead}).name)
-- group contains units
local s = "Group units:" .. "\r\n"
for k,v in pairs(u.group.unitlist) do
if v ~= u.group.lead then
s = s .. k .. " - " .. ScenEdit_GetUnit({ guid= v}).name .. "\r\n"
end
end
print(s)
Group [CVN BG]
Lead ship is CVN 70 Carl Vinson [Nimitz Class]
Group units:
1 - USS Rentz
2 - USS McClusky
3 - USS Stockdale
4 - USS Gridley
5 - USS Higgins
6 - USS Lake Champlain
7 - USS Bunker Hill
Wrapper LoadOut
Retreiving the Group details
local u = ScenEdit_GetLoadout({name='MiG-31BM Foxhound', unitname='NZZYVJ-0HM0G1F7MPTLQ'}
print("Loadout [" .. u.name .. "] \r\n" )
--print(u.weapons)
local s = "Weapon load:" .. "\r\n"
for k,v in pairs(u.weapons) do
print( v)
s = s .. k .. " - " .. v.wpn_name
s = s .. "\t(Carrying " .. v.wpn_current .. " of " .. v.wpn_maxcap .. ")\r\n"
u:setExactWeaponQuantity(v.wpn_guid, v.wpn_maxcap) -- set the current load back to full if any have been expended
end
print(s)
Loadout [AA-13 Arrow [R-37M], AA-12 Adder B [R-77-1], Long-Range]
Weapon load:
1 - AA-12 Adder B [R-77-1, RVV-SD] (Carrying 2 of 2)
2 - AA-13 Arrow [R-37M, RVV-BD] (Carrying 4 of 4)
3 - 2500 liter Drop Tank (Carrying 2 of 2)
Wrapper Magazine
Retreiving the Magazine details
local u = ScenEdit_GetUnit({name='LST 4001 Osumi', guid='8269b881-20ce-4f2e-baa0-6823e46d55a4'})
print( "Unit Magazines " .. "\r\n")
for k,v in pairs(u.magazines) do
local s = ''
local m = u:getUnitMagazine(v.mag_guid) -- details on magazine
s = s .. k .. " - " .. m.name .. "with capacity of " .. m.capacity .. ' units\r\n'
s = s .. "\t[Armor rating = " .. m.armor .. ", ROF = " .. m.rof .. ", containing " .. #m.weapons .. " weapon(s)]\r\n"
for k,v in pairs(m.weapons) do
s = s .. "\t\t" .. v.wpn_name .. " with load " .. v.wpn_current .. " of " .. v.wpn_default .. '\r\n'
m:setExactWeaponQuantity(v.wpn_guid, v.wpn_default) -- set the current load back to full if any have been expended
end
print(s)
end
Unit Magazines
1 - 12.7mm/50 MGwith capacity of 200 units
[Armor rating = 1001, ROF = 15, containing 1 weapon(s)]
12.7mm/50 MG Burst [10 rnds] with load 180 of 200
2 - 20mm/85 Mk15 Phalanx Blk 1with capacity of 20 units
[Armor rating = 2001, ROF = 300, containing 1 weapon(s)]
20mm/85 Mk15 Phalanx Blk 1 Burst [300 rnds] with load 20 of 20
3 - Helicopter Magazinewith capacity of 10000 units
[Armor rating = 1001, ROF = 60, containing 2 weapon(s)]
AGM-114M Hellfire II with load 24 of 24
Mk46 NEARTIP Mod 5 with load 40 of 40
4 - Mk36 SRBOCwith capacity of 80 units
[Armor rating = 1001, ROF = 300, containing 2 weapon(s)]
Mk182 SRBOC Chaff [Seduction] with load 2 of 64
Mk186 TORCH Flare [Seduction] with load 2 of 16
Wrapper Mission
Retreiving the Mission details
Wrapper Mount
Retreiving the Mount details
local u = ScenEdit_GetUnit({name='LST 4001 Osumi', guid='8269b881-20ce-4f2e-baa0-6823e46d55a4'})
print( "Unit Mounts " )
for k,v in pairs(u.mounts) do
local s = ''
local m = u:getUnitMount(v.mount_guid) -- details on mount
s = s .. k .. " - " .. m.name .. " [ " .. v.mount_status .. ' ]\r\n'
s = s .. "\t[ containing " .. #m.weapons .. " weapon(s) ]\r\n"
for k,v in pairs(m.weapons) do
s = s .. "\t\t" .. v.wpn_name .. " with load " .. v.wpn_current .. " of " .. v.wpn_default .. '\r\n'
--m:setExactWeaponQuantity(v.wpn_guid, v.wpn_default) -- set the current load back to full if any have been expended
end
print(s)
end
Unit Mounts
1 - 12.7mm/50 MG [ Operational ]
[ containing 1 weapon(s) ]
12.7mm/50 MG Burst [10 rnds] with load 10 of 10
2 - 12.7mm/50 MG [ Operational ]
[ containing 1 weapon(s) ]
12.7mm/50 MG Burst [10 rnds] with load 10 of 10
3 - 20mm/85 Mk15 Phalanx Blk 1 CIWS [ Operational ]
[ containing 1 weapon(s) ]
20mm/85 Mk15 Phalanx Blk 1 Burst [300 rnds] with load 5 of 5
4 - 20mm/85 Mk15 Phalanx Blk 1 CIWS [ Operational ]
[ containing 1 weapon(s) ]
20mm/85 Mk15 Phalanx Blk 1 Burst [300 rnds] with load 5 of 5
5 - Mk36 SRBOC [ Operational ]
[ containing 2 weapon(s) ]
Mk182 SRBOC Chaff [Seduction] with load 4 of 4
Mk186 TORCH Flare [Seduction] with load 2 of 2
6 - Mk36 SRBOC [ Operational ]
[ containing 2 weapon(s) ]
Mk182 SRBOC Chaff [Seduction] with load 4 of 4
Mk186 TORCH Flare [Seduction] with load 2 of 2
7 - Mk36 SRBOC [ Operational ]
[ containing 2 weapon(s) ]
Mk182 SRBOC Chaff [Seduction] with load 4 of 4
Mk186 TORCH Flare [Seduction] with load 2 of 2
8 - Mk36 SRBOC [ Operational ]
[ containing 2 weapon(s) ]
Mk182 SRBOC Chaff [Seduction] with load 4 of 4
Mk186 TORCH Flare [Seduction] with load 2 of 2
Wrapper Reference Point
Retreiving the RP details
Wrapper Scenario
Retreiving the Scenario details
Wrapper Side
Retreiving the Side details
Find units in an area
local u = side:unitsInArea({Area = { 'RP-3137', 'RP-3139', 'RP-3136', 'RP-3138'},
TargetFilter = { TargetType = 'Ship' } })
Find units on side by a filter
local u = side:side:unitsBy('Ship') -- all ships
u = side:unitsBy('Ship', 2002, 3003) -- ships fitered for 'Surface combatant' and 'BBC'
Wrapper Special Action
Retreiving the SA details
Wrapper Unit
Retreiving the Unit details
Update the orbit for a satellite by specifying a TLE
theSat = ScenEdit_GetUnit({guid='56f830c1-d0e2-430a-985e-0e301cc01eff'})
theTLE = 'Resurs P1\n1 39186U 13030A 17013.12537468 .00000446 00000-0 16942-4 0 9992\n2 39186 97.3847 79.3911 0015157 247.7411 195.8488 15.31966970198820'
theSat:updateorbit({TLE=theTLE})
Change the type of waypoint
au = ScenEdit_GetUnit({name='AGM-158A JASSM [Penetrator] #967', guid='46skox-0hmf72m6q6bdj'})
print(au.course)
wp = au:getwaypoint({GUID='46SKOX-0HMF72M6Q6L64'})
wp.type = 0 -- This changes the waypoint type, in this case to manual plotted-course waypoint
print(wp.type)
Change group's formation - reposition individual units - via teleport (transpose = true)
1. to 'line abreast' (one of the pre-defined formations)
local a = ScenEdit_GetUnit( { guid='9506a165-6e44-40dd-b721-f9c07e056bdb' } )
a.formation = {name='line', spacing_unit = 1, transpose='true'}
2. to a customised formation
local a = ScenEdit_GetUnit( { guid='9506a165-6e44-40dd-b721-f9c07e056bdb' } )
a.formation = {name='Custom:\t0\t2\t1\t135\t1\t1\t225\t1', spacing_unit = 1, transpose='true'}
Change unit's location in group's formation
local a = ScenEdit_GetUnit( { guid='9506a165-6e44-40dd-b721-f9c07e056bdb' } )
a.formation = {type='fixed', sprint=false, bearing=45, distance=5}
Retrieve the noise level of ship (as appears on map)
local u = ScenEdit_GetUnit({name='SS 583 Harushio', guid='3a5f2a57-36e2-48f6-9352-00b819789a18'})
--print(u.noiseLevel)
print '----Noise Level----------'
print("Front: " .. tostring(u.noiseLevel.front))
print("Side: " .. tostring(u.noiseLevel.side))
print("Rear: " .. tostring(u.noiseLevel.rear))
----Noise Level----------
Front: 19.0
Side: 19.2
Rear: 19.4
Retrieve the signature profile of aircraft with loadout
local u = ScenEdit_GetUnit({name='MiG-31BM Foxhound', guid='NZZYVJ-0HM0G1F7MPTLQ'})
print(u.signature)
local sigs = u.signature
if sigs.loadout ~= nil then
print("A/c Loadout id = " .. sigs.loadout)
end
print '----Signatures----------'
for k,v in pairs(sigs) do
if k ~= 'loadout' then
print("Type: " .. tostring(v.type) .. " / " .. v.typeN) -- type of device related to signature. Both text and number are supplied
-- the text string similar to DB viewer
print("Front: " .. tostring(v.text.front))
print("Side: " .. tostring(v.text.side))
print("Rear: " .. tostring(v.text.rear))
--print(v.text)
-- the RCS values
print("RCS: " )
print("Front: " .. tostring(v.rcs.front))
print("Side: " .. tostring(v.rcs.side))
print("Rear: " .. tostring(v.rcs.rear))
--print(v.rcs)
if v.sqm ~= nil then
-- the square metre values
print("SQM: " )
print("Front: " .. tostring(v.sqm.front))
print("Side: " .. tostring(v.sqm.side))
print("Rear: " .. tostring(v.sqm.rear))
--print(v.rcs)
end
print '---------------'
end
end
{ [2] = { text = { rear = '3.56 nm', front = '3.56 nm', side = '7.94 nm' }, rcs = { rear = 3.56, front = 3.56, side = 7.94 }, typeN = 3001, type = 'Visual_Detect' }, [3] = { text = { rear = '3.26 nm', front = '1.90 nm', side = '4.30 nm' }, rcs = { rear = 3.26, front = 1.9, side = 4.3 }, typeN = 3002, type = 'Visual_ID' }, [4] = { text = { rear = '11.94 nm', front = '3.56 nm', side = '8.00 nm' }, rcs = { rear = 11.9425, front = 3.56, side = 7.9985 }, typeN = 4001, type = 'IR_Detect' }, [5] = { text = { rear = '1.90 nm', front = '1.90 nm', side = '4.30 nm' }, rcs = { rear = 1.9, front = 1.9, side = 4.3 }, typeN = 4002, type = 'IR_ID' }, [6] = { text = { rear = '9.04 dBsm, 8.0 sq.m.', front = '9.04 dBsm, 8.0 sq.m.', side = '11.15 dBsm, 13.0 sq.m.' }, typeN = 5001, rcs = { rear = 9.03988, front = 9.03988, side = 11.14721 }, sqm = { rear = 8.016566, front = 8.016566, side = 13.023313 }, type = 'Radar_A_D' }, [7] = { text = { rear = '9.04 dBsm, 8.0 sq.m.', front = '9.04 dBsm, 8.0 sq.m.', side = '11.15 dBsm, 13.0 sq.m.' }, typeN = 5002, rcs = { rear = 9.03988, front = 9.03988, side = 11.14721 }, sqm = { rear = 8.016566, front = 8.016566, side = 13.023313 }, type = 'Radar_E_M' }, loadout = 19867 }
A/c Loadout id = 19867
----Signatures----------
Type: Visual_Detect / 3001
Front: 3.56 nm
Side: 7.94 nm
Rear: 3.56 nm
RCS:
Front: 3.56
Side: 7.94
Rear: 3.56
---------------
Type: Visual_ID / 3002
Front: 1.90 nm
Side: 4.30 nm
Rear: 3.26 nm
RCS:
Front: 1.9
Side: 4.3
Rear: 3.26
---------------
Type: IR_Detect / 4001
Front: 3.56 nm
Side: 8.00 nm
Rear: 11.94 nm
RCS:
Front: 3.56
Side: 7.9985
Rear: 11.9425
---------------
Type: IR_ID / 4002
Front: 1.90 nm
Side: 4.30 nm
Rear: 1.90 nm
RCS:
Front: 1.9
Side: 4.3
Rear: 1.9
---------------
Type: Radar_A_D / 5001
Front: 9.04 dBsm, 8.0 sq.m.
Side: 11.15 dBsm, 13.0 sq.m.
Rear: 9.04 dBsm, 8.0 sq.m.
RCS:
Front: 9.03988
Side: 11.14721
Rear: 9.03988
SQM:
Front: 8.016566
Side: 13.023313
Rear: 8.016566
---------------
Type: Radar_E_M / 5002
Front: 9.04 dBsm, 8.0 sq.m.
Side: 11.15 dBsm, 13.0 sq.m.
Rear: 9.04 dBsm, 8.0 sq.m.
RCS:
Front: 9.03988
Side: 11.14721
Rear: 9.03988
SQM:
Front: 8.016566
Side: 13.023313
Rear: 8.016566
---------------
Wrapper Zone (non-navigation and exclusion)
Retreiving the Zone details
local a = VP_GetSide({Side ='side1'})
-- a side object
local z = a.nonavzones
--List Of no-nav zones For the side If you need To find it
For i, zone in ipairs(z) do
print("Zone #" .. i)
print(zone)
local n = a : getnonavzone(z[i].guid) -- zone object
print('Details: ' .. n.description .. ' Active: ' .. tostring(n.isactive) )
n.area = {'rp-9','rp-10', 'rp-8' -- replace with a list of visible RPs for the side
n.area = {
name='area test rp0', latitude='35.5480335331354', longitude='15.8184476823186', highlighted=true, bearingtype=1, relativeto='Tracking #1', hidden = false,
name='area test rp1', latitude='35.5480335331354', longitude='16.8184476823186', highlighted=true,,
name='area test rp2', latitude='38.5480335331354', longitude='18.8184476823186', highlighted=false, -- replace with a new set of RPs that might not be visible to the side
End
Wrapper WayPoint
Retreiving the WP details
Wrapper Weapon
Retreiving the Weapon details