December 17, 200718 yr Commercial Member I'm trying to create a refueling system for my current project and thought I'd got it beaten by using the FUEL TANK XXXX variables as they are listed as settable. However, this doesn't work...execute_calculator_code("(A:FUEL TANK LEFT MAIN,Percent+requested_fuel)(>K:FUEL TANK LEFT MAIN)", NULL, &retval, NULL);where requested_fuel is also a percentage. It does absolutely nothing - it's got to be me at fault but where?-Dai
December 17, 200718 yr Commercial Member Well... FUEL TANK LEFT MAIN isn't a keyboard event. It's just a read-only variable that returns how much fuel is in the left main tank. No more, no less.You didn't mention whether this is for FS9 or FSX... in FS9 there is exactly one event for refueling and I believe it's broken.In FSX I think SimConnect has a refuel capability... but I'm not 100% on that. Ed Wilson Mindstar AviationMy Playland - I69
December 17, 200718 yr Hi Dai,Unfortunately it is not possible to add fuel to individual tanks using XML events AFAIK. However, you can indeed add fuel in general using ADD_FUEL_QUANTITY event, from 0 to 65535 (100%) like this:int iFuel=32767; //50% to addchar cCode[60];PCSTRINGZ szCode;sprintf_s(cCode,"%d%s",iFuel," (>K:ADD_FUEL_QUANTITY)");szCode=cCode;execute_calculator_code(szCode, NULL,NULL, NULL);This could be your start point to experiment with different values.Tom
December 17, 200718 yr Moderator All of the token variables listed as "settable" may only be "set" via SimConnect. This of course is necessary in order to keep any shared cockpits synchronized.Unfortunately, unless your coding for FSX, that isn't terribly helpful... :-roll Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 17, 200718 yr Author Commercial Member Thanks guys - I really, really wanted to be able to set the individual tank levels.... however...Bill - are you hinting that it's possible to SimConnect to yourself i.e. if I was coding for FSX, then I could use the SimConnect effectively as a gauge within the aircraft?-Dai
December 18, 200718 yr Moderator Well, yes. It's a round about way to do it, but there's no reason why you cannot write a small .dll and have SimConnect do the 'work' for you.Please note that this is entirely theory for me, as I've not tried anything like this myself... ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 18, 200718 yr Actually you can call SimConnect functions, which are asyncronious, within a custom DLL -not a common .gau but a .dll that instantiate Panel/Aircraft classes. There is a public function contained -Update() that executes on 18 HZ tick, so the calls can be put there. Currently I'm working on a similar stuff. You may want to see the "CabinComfort" example from FSX SDK to learn on how to program the dll.Tom
December 18, 200718 yr Moderator It's worth pointing out that this is very similar to the way that you can retrieve data from the gps.dll using either XML or C code. ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
December 19, 200718 yr Author Commercial Member I'd read that somewhere here, Bill, and noted it very strongly for my FMS/INS!! :)-Dai
Create an account or sign in to comment