Skip to content

Commit

Permalink
1.3.7 - Tankers can move (again)
Browse files Browse the repository at this point in the history
- added a "move tanker to me" radio menu
- repaired the "move tanker" feature
- removed version number from radio menus
  • Loading branch information
davidp57 committed Feb 9, 2020
1 parent a71ace3 commit 50f7c1a
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "veaf-mission-creation-tools",
"version": "1.3.6",
"version": "1.3.7",
"description": "A set of scripts that help set up a dynamic mission",
"main": "readme.md",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafAssets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ veafAssets.Assets = {
-- list the assets common to all missions below
}

veafAssets.RadioMenuName = "ASSETS (" .. veafAssets.Version .. ")"
veafAssets.RadioMenuName = "ASSETS"

-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Do not change anything below unless you know what you are doing!
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafCarrierOperations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ veafCarrierOperations.Trace = false
--- All the carrier groups must comply with this name
veafCarrierOperations.CarrierGroupNamePattern = "^CSG-.*$"

veafCarrierOperations.RadioMenuName = "CARRIER OPS (" .. veafCarrierOperations.Version .. ")"
veafCarrierOperations.RadioMenuName = "CARRIER OPS"

veafCarrierOperations.AllCarriers =
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafCasMission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ veafCasMission.SecondsBetweenFlareRequests = 120
--- Name of the CAS targets vehicles group
veafCasMission.RedCasGroupName = "Red CAS Group"

veafCasMission.RadioMenuName = "CAS MISSION (" .. veafCasMission.Version .. ")"
veafCasMission.RadioMenuName = "CAS MISSION"

veafCasMission.DefaultCountry = "RUSSIA"

Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafCombatZone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ veafCombatZone.DefaultSpawnRadiusForUnits = 50

veafCombatZone.DefaultSpawnRadiusForStatics = 0

veafCombatZone.RadioMenuName = "COMBAT ZONES (" .. veafCombatZone.Version .. ")"
veafCombatZone.RadioMenuName = "COMBAT ZONES"

-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Do not change anything below unless you know what you are doing!
Expand Down
30 changes: 23 additions & 7 deletions scripts/veaf/veafMove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ veafMove = {}
veafMove.Id = "MOVE - "

--- Version.
veafMove.Version = "1.2.2"
veafMove.Version = "1.3"

-- trace level, specific to this module
veafMove.Trace = false

--- Key phrase to look for in the mark text which triggers the command.
veafMove.Keyphrase = "_move"

veafMove.RadioMenuName = "MOVE (" .. veafMove.Version .. ")"
veafMove.RadioMenuName = "MOVE"

-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Do not change anything below unless you know what you are doing!
Expand All @@ -89,6 +89,8 @@ veafMove.markid = 20000

traceMarkerId = 6548
debugMarkers = {}

veafMove.Tankers = {}
-------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Utility methods
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -491,11 +493,27 @@ end
-- Radio menu and help
-------------------------------------------------------------------------------------------------------------------------------------------------------------

--- Build a radio menu to move the Arco tanker
function veafMove.moveTankerToMe(parameters)
local tankerName, unitName = unpack(parameters)
veafMove.logDebug(string.format("veafMove.moveTankerToMe(tankerName=%s, unitName=%s)",tankerName,unitName))
local unit = Unit.getByName(unitName)
if unit then
veafMove.moveTanker(unit:getPosition().p, tankerName, -1, -1) -- -1 means to use the currently defined speed and altitude
veaf.outTextForUnit(unitName, string.format("%s - Moving to your position right away !", tankerName), 10)
end
end

--- Build the initial radio menu
function veafMove.buildRadioMenu()
--veafMove.rootPath = veafRadio.addSubMenu(veafMove.RadioMenuName)
--veafRadio.addCommandToSubmenu("HELP", veafMove.rootPath, veafMove.help, nil, veafRadio.USAGE_ForGroup)
--veafRadio.refreshRadioMenu()
veafMove.logDebug(string.format("veafMove.buildRadioMenu()"))
veafMove.rootPath = veafRadio.addSubMenu(veafMove.RadioMenuName)
veafRadio.addCommandToSubmenu("HELP", veafMove.rootPath, veafMove.help, nil, veafRadio.USAGE_ForGroup)
for _, tankerName in pairs(veafMove.Tankers) do
local menuName = string.format("Move %s to me", tankerName)
local moveTankerPath = veafRadio.addSubMenu(menuName, veafMove.rootPath)
veafRadio.addCommandToSubmenu(menuName , moveTankerPath, veafMove.moveTankerToMe, tankerName, veafRadio.USAGE_ForUnit)
end
end

function veafMove.help(unitName)
Expand All @@ -506,8 +524,6 @@ function veafMove.help(unitName)
' add ", speed [speed]" to make the group move and at the specified speed (in knots)\n' ..
'Type "_move tanker, name [groupname]" to create a new tanker flight plan and move the specified tanker.\n' ..
' add ", speed [speed]" to make the tanker move and execute its refuel mission at the specified speed (in knots)\n' ..
' add ", hdg [heading]" to specify the refuel leg heading (from the marker point, in degrees)\n' ..
' add ", dist [distance]" to specify the refuel leg length (from the marker point, in nautical miles)\n' ..
' add ", alt [altitude]" to specify the refuel leg altitude (in feet)\n' ..
'Type "_move afac, name [groupname]" to create a new JTAC flight plan and move the specified afac drone.\n' ..
' add ", speed [speed]" to make the tanker move and execute its mission at the specified speed (in knots)\n' ..
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafNamedPoints.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ veafNamedPoints.Points = {
--- these points will be processed at initialisation time
}

veafNamedPoints.RadioMenuName = "NAMED POINTS (" .. veafNamedPoints.Version .. ")"
veafNamedPoints.RadioMenuName = "NAMED POINTS"

veafNamedPoints.LowerRadioMenuSize = true
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafRadio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ veafRadio.Version = "1.1.4"
-- trace level, specific to this module
veafRadio.Trace = false

veafRadio.RadioMenuName = "VEAF (" .. veaf.Version .. " - radio " .. veafRadio.Version .. ")"
veafRadio.RadioMenuName = "VEAF"

--- Number of seconds between each automatic rebuild of the radio menu
veafRadio.SecondsBetweenRadioMenuAutomaticRebuild = 600 -- 10 minutes ; should not be necessary as the menu is refreshed when a human enters a unit
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafSpawn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ veafSpawn.RedSpawnedUnitsGroupName = "VEAF Spawned Units"
--- Illumination flare default initial altitude (in meters AGL)
veafSpawn.IlluminationFlareAglAltitude = 1000

veafSpawn.RadioMenuName = "SPAWN (" .. veafSpawn.Version .. ")"
veafSpawn.RadioMenuName = "SPAWN"

--- static object type spawned when using the "logistic" keyword
veafSpawn.LogisticUnitType = "FARP Ammo Dump Coating"
Expand Down
2 changes: 1 addition & 1 deletion scripts/veaf/veafTransportMission.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ veafTransportMission.RedDefenseGroupName = "Cargo - Enemy Air Defense Group"
--- Name of the enemy group that blocades the friendlies
veafTransportMission.RedBlocadeGroupName = "Cargo - Enemy Blocade Group"

veafTransportMission.RadioMenuName = "TRANSPORT MISSION (" .. veafTransportMission.Version .. ")"
veafTransportMission.RadioMenuName = "TRANSPORT MISSION)"

veafTransportMission.AdfRadioSound = "l10n/DEFAULT/beacon.ogg"

Expand Down

0 comments on commit 50f7c1a

Please sign in to comment.