Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete

I wonder if you could give me a bit of guidance on this. I am setting wind using the AWI offsets. Reading your notes in this I can set only the upper altitude at which the wind operates so if, for example I set a wind layer up to 2000ft with one speed and direction and then another up to 4000ft then I get the settings for the 4000ft one overriding the first one. They are processed in the same process call to FSUIPC - does that matter?

Now it may very well be my lack of understanding because I am not clear on the differences between Set and addAt. I am setting layers one at a time so I have been using ADDat rather than set. Also I would appreciate some guidance on the use of nAfter in the data structures. If I set a single layer then presumably nAfter is zero. If I set another one below if then is nAfter 1 for that layer? and if I set one above it is nAfter zero again.

Sorry for all these questions...

Thanks in advance

Posted

I am setting wind using the AWI offsets.

This is for FS2000 or FS2002 I take it?

Reading your notes in this I can set only the upper altitude at which the wind operates so if, for example I set a wind layer up to 2000ft with one speed and direction and then another up to 4000ft then I get the settings for the 4000ft one overriding the first one.

Er, no. You can set many wind layers all at once. And winds are not necessarily the strength and direct at the upper altitude -- maybe they will be in the centre of the layer, but the altitudes give are the changeover points and normally there's be a lot of smoothing between two adjacent layers.

Now it may very well be my lack of understanding because I am not clear on the differences ...

It's a long long time since any one started using AWI. That was designed for FS2000 and extended to FS2002 but it isn't really of much use in FS2004. Can you confirm that you realy do want to program weather for older versions of FS, and then perhaps we'll discuss the interface. I would need to revise it first as I wrote all that stuff five or six years ago and haven't used it or discussed it for years.

Regards

Pete

Posted

Hi Pete

Thanks for the reply - yes I do need to support FS2k2 and FS9 - at the moment I am trying to get the 2k2 stuff to work - I plan to use the NWI for FS9.

I guess ther will not be many users on FS2k2 but I know of several that would need to use the program I am writing.

I don't need to do anything clever - since this is a sort of 'adventure' generator I am mostly looking to create weather conditions near the aircraft and change them over the life of the flight - a couple of layers of wind, cloud, temp etc are going to be plenty :D :D

Posted

I don't need to do anything clever - since this is a sort of 'adventure' generator I am mostly looking to create weather conditions near the aircraft and change them over the life of the flight - a couple of layers of wind, cloud, temp etc are going to be plenty :D :D

In that case, for such simple things, you might find the FS98 interface sufficient -- the direct writable offsets at 0F1C (114 bytes). This interface was all there was in FS98, the extensions in the AWI were to allow for the many more layers possible in FS2000. There's a simple addition for the FS98 interface for rain/snow control and a few other things. Read the Notes in the Progrmmer's guide under the title "Additional information for Application programmers".

Anyway, to briefly answer your earlier questions as best I can with my failing memory:

I am not clear on the differences between Set and addAt.

Set replaces the whole structure. If you read the actual comments in the header file you will see it does say "set all ...". If you are setting all the weather this is better than adding all the time.

AddAt adds a cloud layer at the altitude specified in the command itself (the lower 16 bits). It should do this without disturbing the others, but some small adjustment might be made if this makes any layer too "thin" (and no, sorry, I don't remember how 'thin' they can be).

Also I would appreciate some guidance on the use of nAfter in the data structures. If I set a single layer then presumably nAfter is zero. If I set another one below if then is nAfter 1 for that layer? and if I set one above it is nAfter zero again.

nAfter is merely a counter for the number of layers following the current one in the same command data structure. Since you can only have one such layer in AddAt it is always zero in that. If you were setting 10 layerrs by Set All then the first one would say 9, then next 8, and so on. The last 0.

If you have any other existing program which uses this interface you might learn a lot by turning on FSUIPC IPC write logging and seeing exactly what it does. Come to think of it, my own "WeatherSet" program uses the AWI and was intended as just such a demonstration. You can check all sorts of things with that.

WeatherSet2 is the demo program for the FS2004 NWI.

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.