Attack a specific unit
Posted: Sat May 28, 2022 8:27 pm
This is the situation and for which I cannot find a solution:
Two countries (BLUE and RED). BLUE sends a transport plane to base A. Once it arrives it deploys 3 NASAMS batteries nearby via an event. So far everything is correct.
local h;
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 1', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.58333333333333",})
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 2', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.6",})
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 3', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.616666666666667",})
ScenEdit_DeleteUnit({side="BLUE",unitname="DUMBO #1"})
a = 1
Once deployed I try to get a RED plane to take off to attack LAUNCH 1 through another event. The event checks every minute the value of a:
if a == 1 then
ScenEdit_AttackContact("Bomber #1", "LAUNCH 1")
end
But the plane does not take off. The plane is an F1 with air-to-ground armament.
I have thought about trying it with another method: define an area and in that area a STRIKE mission with Bomber #1 assigned but without targets, and later, when a=1 use a LUA command to assign the target to the mission, but I don't know how it's done.
If someone can help me I appreciate it. Thank you very much
Two countries (BLUE and RED). BLUE sends a transport plane to base A. Once it arrives it deploys 3 NASAMS batteries nearby via an event. So far everything is correct.
local h;
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 1', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.58333333333333",})
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 2', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.6",})
h = ScenEdit_AddUnit ({type = 'Facility', name = 'LAUNCH 3', dbid = 653, side = "BLUE", Lat = "28.983333333333334" , Lon = "-13.616666666666667",})
ScenEdit_DeleteUnit({side="BLUE",unitname="DUMBO #1"})
a = 1
Once deployed I try to get a RED plane to take off to attack LAUNCH 1 through another event. The event checks every minute the value of a:
if a == 1 then
ScenEdit_AttackContact("Bomber #1", "LAUNCH 1")
end
But the plane does not take off. The plane is an F1 with air-to-ground armament.
I have thought about trying it with another method: define an area and in that area a STRIKE mission with Bomber #1 assigned but without targets, and later, when a=1 use a LUA command to assign the target to the mission, but I don't know how it's done.
If someone can help me I appreciate it. Thank you very much