[PRO CLOSED] Flightpath for Guided Missiles that still has to be launched from an unit

Post bug reports and ask for game support here.

Moderator: MOD_Command

Post Reply
RichardNijland
Posts: 3
Joined: Mon Aug 24, 2026 10:40 am

[PRO CLOSED] Flightpath for Guided Missiles that still has to be launched from an unit

Post by RichardNijland »

Game Version: Professional Edition v2.4.4.1
Subject:
Option to set a flightpath for a Guided Missile (GM) that has to be launched from an unit during the scenario.
Description:
When an aircraft is assigned to an land-strike-mission with a flight plan and has to launch a GM, the GM will go straight to the target. Unlike a GM with manual targetting where you can change it's path.
Attached Files:
GM_Question.zip: In which an B2 (Side_B) has a mission to execute a land-strike at The Hague (Side_A).
At firing range is will launch the GM, which will fly over a part of England.
The desired flightpath will be that it flies only above The Canal all the way through The Netherlands.
The GM-flightpath therefor needs an extra waypoint.

Extra information:
Starting the scenario after the GM is fired isn't an option, as in the original scenario there will be multiple missile attacks, from different launchers and distances, that have to strike different targets at exact the same time.
Attachments
GM_Question.zip
(28.6 KiB) Downloaded 10 times
User avatar
blu3s
Posts: 1369
Joined: Fri Jul 08, 2022 9:45 am

Re: Flightpath for Guided Missiles that still has to be launched from an unit

Post by blu3s »

Hi Richard

For professional support, please use the help desk located in your Matrix Pro Sims account.

Thank you!
Nikel
Posts: 3401
Joined: Tue Mar 24, 2009 10:51 am

Re: [PRO CLOSED] Flightpath for Guided Missiles that still has to be launched from an unit

Post by Nikel »

I do not know how to do it in normal play, so tried with lua. Is there an easier way?

And after too many tries with the AI to remember :? , it works.


You need to create a repeatable event.

Trigger is Regular Time, every second.

This is the lua code for the action that works in the attached scenario, updated to v517 and JASSMs instead of LRASMs.

-- 1. Faction side configuration
local playerSideName = "Side_B"

-- 2. Fetch the target unit dynamically
local targetUnit = ScenEdit_GetUnit({ guid = "29X785-0HNO20VA1LTI1" })

if targetUnit ~= nil then
-- 3. Define your custom course waypoint array with NEW coordinates (N50 57' 35", E1 24' 09")
local customWaypoints = {
{ lat = 50.959722, lon = 1.402500 }, -- Your NEW turning point
{ lat = targetUnit.latitude, lon = targetUnit.longitude } -- Live dynamic target
}

-- 4. Secure side information safely using the compliant side table wrapper
local sideObj = VP_GetSide({ Side = playerSideName })

if sideObj ~= nil and sideObj.units ~= nil then
-- 5. Iterate through all units active on your faction side
for _, uInfo in ipairs(sideObj.units) do
local u = ScenEdit_GetUnit({ guid = uInfo.guid })

-- 6. Snag only weapons matching the JASSM-ER name criteria
if u ~= nil and u.type == "Weapon" and string.find(u.name, "JASSM%-ER") then

-- Check the persistent database to see if this unique missile was already routed
local isAlreadyRouted = ScenEdit_GetKeyValue("routed_" .. u.guid)

if isAlreadyRouted ~= "yes" then
-- Inject the course
ScenEdit_SetUnit({
guid = u.guid,
course = customWaypoints
})

-- Globally register this missile's GUID as completed
ScenEdit_SetKeyValue("routed_" .. u.guid, "yes")
end

end
end
end
end



RR.gif
RR.gif (2.13 MiB) Viewed 195 times
Attachments
GM_Question v517 Lua Final.zip
(35.75 KiB) Downloaded 5 times
RichardNijland
Posts: 3
Joined: Mon Aug 24, 2026 10:40 am

Re: [PRO CLOSED] Flightpath for Guided Missiles that still has to be launched from an unit

Post by RichardNijland »

Hi Nikel,

thnx for the efford. Just started working with LUA, but i understand what you're doing.
Seems reproducable in the original scenario.

Best regards,
Richard
Post Reply

Return to “Tech Support”