Moved Core.Menu to MOOSE_Demos

This commit is contained in:
kaltokri
2024-05-18 17:06:17 +02:00
parent e8712b8caa
commit 5f1cc25e9c
27 changed files with 0 additions and 371199 deletions

Binary file not shown.

View File

@@ -1,146 +0,0 @@
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
--local AllZones=SET_ZONE:New():FilterOnce()--]]
local Target_1 = ZONE:New("Bridge32")
local T1COORD = Target_1:GetCoordinate()
local T1Height = T1COORD:GetLandHeight()
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T1Height)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
TopMenu1 = MENU_MISSION:New( "TARGETCOORDS" )
BridgeMenu = MENU_MISSION:New( "BRIDGE",TopMenu1 )
AmmoMenu = MENU_MISSION:New( "AMMO DUMP",TopMenu1 )
ShelterMenu = MENU_MISSION:New( "HARDENED SHELTER",TopMenu1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",BridgeMenu, TARGET1)
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", BridgeMenu, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", ShelterMenu, TARGET3)
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", ShelterMenu, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", AmmoMenu, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", AmmoMenu, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", AmmoMenu, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", AmmoMenu, TARGET8)

View File

@@ -1,150 +0,0 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@@ -1,150 +0,0 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@@ -1,146 +0,0 @@
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
--local AllZones=SET_ZONE:New():FilterOnce()--]]
local Target_1 = ZONE:New("Bridge32")
local T1COORD = Target_1:GetCoordinate()
local T1Height = T1COORD:GetLandHeight()
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T1Height)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
TopMenu1 = MENU_MISSION:New( "TARGETCOORDS" )
BridgeMenu = MENU_MISSION:New( "BRIDGE",TopMenu1 )
AmmoMenu = MENU_MISSION:New( "AMMO DUMP",TopMenu1 )
ShelterMenu = MENU_MISSION:New( "HARDENED SHELTER",TopMenu1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",BridgeMenu, TARGET1)
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", BridgeMenu, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", ShelterMenu, TARGET3)
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", ShelterMenu, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", AmmoMenu, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", AmmoMenu, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", AmmoMenu, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", AmmoMenu, TARGET8)

View File

