Hi all,
This may have been answered here but if so I didn't find it in a search for any of the keywords I could think of :)
My program (FSCaptain) auto-loads the fuel and payload into the aircraft. In FSX this works fine, and in FS9 it appears to work but in fact it never changes the gross weight of the airplane (offset 0x30C0.) The result is that difference between the gross weight and the sum of the weights loaded in the fuel tanks and payload stations is considered "Ice Weight" and shows up as ice on the wings in the ice warning gauge supplied with FSCaptain (that most people never seem to use and few have noticed in the year it's been out!)
My question is, why doesn't a write to 0x30C0 and 0x30C8 with the correct numbers solve this problem? Am I doing something silly or missing a magic incantation?
Here's the code:
FSUIPC_Write( 0x13FC, 4, &stncnt, &dwResult); // station count
FSUIPC_Write( 0x1400, sizeof(loadstn) * stncnt, &LoadStation, &dwResult);
FSUIPC_Process(&dwResult);
// FS9 does not recalculate aircraft weights, we will do it here and load them
if (SimVersion == 9) {
GetFuel();
GetPayload();
flt64 = ACEmptyWgt + TotalFuelPounds + TotalPayload;
FSUIPC_Write(0x30C0, 8, &flt64, &dwResult);
FSUIPC_Process(&dwResult);
flt64 *= 32.174049;
FSUIPC_Write(0x30C8, 8, &flt64, &dwResult);
FSUIPC_Process(&dwResult);
zfw = ACEmptyWgt + Payload;
FSUIPC_Write(0x3BFC, 4, &flt64, &dwResult);
FSUIPC_Process(&dwResult);
}
Now the payload stations get written just fine. I've checked and rechecked this in the debugger and the writes get executed and the correct numbers are in the variables. But the gross weight read back from 0x30C0 or from the sim variables reporting the same number never changes until I bring up the payload dialog from the FS menu and close it -- then FS9 recalculates things properly.
Thanks for any pointers.
Slightly frustrated,
Dutch
PS. A word of appreciation for FSUIPC without which so much wouldn't have been possible in the FS world! We'd all still be marveling at what SimConnect could do for us...and FSUIPC still does so much more!