Jump to content
The simFlight Network Forums

Module writers, how to update every frame?


Guest

Recommended Posts

I need a function that I can specify and that will be called by FS every frame. Does anyone know how to do this?

I think Pete doesn't know. But maybe someone else knows. If I have this function, I can get rid of 1 extra thread in my program.

Link to comment
Share on other sites

I need a function that I can specify and that will be called by FS every frame. Does anyone know how to do this? I think Pete doesn't know. .

It isn't that I don't know. It is just that it is relatively complicated and it is changing.

You need to set a callback via routines currently (FS2002) in CHAIN.DLL. If you analyse any of the regular FS modules (try a relatively small one if I were you) you will find places where it installs callbacks by invoking procedures in CHAIN.DLL, and, likewise, other places where these are uninstalled, before exit. Start with the Module_Init and Module_Deinit procedures they all have. If those calls aren't in those they'll be someplace close.

The next problem is that there are seemingly hundreds of different chains, all running either at different regular rates (eg Time Tick, multiples of timer ticks, frames, n Frames, n times per frame, or just on special events, like weather changes). To work out which does what needs a module to link into them ALL and log them, the accurate time, and their parameters. That's what I did years ago. I've not got it now. But I think chain 19 is mostly once per framein FS2002 in any case.

But things change and it's different in FS2004. Once you start venturing down this path you'll find you've got more work cut and and it is never ending. I'm not going to do it all for you. Sorry.

Good luck,

Pete

Link to comment
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
×
×
  • Create New...

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.