@@ -1,150 +0,0 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@@ -1,152 +0,0 @@
-- This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Mission created by Saint185
-- 2020-11-21
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@@ -1,154 +0,0 @@
--This code pulls the Coordinates for JDAM use, and using the Menu format loads them in game using message system.
-- Creator Saint185
-- Shows how to use Menu system to show messages by F10 Radio Menu
-- Preparde for github by Wingthor
-- Date 2012-12-15
-- Add module of your choise to scenarion to play.
_SETTINGS:SetPlayerMenuOff()
local AmmoDumpEast = STATIC:FindByName("EastAmmoDump")--Finds the static called EastAmmoDump from the Mission Editor
local AmmoDumpEastCOORD = AmmoDumpEast:GetCoordinate()--contains the LLDMS coordinates for JDAM
local AmmoDumpEastHeight = AmmoDumpEastCOORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local AmmoDumpWest = STATIC:FindByName("WestAmmoDump")
local AmmoDumpWestCOORD = AmmoDumpWest:GetCoordinate()
local AmmoDumpWestHeight = AmmoDumpWestCOORD:GetLandHeight()
local AmmoDumpSouth = STATIC:FindByName("SouthAmmoDump")
local AmmoDumpSouthCOORD = AmmoDumpSouth:GetCoordinate()
local AmmoDumpSouthHeight = AmmoDumpSouthCOORD:GetLandHeight()
local AmmoDumpNorth = STATIC:FindByName("NorthAmmoDump")
local AmmoDumpNorthCOORD = AmmoDumpNorth:GetCoordinate()
local AmmoDumpNorthHeight = AmmoDumpNorthCOORD:GetLandHeight()
local Target_1 = ZONE:New("Bridge32")--Zone assigned to Bridge 32 in ME
local T1COORD = Target_1:GetCoordinate()--contains the LLDMS coordinates for JDAM
local T1Height = T1COORD:GetLandHeight()--gets the land height Bridge 32 from T1COORD
local Target_2 = ZONE:New("Bridge33")
local T2COORD = Target_2:GetCoordinate()
local T2Height = T2COORD:GetLandHeight()
local Target_3 = ZONE:New("HardenedHanger33")
local T3COORD = Target_3:GetCoordinate()
local T3Height = T3COORD:GetLandHeight()
local Target_4 = ZONE:New("HardenedHanger34")
local T4COORD = Target_4:GetCoordinate()
local T4Height = T4COORD:GetLandHeight()
-- Gets LLDMS coord from Target 1(Bridge32p) using T1COORD:ToStringLLDMS() then assigns sections of the string to coordXy
local function TARGET1(T1LLDMS)
local T1LLDMS = T1COORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)--extracts a block of text from String T4LLDMS starting at location 9 ending at location 10
local coordN2 = string.sub(T1LLDMS,13,20)--extracts a block of text from String T4LLDMS starting at location 13 ending at location 20
local coordE1 = string.sub(T1LLDMS,26,27)--extracts a block of text from String T4LLDMS starting at location 26 ending at location 27
local coordE2 = string.sub(T1LLDMS,30,37)--extracts a block of text from String T4LLDMS starting at location 30 ending at location 37
local Heightft = UTILS.MetersToFeet(T1Height)--coverts height in meters to feet
local T1Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("Bridge 32".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS--returns the argument for function TARGET1
end
local function TARGET2(T2LLDMS)
local T2LLDMS = T2COORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T2Height)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("Bridge 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET3(T3LLDMS)
local T3LLDMS = T3COORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T3Height)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 33".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET4(T4LLDMS)
local T4LLDMS = T4COORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)
local coordN2 = string.sub(T4LLDMS,13,20)
local coordE1 = string.sub(T4LLDMS,26,27)
local coordE2 = string.sub(T4LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(T4Height)
local T4Heightft = UTILS.Round(Heightft)
MESSAGE:New("HardenedHanger 34".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
local function TARGET5(T1LLDMS)
local T1LLDMS = AmmoDumpEastCOORD:ToStringLLDMS()
local coordN1 = string.sub(T1LLDMS,9,10)
local coordN2 = string.sub(T1LLDMS,13,20)
local coordE1 = string.sub(T1LLDMS,26,27)
local coordE2 = string.sub(T1LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpEastHeight)
local T1Heightft = UTILS.Round(Heightft)
MESSAGE:New("EastAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T1Heightft.." ft"), 50):ToAll()
return T1LLDMS
end
local function TARGET6(T2LLDMS)
local T2LLDMS = AmmoDumpWestCOORD:ToStringLLDMS()
local coordN1 = string.sub(T2LLDMS,9,10)
local coordN2 = string.sub(T2LLDMS,13,20)
local coordE1 = string.sub(T2LLDMS,26,27)
local coordE2 = string.sub(T2LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpWestHeight)
local T2Heightft = UTILS.Round(Heightft)
MESSAGE:New("WestAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T2Heightft.." ft"), 50):ToAll()
return T2LLDMS
end
local function TARGET7(T3LLDMS)
local T3LLDMS = AmmoDumpSouthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T3LLDMS,9,10)
local coordN2 = string.sub(T3LLDMS,13,20)
local coordE1 = string.sub(T3LLDMS,26,27)
local coordE2 = string.sub(T3LLDMS,30,37)
local Heightft = UTILS.MetersToFeet(AmmoDumpSouthHeight)
local T3Heightft = UTILS.Round(Heightft)
MESSAGE:New("SouthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T3Heightft.." ft"), 50):ToAll()
return T3LLDMS
end
local function TARGET8(T4LLDMS)
local T4LLDMS = AmmoDumpNorthCOORD:ToStringLLDMS()
local coordN1 = string.sub(T4LLDMS,9,10)--extracts text from String T4LLDMS at location 9 to 10
local coordN2 = string.sub(T4LLDMS,13,20)--extracts text from String T4LLDMS at location 13 to 20
local coordE1 = string.sub(T4LLDMS,26,27)--extracts text from String T4LLDMS at location 26 to 27
local coordE2 = string.sub(T4LLDMS,30,37)--extracts text from String T4LLDMS at location 30 to 37
local Heightft = UTILS.MetersToFeet(AmmoDumpNorthHeight)--coverts height in meters to feet
local T4Heightft = UTILS.Round(Heightft)-- rounds the value to a whole number
MESSAGE:New("NorthAmmoDump".."\n".. ("N"..coordN1.."'"..coordN2.."\n".."E"..coordE1.."'"..coordE2.."\n".."ALT "..T4Heightft.." ft"), 50):ToAll()
return T4LLDMS
end
--Coordinates Menu
Level1 = MENU_MISSION:New( "TARGETCOORDS" )--Top level Menu all targets are assigned to this master menu
Level2_1 = MENU_MISSION:New( "BRIDGE",Level1 )--Level 2 Contains Target groups
Level2_2 = MENU_MISSION:New( "AMMO DUMP",Level1 )
Level2_3 = MENU_MISSION:New( "HARDENED SHELTER",Level1 )
Menu1 = MENU_MISSION_COMMAND:New("Bridge 32",Level2_1, TARGET1)--Level 3 contains Target group coordinates
Menu2 = MENU_MISSION_COMMAND:New("Bridge 33", Level2_1, TARGET2)
Menu3 = MENU_MISSION_COMMAND:New("HardenedHanger 33", Level2_3, TARGET3)--text displayed HardenedHanger 33, select Menu position, function to call(local function TARGET3(T3LLDMS))
Menu4 = MENU_MISSION_COMMAND:New("HardenedHanger 34", Level2_3, TARGET4)
Menu5 = MENU_MISSION_COMMAND:New("AmmoDumpEast", Level2_2, TARGET5)
Menu6 = MENU_MISSION_COMMAND:New("AmmoDumpWest", Level2_2, TARGET6)
Menu7 = MENU_MISSION_COMMAND:New("AmmoDumpSouth", Level2_2, TARGET7)
Menu8 = MENU_MISSION_COMMAND:New("AmmoDumpNorth", Level2_2, TARGET8)

View File

@@ -1,95 +0,0 @@
--- MEN-003-MENU_MISSION_COMMAND
-- Name: MEN-003-MENU_MISSION_COMMAND.lua
-- Author: Wingthor and Saint185
-- Date Created: 15 January 2021
--
-- # Situation:
-- A squad with SU15T. After a few seconds a menu with call to check Wingmens current Ordnance.
-- Check code for how to create a dynamic menu with a for iteration and table.
-- Check code for forward declaration of a function.
-- This logic is Universal, it will work with any human flyable plane RED or BLUE just name your GROUP "Player". Under the Skill box select "client" as your plane
BASE:TraceOnOff(true)
BASE:TraceAll(true)
-- GLOBALS For easy mission tweaking
env.info ("------------------------- STARING SCRIPT ---------------------------------")
CASZone = "Zone Charlie"
PlayersGroupName = "Player"
BuildMenu = function() end -- Forward declaration
------------------------------------END GLOBALS-------------------------------------------------------------
--Create TASK Zone
local zoneCharlie=ZONE:New(CASZone)
-- Add scheduled command, now holds the BuildMenu Call
local start = SCHEDULER:New(nil,function()
-- Create a flight group.
flightgroup = FLIGHTGROUP:New(PlayersGroupName)
flightgroup:SetDetection(true)
--- Function called when the group detectes a previously unkwown unit.
function flightgroup:OnAfterDetectedUnitNew(From, Event, To, Unit)
local unit=Unit --Wrapper.Unit#UNIT
-- Message to everybody and in the DCS log file.
local text=string.format("Detected unit %s", unit:GetName())
MESSAGE:New(text, 20,flightgroup:GetName()):ToAll()
env.info(text)
end
-- Create a CAS mission.
local mission=AUFTRAG:NewCAS(zoneCharlie)
mission:SetEngageAltitude(10000)
mission:SetWeaponExpend(AI.Task.WeaponExpend.ONE)
-- Assign mission to pilot.
flightgroup:AddMission(mission)
-- Build Menu for Ammo Check
BuildMenu()
end,
{},1,30000 )
---function to check ammo for a give wingman
---@param Wingman number
local function AmmoCheck(Wingman)--function for wingman 2
local unitsAmmoTable = units[Wingman]:GetAmmo()--gets the ammo for each unit and dumps it into unittable TABLE
local callsign = units[Wingman]:GetCallsign()--gets the callsign for each unit and dumps it into callsign TABLE
--this logic splits out each ammo type and name and inserts it into the Message
local count = {}
local desc = {}
-- local ammoUnits = ammo[2]
local WepMessage = " "
for i = 1, #unitsAmmoTable do
local ammocount = unitsAmmoTable[i].count
local ammodesc = unitsAmmoTable[i].desc.displayName
table.insert (count,ammocount)
table.insert (desc,ammodesc)
WepMessage = WepMessage .. desc[i] .. ": " .. count[i] .. "\n "
end
MESSAGE:New( callsign ..":\n------------------------------------\n" .. WepMessage, 10):ToAll()
end
local function CheckAll()
units = GROUP:FindByName( PlayersGroupName ):GetUnits() --gets the number of units in the group
for i = 2, #units do
AmmoCheck(i)
end
end
BuildMenu = function()
BASE:E("--- Info: Building menu ---")
units = GROUP:FindByName( PlayersGroupName ):GetUnits() --gets the number of units in the group
--AmmoCheckMainMenu
Level1 = MENU_MISSION:New( "Flight Ammo Check" )
LevelMenues = {}
CommandMenues = {}
for i = 2, #units do
LevelMenues[i] = MENU_MISSION:New( "Wingman " .. i ,Level1 )
CommandMenues[i] = MENU_MISSION_COMMAND:New("AmmoStatus " .. i, LevelMenues[i], AmmoCheck,i)
end
CommandMenuesAll = MENU_MISSION_COMMAND:New("AmmoStatus All", Level1, CheckAll)
end
-- BASE:ScheduleOnce(10,BuildMenu) If you prefer a scheduled command
HandleDeath = EVENTHANDLER:New():HandleEvent(EVENTS.Dead)
function HandleDeath:OnEventDead(EventData)
if EventData.IniGroupName == PlayersGroupName then
BuildMenu()
end
end

View File

@@ -1,43 +0,0 @@
do
-- This demo creates a menu structure for the planes within the red coalition.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
local Plane1 = GROUP:FindByName( "Red Plane 1" )
local Plane2 = GROUP:FindByName( "Red Plane 2" )
local Plane3 = GROUP:FindByName( "Red Plane 3" )
local Plane4 = GROUP:FindByName( "Red Plane 4" )
-- This would create a menu for the red coalition under the main DCS "Others" menu.
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
local function ShowStatus( StatusText, Coalition )
Plane1:MessageToRed( StatusText, 15 )
Plane2:MessageToRed( StatusText, 15 )
end
local MenuStatus -- Menu#MENU_COALITION
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
local function RemoveStatusMenu()
MenuStatus:Remove()
end
local function AddStatusMenu()
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
end
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
end

View File

@@ -1,56 +0,0 @@
do
-- This demo creates a menu structure for the two clients of planes.
-- Each client will receive a different menu structure.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
-- And play with the Add and Remove menu options.
-- Note that in multi player, this will only work after the DCS clients bug is solved.
local function ShowStatus( PlaneClient, StatusText, Coalition )
MESSAGE:New( Coalition, 15 ):ToRed()
PlaneClient:Message( StatusText, 15 )
end
local MenuStatus = {}
local function RemoveStatusMenu( MenuClient )
local MenuClientName = MenuClient:GetName()
MenuStatus[MenuClientName]:Remove()
end
--- @param Wrapper.Client#CLIENT MenuClient
local function AddStatusMenu( MenuClient )
local MenuClientName = MenuClient:GetName()
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" )
MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" )
end
SCHEDULER:New( nil,
function()
local PlaneClient = CLIENT:FindByName( "Plane 1" )
if PlaneClient and PlaneClient:IsAlive() then
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient )
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient )
end
end, {}, 10, 10 )
SCHEDULER:New( nil,
function()
local PlaneClient = CLIENT:FindByName( "Plane 2" )
if PlaneClient and PlaneClient:IsAlive() then
local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient )
MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient )
end
end, {}, 10, 10 )
end

