PDA

View Full Version : Landing at enemy airfields



Salmo
Apr-10-2013, 01:47
It's a perenial problem for some players & so easy to fix. I've spawned in at several airfields to find an enemy plane either landed or landing at the field. This might be OK in a free-for-all DF server, but it is entirely unrealistic for mission scenarios that try to simulate BOB battles. The problem could be fixed very easily by including a simple C# snippet into the OnAircraftLanded script event.



public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);

//------------------------------------------------
// remove aircraft landing at enemy airfields
//------------------------------------------------
if (aircraft.Player(0) != null)
{
foreach (AiAirport ap in GamePlay.gpAirports())
{
if (GetArmyAtPoint(ap.Pos().x, ap.Pos().y) != aircraft.Army())
//if (ap.Army() != aircraft.Army())
// using GetArmyAtPoint because Ap.Army() returns zero & not the army number
// another game bug :(
{
Point3d p = new Point3d();
p.x = aircraft.Pos().x;
p.y = aircraft.Pos().y;
p.z = 0;
if (ap.Pos().distance(ref p) < ap.CoverageR())
{
GamePlay.gpHUDLogCenter(aircraft.Player(0).Name() + " has been captured.");
aircraft.Destroy();
}
}
}
}
}

public int GetArmyAtPoint(double x, double y)
#region returns the army number at the specified point
{
int result = 0;
result = GamePlay.gpFrontArmy(x, y);
return result;
}
#endregion

Skoshi_Tiger
Apr-10-2013, 02:36
Didn't Brittain obtain it's first intact version of the FW 190 because the pilot got lost, ran low on fuel and landed on an English airfield?

Only times I can remember landing at an enemy field if when I had a damaged engine and it was the logical place to put the plane down.

I don't think landing at an enemy airfield is too bad, it's only when they taxi over and park near your spawn point attracting flack! :wink:


Thanks for the code snippit. It's interesting to see how the scripting is done!

Salmo
Apr-10-2013, 04:20
Didn't Brittain obtain it's first intact version of the FW 190 because the pilot got lost, ran low on fuel and landed on an English airfield? Only times I can remember landing at an enemy field if when I had a damaged engine and it was the logical place to put the plane down. I don't think landing at an enemy airfield is too bad, it's only when they taxi over and park near your spawn point attracting flack! :wink: Thanks for the code snippit. It's interesting to see how the scripting is done!
Sure there were occassions when planes landed at enemy airfields. I hear players complain on TS about the pilot who lands without damage, just to p... the others off. If you want to tart-up the script you could allow damaged planes or planes with low fuel or injured pilots to land without penalty, but what's the point? If you land at an enemy airfield you should lose your plane.



public override void OnAircraftLanded(int missionNumber, string shortName, AiAircraft aircraft)
{
base.OnAircraftCrashLanded(missionNumber, shortName, aircraft);

//------------------------------------------------
// remove aircraft landing at enemy airfields
//------------------------------------------------

if (aircraft.Player(0) != null)
{
// variables/conditions
bool PlayerInjured = false;
bool LowFuel = false;
bool AircraftDamaged = false;

// set variables/conditions
AiPerson person = aircraft.Player(0) as AiPerson; //player health
if (person != null && (float)person.Health < 1f) PlayerInjured = true; //player health
if (aircraft.getParameter(part.ParameterTypes.S_FuelR eserve, -1) < 10) LowFuel = true; // fuel level
if (aircraft.getParameter(part.ParameterTypes.M_Healt h, -1) < 1f) AircraftDamaged = true; // aircraft damaged

foreach (AiAirport ap in GamePlay.gpAirports())
{
if (ap.Army() != aircraft.Army() && !LowFuel && !AircraftDamaged && !PlayerInjured)
{
Point3d p = new Point3d();
p.x = aircraft.Pos().x;
p.y = aircraft.Pos().y;
p.z = 0;
GamePlay.gpHUDLogCenter(aircraft.Player(0).Name() + " has been captured.");
if (ap.Pos().distance(ref p) < ap.CoverageR()) aircraft.Destroy();
}
}
}
}

ATAG_Torian
Apr-10-2013, 05:51
Always gonna be difficult to get a consensus on the implementation of "penalties" for what may or may not be "gaming the game". I agree that if a plane lands at an enemy field it should be instantly destroyed along with the pilot. Would be good to see their stats reduced back to 0 as well. There is certainly a lot of deliberate flak distraction going at times but it will happen from aircraft landed away from airfields as well. I think the destruct code should be expanded to a wider range if possible. It does seem to be only an issue on British airfields as the flak on the French airfields is so vicious it will destroy any enemy plane within moments after landing.

