You have to set a valid value, (0,0) is the reference origin for the coordinates, its position depends on the map, but in general is not the center of the map.
Copy these values suggested by Shimmergloom667
s
It does not work exactly the same as aircraft. You do not need to set vehicles as player nor client. You have to check the "Player can drive" checkbox, and then from the F10 map you can click the "Unit take control" button on the upper bar to access it.
Solved!! 🥳
I find my mistake, I only needed to cast the coordinates to Core.Point#COORDINATE. This seems to work so far, it allows me to spawn several flights and set their route during my mission depending on what I need
BLUE_CAP_ISRAEL = SPAWN
:New("Blue CAP F15E")
:InitLimit(8, 16)
:OnSpawnGroup(
function(SpawnGroup)
local position = COORDINATE:New(ACTIVE_POSITION.x, ACTIVE_POSITION.y, ACTIVE_POSITION.z)
local flightgroup=FLIGHTGROUP:New(SpawnGroup)
flightgroup:Activate()
local wp1=flightgroup:AddWaypoint(position, 550, nil, 35000) -- This must be switched for a loop
end
)
And from the radio menu I can call
BLUE_CAP_ISRAEL:SpawnAtAirbase(AIRBASE:FindByName(AIRBASE.Sinai.Ovda), SPAWN.Takeoff.Runway)
In my simple tests it works. I create a marker, capture its coordinates on an event and then spawn a flight which is directed to that position. Now let's hope it will still work during an actual mission with enemies and air defenses, or if the AI decides to scrap its orders and do random stuff, as usual 😛