March 18, 200521 yr I read Dai Griffiths' excellent summary on gauge programmingand I found something I could not believe. He states that thetwo lines in element callback functions are obligatory:FLOAT64 FSAPI active_units_update( PELEMENT_STRING pelement ){ FLOAT64 val=pelement->source_var[0].var_value.n; val = !val; ...}He also explains:"The first line in the body of the structure is an FS2K+ requirement even if you are not actually reading a Token Variable. It seems to be needed to trigger FS to check if the string needs updating. The next line does the dirty deed and forces FS to run an update; each time it runs through this line it simply inverts the previous value of val thus creating the change necessary to trigger the update function."Well, these were the first lines had I deleted from the code I inherited and it still works. On the other hand I can not theoretically imagine how a simple read (first line) and update (second line) instruction would trigger FS at all. These are not FS API calls but are direct memory manipulations and only the CPU knows about them, the FS core application will not. The memory area "belongs" to FS application, but I know no mechanisms throught which FS would have been informed about any reads or updates there.Gabor
March 21, 200521 yr Author Martin,Look for sd2gau17.zip on flightsim.com. I'm not sure if the file is available here or not.Doug Dawson
Create an account or sign in to comment