View File

@@ -1,43 +0,0 @@
do
-- This demo creates a menu structure for the planes within the red coalition.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
local Plane1 = CLIENT:FindByName( "Plane 1" )
local Plane2 = CLIENT:FindByName( "Plane 2" )
-- This would create a menu for the red coalition under the main DCS "Others" menu.
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
local function ShowStatus( StatusText, Coalition )
MESSAGE:New( Coalition, 15 ):ToRed()
Plane1:Message( StatusText, 15 )
Plane2:Message( StatusText, 15 )
end
local MenuStatus -- Menu#MENU_COALITION
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
local function RemoveStatusMenu()
MenuStatus:Remove()
end
local function AddStatusMenu()
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
end
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
end

View File

@@ -1,56 +0,0 @@
do
-- This demo creates a menu structure for the two groups of planes.
-- Each group will receive a different menu structure.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
-- And play with the Add and Remove menu options.
-- Note that in multi player, this will only work after the DCS groups bug is solved.
local function ShowStatus( PlaneGroup, StatusText, Coalition )
MESSAGE:New( Coalition, 15 ):ToRed()
PlaneGroup:Message( StatusText, 15 )
end
local MenuStatus = {}
local function RemoveStatusMenu( MenuGroup )
local MenuGroupName = MenuGroup:GetName()
MenuStatus[MenuGroupName]:Remove()
end
--- @param Wrapper.Group#GROUP MenuGroup
local function AddStatusMenu( MenuGroup )
local MenuGroupName = MenuGroup:GetName()
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" )
MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" )
end
SCHEDULER:New( nil,
function()
local PlaneGroup = GROUP:FindByName( "Plane 1" )
if PlaneGroup and PlaneGroup:IsAlive() then
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup )
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup )
end
end, {}, 10, 10 )
SCHEDULER:New( nil,
function()
local PlaneGroup = GROUP:FindByName( "Plane 2" )
if PlaneGroup and PlaneGroup:IsAlive() then
local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup )
MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup )
end
end, {}, 10, 10 )
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,43 +0,0 @@
do
-- This demo creates a menu structure for the planes within the red coalition.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
local Plane1 = GROUP:FindByName( "Red Plane 1" )
local Plane2 = GROUP:FindByName( "Red Plane 2" )
local Plane3 = GROUP:FindByName( "Red Plane 3" )
local Plane4 = GROUP:FindByName( "Red Plane 4" )
-- This would create a menu for the red coalition under the main DCS "Others" menu.
local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
local function ShowStatus( StatusText, Coalition )
Plane1:MessageToRed( StatusText, 15 )
Plane2:MessageToRed( StatusText, 15 )
end
local MenuStatus -- Menu#MENU_COALITION
local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
local function RemoveStatusMenu()
MenuStatus:Remove()
end
local function AddStatusMenu()
-- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
end
local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
end

