Home   Help Search Login Register  

Author Topic: Continuous Animations - Mini Tutorial  (Read 2724 times)

0 Members and 1 Guest are viewing this topic.

Offline Colonel_Klink

  • Members
  • *
  • Independent Addon Creator
    • DC3D Game Modelling Zone
Continuous Animations - Mini Tutorial
« on: 04 Aug 2003, 10:39:04 »
Now I searched both here and at the Official 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:
Code: [Select]
            
class Radar
{
type="rotation";
animPeriod=0.01;
selection="radar";
axis="osaradar";
angle0=0;
angle1 = 6.283161;
};

The addon init eventhandler:
Code: [Select]
init = [_this select 0] exec "\addonname\radar.sqs";
And the animation code in radar.sqs:

Code: [Select]
_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:




Rebel without a pause...D.I.L.L.I.G.A.F.

Iva

  • Guest
Re:Continuous Animations - Mini Tutorial
« Reply #1 on: 14 Aug 2003, 18:58:46 »
That is very nice idea. i remember when i unpacked your addon  ;D ;D,there was a class named i think something like SAM. So did you tried to make SAm or i am wrong

Josef

  • Guest
Re:Continuous Animations - Mini Tutorial
« Reply #2 on: 08 Oct 2003, 23:16:37 »
Will this be a working radar?

A radar script would be neat...Something that attached a marker to every vehicle...Naturally just for the guys inside to see, the script could be used in CTI too....

Nulear_Man

  • Guest
Re:Continuous Animations - Mini Tutorial
« Reply #3 on: 03 Aug 2004, 05:13:14 »
can i make a Suggestion?
If i can here it is...
 
Code: [Select]
_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

maybe this may work better

Code: [Select]
_radar1= _this select 0
_posradar = 0

?(not alive _radar1):goto "exit"

#loop
_radar1 animate ["radar",_posRadar]
_posradar= _posradar + 0.01
~0.01
?(_posradar >= 1): _posradar = 0
?(not alive _radar1):exit
goto "loop"

Offline Peter_Bullet

  • Members
  • *
  • "The evil that men do lives on and on"
Re:Continuous Animations - Mini Tutorial
« Reply #4 on: 11 Aug 2004, 11:27:38 »
Complicated.... Bresseb had an easier way.... just put this in the config:

class eventhandlers
{
init="(_this select 0) animate [""ani_radarDome"", 1]";
};

this will animate the Dome in the beginning...

Then put some huge numbers in to the animation field in the angle and time, like this:

   class ani_radarDome
   {
      angle0=0;
      angle1="-20000 * 3.141592654";
      type="rotation";
      animPeriod=100000;            selection="radar_dome";
      axis="radar_dome_axis";
      };

This way the dome will rotate for hours... (Saving game might srew this up, I haven't tried...  :-[ )

sidhellfire

  • Guest
Re:Continuous Animations - Mini Tutorial
« Reply #5 on: 25 Aug 2004, 17:12:10 »
Welcome,
accoding to similar situation i wanted to ask about help in problem. Noone seems to know answer.

here's the description of problem:

http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=e0f24a32bbd87677e66fb0a15ed34322;act=ST;f=3;t=41857

i'll addd screenshot - all i want is to make this soldier to don't stop after he'll make two steps included in animation.
« Last Edit: 25 Aug 2004, 17:26:27 by sidhellfire »

bdfy1

  • Guest
Re:Continuous Animations - Mini Tutorial
« Reply #6 on: 02 Apr 2005, 13:44:10 »
Colonel_Klink
Where Can I find your addon ? IS there new beta or something available ?

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Continuous Animations - Mini Tutorial
« Reply #7 on: 25 May 2005, 19:22:03 »
This thread is now being unstuck, information from this thread has been submitted to the Editors Depot in the form of a document.

Link is Here

Planck
I know a little about a lot, and a lot about a little.