PDA

View Full Version : Is I_MagneticCompass broken?


salmo
11-28-2012, 05:34 AM
Can anyone tell me if the I_MagneticCompass paramater type has been broken? My script execution is stopping at this line without an error being thrown, which is very puzzling. Oh, and the aircraft is not null & is an AiAircraft.


if (aircraft != null && aircraft is AiAircraft)
{
Console.WriteLine("This line executes OK");
double heading = aircraft.getParameter(part.ParameterTypes.I_Magnet icCompass, 0);
Console.WriteLine("This line fails to execute");
}

Osprey
11-28-2012, 03:43 PM
Hi Salmo, long time no speak (since USL days!)

We need to be talking to you mate, I believe Farber PM'd you, but you also contacted Moggel. Perhaps at SOW campaign time?

Cheers bud

theOden
11-28-2012, 05:36 PM
I'd say it's very much broken.

trying this:


AiAircraft aircraft = actor as AiAircraft;
if (aircraft != null && aircraft is AiAircraft)
{
double Z_AmbientAirTemperature = aircraft.getParameter(part.ParameterTypes.Z_Ambien tAirTemperature, -1);
GamePlay.gpLogServer(null, "aircraft heading: {0}", new object[] { Z_AmbientAirTemperature.ToString("0.00") });
double I_MagneticCompass = aircraft.getParameter(part.ParameterTypes.I_Magnet icCompass, 0);
GamePlay.gpLogServer(null, "aircraft heading: {0}", new object[] { I_MagneticCompass.ToString("0.0") });
};


will leave me with correct ambient temp and then a huge error on server console.
I guess the function fails to bring the plane with itself as that seems to be the reported null value.
(tried in Hurri and spit mkII btw)

Edit: tried different integers just in case. no success.
Edit2: btw, must be the compass that equals null - ja bet it is.