Jump to content
The simFlight Network Forums

Recommended Posts

Hi there,

Is the "Freeze Altitude Set" included in FSUIPC3 for FS2004?

If not, how would I go about coding this for FSUIPC?

Keep in mind, I have no coding experience, so can someone explain, as simple as possible, how I would go about this?

Thanks in advance.

Share this post


Link to post
Share on other sites
5 hours ago, r22s7 said:

Is the "Freeze Altitude Set" included in FSUIPC3 for FS2004?

I don't think so, but did you check the supplied controls list?

5 hours ago, r22s7 said:

If not, how would I go about coding this for FSUIPC?

You'd need to write a Lua plug in with an loop writing the initially read altitude back to the altitude offset as fast as possible. even then, because you wouldn't always catch it before the next frame was displayed, so you'd still get the occasional nasty jitter.

Only way to do it properly would be to write your own small DLL in C or C++ to get into the innards of FS2004. But that would also involve hacking into its cod, so a knowledge of x86 assembly code would also be needed. No job for a non-programmer.

Pete

 

Share this post


Link to post
Share on other sites
33 minutes ago, Pete Dowson said:

You'd need to write a Lua plug in with an loop writing the initially read altitude back to the altitude offset as fast as possible. even then, because you wouldn't always catch it before the next frame was displayed, so you'd still get the occasional nasty jitter.

It wouldn't bother me too much if it jittered occasionally. Would you be able to walk me through how to do this?

Share this post


Link to post
Share on other sites
2 hours ago, r22s7 said:

It wouldn't bother me too much if it jittered occasionally. Would you be able to walk me through how to do this?

Try saving this in the FS Modules folder as a file called "freezeAlt.lua"

althi = ipc.readSD(0x574)
altlo = ipc.readUD(0x570)
while 1 do
   ipc.sleep(10) -- 10 mSecs = 100 times per sec
   ipc.writeUD(0x570,altlo)
   ipc.writeSD(0x574,althi)
end

Then, run FS. Go to FSUIPC options and assign a button or keypress to "Lua freezealt", and another to "Luakill freezealt".

Use the first keypress or button to freeze the altitude, and the other to release it.

Testing here I get an altitude variation of only 1-2 feet. That's with P3Dv4, so your results may differ. (I don't even have FS2004 any more).

You can try reducing the number 10 in the sleep line to make it set the altitude more often -- see what suits you and your setup.

Please note that I normally do NOT write plug-ins for users. I'd prefer they did their own research, so that they learn more and can do more things subsequently. I supply many examples and documentation in the FSUIPC Dcouments folder, and Lua has an excellentreference and tutorials on their website.

Pete

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.