Sign in to follow this  
Guest hefy_jefy

Frequency controlled animation - update

Recommended Posts

Some time ago I published my frequency controlled animation tutorial and some users reported that the opening and closing animations appeared more then one time. I have now found a solution for this.The origional source has a piece that looks like: IFIN1 a00, usrvar, 0, 0 SETWRD usrvr4, 2 a00 label word IFIN1 a01, usrvr4, 4, 4 IFIN1 a01, usrvar, 0, 0 SETWRD usrvr4, 5 a01 label word IFIN1 a02, usrvr4, 2, 2 IFIN1 a02, usrvar, 100, 100 SETWRD usrvr4, 3 a02 label word IFIN1 a03, usrvr4, 5, 5 IFIN1 a03, usrvar, 100, 100 SETWRD usrvr4, 0 a03 label wordNote that I used usrvr4 here, where the tutorial says 320h, but that is just an other way of calling a user variable (usrvr4 is not 320h, but it works the same.If you know change this code into: IFIN1 a00, usrvar, 0, 3 SETWRD usrvr4, 2 a00 label word IFIN1 a01, usrvr4, 4, 4 IFIN1 a01, usrvar, 0, 3 SETWRD usrvr4, 5 a01 label word IFIN1 a02, usrvr4, 2, 2 IFIN1 a02, usrvar, 97, 100 SETWRD usrvr4, 3 a02 label word IFIN1 a03, usrvr4, 5, 5 IFIN1 a03, usrvar, 97, 100 SETWRD usrvr4, 0 a03 label wordThe problems should be solved. This is because tick18 is 18 Hz, which means that 18 frames a second are shown. If your framerate is lower some of the frames are not shown. That is why the end check of the animation is not always reached after one cycle. I set the check 4 frames width in this example, maybe 2 or 3 also work, but that depends on the PC you use and how heavy your scenery is.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Arno!I will give it a try, thanks,Now what about this user variable if I have several pairs of frequency controlled hanger doors in the same scenery area although I can't see them at the same time? Should I make a different user varibale for each? Or assign a different frequency?They seem to work OK at the moment (but I suppose they all open and close when I select 112 as NAV2...)Trouble is I don'e really understand this stuff...But I learn Mr Fawlty, I learn....Geoff

Share this post


Link to post
Share on other sites

If you want them all to open when you select one frequency then you can keep the code like this. If for example one hangar is at one side of the airport and an other at the complete other site nobody will see it :).But when you want them to respond to a different frequency each, you must use a different user variable. FS has 5 user variables, but the GMax animation code already uses the first 3, so you have usrvr4 and usrvr5 left and you can also use the spare variables (I think they are called spare1 till spare#, but you should be able to find that in the Fs2002 scenery SDK, I am at work now and don't have the docs here).Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

I noted that every even variable over 320h seems to work fine. At least 322h, 324h, 326h, 328h, 32Ah, 32Ch, 32Eh and 330h seem to work fine with the gates of EFHK. Of course in some phase you'll hit a variable used for other purposes, so it's always good to chech if the variable really works. With odd varibles, for example 321h, I got some very odd behaviours. So I belive that you'll just have to use even hexas as user variables and everything will work fine untill you'll hit a reserved variable.[table border=0" cellspacing="0" cellpadding="0][TR][TD]http://mikael.svly.net/mikael.gif[/TD][/TR][TR][TD]fisd.fsnordic.net][/TD][/TR][/TABLE

Share this post


Link to post
Share on other sites

That's true, if you look at the Fs2000 SDK you will see that:usrvar 312husrvr2 314husrvr3 316husrvr4 318husrvr5 31AhThese are the variables MS has intended to be used by the user. There is also a range of spare vairiables, these start some 320h and continue like 322h, 324h, etc (I am not at home, so I can't find the all info now).I decided to use these names now, because it tells better what you are checking and writing then those abstract hex values. It also prevents you from messing it up.Without those names, for example, I didn't realise that MS already uses the first three user variables in the code MakeMDL makes for the animation and that explains why it didn't work when I did my first tests with 312h.Arno


Member Netherlands 2000 Scenery Team[a href=http://home.wanadoo.nl/arno.gerretsen]http://home.wanadoo.nl/arno.gerretsen/banner.jpg[/a]

Share this post


Link to post
Share on other sites

Lots of information - thanks guys!!My current project is a "roll up" sectioned hanger door, this gets complicated in hurry with 5 segments to look after...Stiil it keeps me busyThanks again,Geoff

Share this post


Link to post
Share on other sites

Hi Arno,Made the changes and it works great!!No more jumping doors,Thanks,Geoff

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
Sign in to follow this