Jump to content
The simFlight Network Forums

Recommended Posts

Posted (edited)

Hi, every programmer here.

I am new to programming and wants to ask some questions about setting the weather in FS2K4 by using FSUIPC in a C++ Program.

I know they are some stupid questions. LOL. - -

1) I want to set the wind in the "Global" to 0, so I followed what the tutorial in the SDK said, set the weather DYNAMIC to 0, then call the function,

unsigned short Wcommand=NW_CLEAR;

FSUIPC_Read(0xC800,2,&Wcommand,&pdwResult);

FSUIPC_Process(&pdwResult);

I find the NW_CLEAR command did appeared in the LOG,

but that seems not working at all,(The Weather in FS still doesnt change...)

2) If i want to set a specific windspeed in "Global", How can I use the struct in the "NewWeather.h" (attached in the SDK)?Could anyone give an easy example of code?

3)After writting all the new weather Data into FS, Do I have to do something like "refreshing" to make the new setting take place?

Thank all you guys for helping me!!

Edited by Malfoy
Posted

1) I want to set the wind in the "Global" to 0, so I followed what the tutorial in the SDK said, set the weather DYNAMIC to 0, then call the function,

unsigned short Wcommand=NW_CLEAR;

FSUIPC_Read(0xC800,2,&Wcommand,&pdwResult);

FSUIPC_Process(&pdwResult);

You are READing the command word, not WRITING it?

Where's the Write for the Dynamics offset value?

2) If i want to set a specific windspeed in "Global", How can I use the struct in the "NewWeather.h" (attached in the SDK)?Could anyone give an easy example of code?

You'd need to read the whole weather structure, all parts, change the bit you want, then write it back. Using that interface there's no way to change just one part, you have to change it all -- the weather is written as one entity.

Note that setting.Global weather only sets the default weather for those stations which have none set yet. FS2004 uses localised weather and cannot be switched to global weather mode like FSX.

3)After writting all the new weather Data into FS, Do I have to do something like "refreshing" to make the new setting take place?

Not unless you use the Pending version of the commands, in which case you'd need to activate them all.

Regards

Pete

Posted

Thanks SO MUCH!Pete!

I've solve the problems above.

My weather program seems working well!

One more question:

I want to know if it is possible to change the setting in FSUIPC by a external program(xD actually in my program).

For example if I want to Enable the "Wind Smoothing" function for the user.

If that's possible?

Again! Thank you for helping !

Posted

I want to know if it is possible to change the setting in FSUIPC by a external program(xD actually in my program).

For example if I want to Enable the "Wind Smoothing" function for the user.

If that's possible?

Probably not. In fact certainly not, in FSX, but there is an option control in FSUIPC3 for FS9 and before. See the Options control section in the SDK's "FSUIPC for Programmers" document. Note that those facilities have probably been disused for many years. They were part of a set of facilities to allow writers of "game" or "adventure" scenarios to force some level of anti-cheating control over their users. Since Adventure Programming Language (APL) was withdrawn, replaced now by Missions, that's not been useful really.

Regards

Pete

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.