92 Sqn. Philstyle (QJ-P)
Apr-10-2013, 06:43
Always gonna be difficult to get a consensus on the implementation of "penalties" for what may or may not be "gaming the game". I agree that if a plane lands at an enemy field it should be instantly destroyed along with the pilot..

I agree. One should not be able to sit there for a few minutes in the cockpit and relay infromation to your mates about who might or might not be taking off.

Yes - I've done the above before.

9./JG52 Ziegler
Apr-10-2013, 08:29
It should be considered the same a bail out.

Injerin
Apr-10-2013, 08:55
NO! if you land at enemy air-field you should get a timer called POW 30 sec before respawn immediately after landing. Have a splash screen blacking you out from seeing further action. Or just as your plane comes to a stop you explode :)

Kling
Apr-11-2013, 12:54
wait what exactly is the issue here?? Are we talking about stats on the ATAG website or something?

In what way does it affect gameplay if an enemy aircraft crashlands on an enemy airfield assuming it only happens when the plane or pilot is seriously damaged/wounded. the remaining ones must be less than 1% of the players and cant really be an issue.

Off topic tho, I think a frontline cross the channel would be great! If you ditch anywhere on the wrong side of this frontline you are captured.

ATAG_Snapper
Apr-11-2013, 13:41
wait what exactly is the issue here?? Are we talking about stats on the ATAG website or something?

In what way does it affect gameplay if an enemy aircraft crashlands on an enemy airfield assuming it only happens when the plane or pilot is seriously damaged/wounded. the remaining ones must be less than 1% of the players and cant really be an issue.

Off topic tho, I think a frontline cross the channel would be great! If you ditch anywhere on the wrong side of this frontline you are captured.

It happens on a regular basis at Hawkinge and Ramsgate, Kling. The enemy pilot sits in the landed aircraft and draws flak away from strafing wingmen. The landed enemy is also calling out RAF aircraft to his wingmen, presumably after hitting ALT F2 to give him a 360-degree view.

Alternatively, enemy aircraft will land and park near an airfield, but partially hidden by a building structure for much the same reason. Buzzsaw and I burned a lot of gas one evening swooping between Hawkinge and Lympne chasing low level flak hunting for low-flying enemy that never materialized. We could only conclude that it was parked aircraft generating the ground bursts -- based on both our experience of having witnessed the act being done regularly before.

One partially-effective counter tactic is to turn trees OFF in your GUI, so now you're flying the Cliffs of Kansas and parked enemy aircraft may stand out better. You can't ignore the low level flak bursts because a favourite -- and very effective tactic -- of enemy aircraft is to fly inland of the coastal airfields at below treetop height. They suddenly appear without warning to ambush landing and taking off aircraft -- every RAF pilot has fallen victim frequently to this.

It's gamey, but not breaking any rules. If Speedtrees gets its collision modelling fixed, this tactic will be virtually eliminated. It's annoying, but hardly a dealbreaker IMHO.

It's also plausible that RAF are doing the same to LW airfields, but probably not as a regular thing since there's been no complaining of it here.

1lokos
Apr-11-2013, 17:09
Use POW script... for 5 minutes. :devilish:


PrisonCamp.Add(NewPrisoner);

http://forum.1cpublishing.eu/showpost.php?p=333766&postcount=7

Sokol1

Skoshi_Tiger
Apr-12-2013, 00:20
I seem to remember a case during WWII where a RAAF pilot landed at the edge of an Axis airfield in North Africa to pick up a downed wingman.

So the script would have allow for a 5 minute time frame where another team member can land taxi over to the downed aircraft and then take off again( within a reasonable time limit) upon which the rescuing pilot immediately gains "Ledgend" status and wins the map! Of course other team mates would have to be straffing the airfield to suppress ground troops!

:)

Skoshi_Tiger
Apr-12-2013, 00:25
This whole situation will become moot anyway when TF implements the controllable ground vehicles! I'll put my hand up to drive a tank around Hawkhinge looking for parked E/A's

Osprey
Apr-12-2013, 03:08
One thing not mentioned is that if you shoot somebody up and they land at your airfield you don't get credit for it. I think that's the case anyway.

Gromit
Apr-12-2013, 11:06
This whole situation will become moot anyway when TF implements the controllable ground vehicles! I'll put my hand up to drive a tank around Hawkhinge looking for parked E/A's

:) that would be hilarious if no one told them!

Salmo
Apr-13-2013, 06:55
C# script code updated in 1st post due to a game bug. The ap.Army() call should return the army number (1 or 2) but it always returns a zero. As a work-around I've used the GetArmyAtPoint function to obtain the correct army number.