colonel_klink 0 Posted August 4, 2003 Now I searched both here and at the OFPEC Forums and couldn't find any thing to create a continuous animation for the radar on the blockhouse that i am currently refurbishing while recovering from a sickness (just attacking the simpler addons these days ) Anyway here goes: If people can remember the old radar station I made eons ago.. which was an ambitious project using tank classes to get the animated radar antenna and screen to work.. Once 1.91 came out I have been asked if I was going to update the addon. Well I thought I might, and also make the addon more user friendly in both editor and in map making. The animation is made continuous using the following code: In your config.cpp Class Animations: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Radar { type="rotation"; animPeriod=0.01; selection="radar"; axis="osaradar"; angle0=0; angle1 = 6.283161; }; The addon init eventhandler: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">init = [_this select 0] exec "\addonname\radar.sqs"; And the animation code in radar.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _radar1= _this select 0 #Reset _PosRadar =0 _radar1 animate ["radar", 0] ?(not alive _radar1):goto "exit" #loop ~0.01 _posradar= _posradar + 0.010 _radar1 animate ["radar",_PosRadar] ?(_posradar<=0.99): goto "loop" goto "reset" #Exit exit The above gives a nice steady rotation which doesn't reverse rotate, and continues until the radar is dead. And a piccy: Share this post Link to post Share on other sites
Guest Posted August 4, 2003 And we can download it from....? Share this post Link to post Share on other sites
rouge1 0 Posted August 4, 2003 Here you are Leone (Old Version) Download Link  Share this post Link to post Share on other sites
PSC 0 Posted August 4, 2003 Nice! If I update the dune buggy I'll try to animate the fan of the engine like this. PSC Share this post Link to post Share on other sites
Guest Posted August 4, 2003 Wooot! Ta Red, and thx Col Share this post Link to post Share on other sites
colonel_klink 0 Posted August 4, 2003 The newer version will be uploaded soon. Share this post Link to post Share on other sites
Bullz_eye_on_my_back 0 Posted August 4, 2003 This method has a ton of uses!!! If you ever have a car or vehicle with more wheels than allowed you could make them all move this way! Even set them up for the spinning to corrolate with the speed!! Samething with propellers and ...whew what ever needs to spin wooo hooo!! I can't wait untill everyone utilizes animations in all the new addons coming out wtg Colonel Share this post Link to post Share on other sites
BraTTy 0 Posted August 4, 2003 The towable Pak that I helped Vibes with has continous animation on the wheels and I stated that when it came out. The model is unbinarized WW2 Corsair F4U also has continous animated wheels Share this post Link to post Share on other sites
colonel_klink 0 Posted August 4, 2003 The towable Pak that I helped Vibes with has continous animation on the wheels and I stated that when it came out.The model is unbinarized WW2 Corsair F4U also has continous animated wheels Bratty. Do you want to add the code here. I've been scratching my head how to get the speed to work with the animations. Cheers Klinkster Share this post Link to post Share on other sites
AirwolfPL 0 Posted August 5, 2003 Similar (but IMHO better a little) method was featured in this tutorial: http://ofp.gamezone.cz/_hosted/brsseb/tutorials/lesson9/lesson9_a.htm Yet another method is to define building as tank and use 'radar' gauge for such continuous rotation... Anyways, both methods are AFAIK useles when you want to use such building from the WRPEdit - animation will start only if triggered by user's action (when first method is used), there is no way to perform animation via event handler etc Share this post Link to post Share on other sites
colonel_klink 0 Posted August 5, 2003 Similar (but IMHO better a little) method was featured in this tutorial:http://ofp.gamezone.cz/_hosted/brsseb/tutorials/lesson9/lesson9_a.htm Yet another method is to define building as tank and use 'radar' gauge for such continuous rotation... Anyways, both methods are AFAIK useles when you want to use such building from the WRPEdit - animation will start only if triggered by user's action (when first method is used), there is no way to perform animation via event handler etc The original radar I made used several models in one addon which included 2 tanks. This made the addon clumsy in the editor. Then I used a different method similar to Brssebs but I still wanted a constant animation that would loop, hence the explanation above. The addons can be placed on a map and animated, however the downside (at the moment) is that the script must be placed in the mission and called from with in the mission. Hopefully there will be a way around this by getting animations to work from within the Island config. I have tried calling the animation script from an island config but until now no luck.. Back to the drawing board i guess. Share this post Link to post Share on other sites
BraTTy 0 Posted August 5, 2003 The towable Pak that I helped Vibes with has continous animation on the wheels and I stated that when it came out.The model is unbinarized WW2 Corsair F4U also has continous animated wheels Bratty. Do you want to add the code here. I've been scratching my head how to get the speed to work with the animations. Cheers Klinkster Sure ..here's from the Corsair's wheels.sqs #cycle _aphase = _aphase + ((speed _plane) /350) _plane animate ["corwheels", _aphase] ? _aphase >= 1 : _aphase = 0 ~.01 goto "cycle" I took out some irrelevant stuff The towable Pak uses the same method to continous animate the wheels depending on the vehicles speed using this line: _aphase + ((speed _plane) /350) You may want to change the ratio some depending on the speed of the vehicle (a vehicle faster than 350kph will want a higher ratio) _aphase + ((speed _plane) /450) So that the figure never results in a "1" or higher than a "1" The towable Pak is unbinarized ,the Corsair is binarized for size ,the unbinarized files are available , just I don't have a host Both addons have continous variable animated wheels Another thing to remember is that animations are global and won't need to be called from each machine in a mp game, unfortunately the method that is used on the planes have some hidden selections and thats another story, as the fake unretracting wheels needs some texture juggling Share this post Link to post Share on other sites
colonel_klink 0 Posted August 6, 2003 Thanks ,Bratty that has helpd a lot. Cheers Klink Share this post Link to post Share on other sites