View File

@@ -1,56 +0,0 @@
TestMenus = {}
Menu = MENU_MISSION:New( "Generate Menus" )
do
-- This demo creates a menu structure for the planes within the red coalition.
-- To test, join the planes, then look at the other radio menus (Option F10).
-- Then switch planes and check if the menu is still there.
local Plane1 = GROUP:FindByName( "Red Plane 1" )
local Plane2 = GROUP:FindByName( "Red Plane 2" )
local Plane3 = GROUP:FindByName( "Red Plane 3" )
local Plane4 = GROUP:FindByName( "Red Plane 4" )
local CoalitionText = {
[coalition.side.BLUE] = "BLUE",
[coalition.side.RED] = "RED",
}
local function MenuMessage( Text, Parameter )
MESSAGE:NewType( Text .. Parameter, MESSAGE.Type.Information ):ToAll()
end
local function MenuRemove(m)
TestMenus[m]:Remove()
end
local function GenerateMissionMenu()
local m = #TestMenus+1
TestMenus[m] = MENU_MISSION:New( "Menu Mission "..m )
for n = 1, 8 do
local MenuMissionCommand = MENU_MISSION_COMMAND:New( "Show Mission "..m.."."..n, TestMenus[m], MenuMessage, "Mission ", m.."."..n)
end
local MenuMissionRemoveCommand = MENU_MISSION_COMMAND:New( "Remove Mission "..m, TestMenus[m], MenuRemove, m)
end
local function GenerateCoalitionMenu( Coalition )
local m = #TestMenus+1
TestMenus[m] = MENU_COALITION:New( Coalition, "Menu Coalition "..CoalitionText[Coalition].." ".. m )
for n = 1, 8 do
local MenuMissionCommand = MENU_COALITION_COMMAND:New( Coalition, "Show Coalition "..CoalitionText[Coalition].." "..m.."."..n, TestMenus[m], MenuMessage, "Coalition ", CoalitionText[Coalition].." "..m.."."..n)
end
local MenuMissionRemoveCommand = MENU_COALITION_COMMAND:New( Coalition, "Remove Coalition "..CoalitionText[Coalition].." "..m, TestMenus[m], MenuRemove, m)
end
-- Create a mission menu to generate the menus.
local MenuMission = MENU_MISSION_COMMAND:New( "Generate Mission Menus", Menu, GenerateMissionMenu )
local MenuCoalitionBlue = MENU_MISSION_COMMAND:New( "Generate Blue Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.BLUE )
local MenucoalitionRed = MENU_MISSION_COMMAND:New( "Generate Red Coalition Menus", Menu, GenerateCoalitionMenu, coalition.side.RED )
end