Jump to content

Recommended Posts

Posted

I am building a campaign for the MiG 21, and one of the mission requires you to rendezvous with a transport and escort him to base.

 

However, there seems no way to guide to the transport except to use F10, which I see as a "cheat."

 

Is there a way to program AWACS or Ground Control to guide you to a friendly group?

 

Thanks!

Posted

If I understand correctly, the thing you are trying to achieve is to have AWACS, GC, or someone to guide you to the transport plane to be rendezvoused with. I am working on a fake "ground control" script on my server mission. I can see some similarity in here.

 

What I can think of is to, for example, ask for position of say two plane in a trigger zone, then use some math to work out the relative velocity, height and distance between the two planes, and print it out.

 

I don't think I can achieve what I've planned above without doing a script. So I'll just leave some simple code to see if it might help you in the making of your mission.

 

rdv_mig = Unit.getByName("Player's MiG-21Bis")
rdv_transport = Unit.getByName("Some transport name")

posMig_21 = Unit.getPoint(rdv_mig)
posTransportPlane = Unit.getPoint(rdv_transport)
[color="YellowGreen"]-- Unit.getPoint() returns a vec3 point = {y, x, z}[/color]

rdv_vA = posTransportPlane.z - posMig_21.z
rdv_vB = posTransportPlane.x - posMig_21.x

rdv_dist = math.sqrt(rdv_vA^2 + rdv_vA^2)
[color="YellowGreen"]-- or you can choose to use MIST which has a function to calc the distance between 2 vec2/vec3[/color]


if rdv_vA > 0 then
   rdv_hdg = math.atan(rdv_vA / rdv_vB)
elseif rdv_vA < 0 then
   rdv_hdg = math.atan(rdv_vA / rdv_vB) + math.pi
end

[color="YellowGreen"]--since Heading to target is in degree, convert to degree[/color]
rdv_hdg_deg = rdv_hdg * 180 / math.pi

trigger.action.outText("Fly heading " .. rdv_hdg_deg .. " for " .. rdv_dist, 30)

 

Don't have dcs now so I can't test it; but it should work, to some extent:joystick:. Good luck!

Nooooooooo

Posted

That's a brilliant and elegant thought, Master Zelgadis.

 

However, can the AI even "see" friendly units? It may not have been programmed into the code to begin with... I know it can see the player, but I have no evidence it can see friendlies.

Posted

I think not.

 

But, there should be a way to make a table with own units and include them into the script. It is realistic to, since it is supposed that friendly units are in known positions (most of the time)

  • Like 1
Posted

Alas, I don't think I know how to create a table or know what that means. Would this be a spreadsheet?

 

I thought of a crude way to get the group to announce its position however. By having the transport fly a set path with several waypoints, I can predict its position. I can then set a flag and have it report its position periodically.

 

Still, this is crude, and fairly imperfect. And it relies on having a rather competent player who is well aware of his own position. That can be hard over open ocean where most of the mission takes place.

Posted
Alas, I don't think I know how to create a table or know what that means. Would this be a spreadsheet?

 

I thought of a crude way to get the group to announce its position however. By having the transport fly a set path with several waypoints, I can predict its position. I can then set a flag and have it report its position periodically.

 

Still, this is crude, and fairly imperfect. And it relies on having a rather competent player who is well aware of his own position. That can be hard over open ocean where most of the mission takes place.

 

You can put a F10 radio message and when asked, he will give you its position on demand, with a script. Using mist.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...