Archived

This topic is now archived and is closed to further replies.

Guest electeddonkee

Delayed part animation, FS2004 model XML.

Recommended Posts

Hello all,I'm currently modelling an aircraft using the FS2004 SDK and gmax. I've been doing some playing around with xml recently, but I've come across an obstacle I haven't been able to solve.Basically, I want the ailerons to move with a delayed reaction. For example, suppose I turned the yoke all the way to right. I don't want the ailerons to move right away, I want them to react ~1 second after I do the command. Likewise, when I return the yoke to neutral, I only want the ailerons to return to neutral 1 second later. In essence, I want a 1 second delayed reaction time between the yoke and ailerons. I've tried a few things without success, but to be honest I haven't even been able to come up with many theories as to how to achieve this. Playing with the value isn't really convincing enough, but I suppose it will do if no other solution can be found.Therefore, I look to you XML gurus out there for some assistance. Is there such a thing as a modifier I can apply to the animation? I found some form of this in some VSI gauges but I haven't been able to apply it in model code. Thanks for your time!! :)

Share this post


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

Alright, well I've been playing around with it some more and have a few ideas, but none of them worked as I expected.At first I tried:lail_med :1 0 (L:ailtimer, number) >= if{ (L:dailleft, number) g2 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g1 } :2 (L:ailleft, number) (>L:dailleft, number) 8 (>L:ailtimer, number) Where (L:ailleft, number) is the current animation of another aileron which moves in real time. This gave me some promising results, the aileron was now delayed by a very small fraction of time (My guess is it would be delayed by 1/18th of a second if I understand this stuff right). However, modifying the "8 (>L:ailtimer, seconds)" to "100 (>L:ailtimer, seconds)" did nothing to increase this delay. Not sure why?Anyways, so I then tried the following:lail_med :1 0 (L:ailtimer, number) >= if{ 4 (>L:ailtimer, number) (L:ailleft, number) (>L:dailleft5, number) (L:dailleft1, number) g2 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g1 } :2 0 (L:ailtimer, number) >= if{ 4 (>L:ailtimer, number) (L:ailleft, number) (>L:dailleft1, number) (L:dailleft2, number) g3 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g2 } :3 0 (L:ailtimer, number) >= if{ 4 (>L:ailtimer, number) (L:ailleft, number) (>L:dailleft2, number) (L:dailleft3, number) g4 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g3 } :4 0 (L:ailtimer, number) >= if{ 4 (>L:ailtimer, number) (L:ailleft, number) (>L:dailleft3, number) (L:dailleft4, number) g5 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g4 } :5 0 (L:ailtimer, number) >= if{ 4 (>L:ailtimer, number) (L:ailleft, number) (>L:dailleft4, number) (L:dailleft5, number) g6 } els{ (L:ailtimer, number) -- (>L:ailtimer, number) g5 } :6 I thought that multiplying the first code into 5 steps would increase the delay by a factor of 5. Instead, the aileron now moved without ANY delay at all, which I found weird since I figured that at worst I would still have my 1/18th delay I had prior to this. I haven't tried telling it to "g1" at :6, since I figured this would create some kind of loop and FS would freak out lol. Next I tried this:lail_med :1 (E:Local time, seconds) (L:ailtimer, seconds) >= if{ (L:dailleft, number) g2 } els{ g1 } :2 (L:ailleft, number) (>L:dailleft, number) (E:Local time, seconds) 1 + (>L:ailtimer, seconds) Which I thought would work, but instead it froze the sim solid as soon as I loaded the model. I must've created a loop but I don't know how? I'm obviously missing something. I'm still pretty new to XML so I'm not sure how FS processes the code. I've been assuming it processes the entire code from top to bottom every Nth of a second, but I guess I'm wrong given the strange results.Did I make any mistakes in the code along the way or is my approach wrong? Also, when I assign a value to an L:var, does it remove that value from the stack or does it hang around afterwards? (could explain some of the problems)Thanks in advance!!

Share this post


Link to post
Share on other sites

I've succeeded in producing the effect, I didn't expect to find a solution so soon heh. Thanks anyways, take care all! :)

Share this post


Link to post
Share on other sites