Home   Help Search Login Register  

Author Topic: Add sound to animation  (Read 1281 times)

0 Members and 2 Guests are viewing this topic.

Offline scud

  • Members
  • *
Add sound to animation
« on: 15 Jan 2004, 21:36:04 »
I have a ramp that opens and shuts and would like to coincide a sound to its movement.

If I use the gun_elevate sound for eg
how and where do I add the script to the cpp file?
 ???
Those that know - say nothing. Those that know nothing - tell all.

Kaliyuga

  • Guest
Re:Add sound to animation
« Reply #1 on: 15 Jan 2004, 21:48:11 »
 Has to be defined like this:
====================================================
class CfgSounds
{
   class ECLDive
    {
         sound[]={"\ECL_KL42o\ECLDive.wav",db+10,1};
         name = "ECLDive";
      titles[] = {};
    };


====================================================
And then your UserActions look somethin like this:

class UserActions
{
class OpenArm1
{
displayName="Dive";
position="osa_arm1";
radius=800.0;
condition="player in this";
statement="this say ""ECLDive""; this animate [""arm1"", .6]";
};

:cheers:

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Add sound to animation
« Reply #2 on: 15 Jan 2004, 21:51:15 »
You define the anim. & make a "User Action" in the cpp file which is basically
those yellow action options that pop up ingame :

 weapon on back
 Get in
 Engine on

 etc.  ::)

Here are the exact details (from some ole configuration)
[you can copy/paste; just change SelectionNames & soundFile paths etc.]


class Animations
{
         class MyAnimation
        {
              type="rotation";
              animPeriod=2;
              selection="MySelection";
              axis="osa_MySelection";
              angle0=0;
              angle1=-1.0;
         };
      };


That was "Class Animations" - and then we have the :o userActions Class:


class UserActions
        {
            class OpenHood1BB
            {
                    displayName="Open Ramp";
                    position="osa_MySelection";
                    radius=2.5;
                    condition="this animationPhase ""MySelection"" < 0.5";
                    statement="this animate [""MySelection"", 1]; this say ""MySound"" ";
            };
        };



Then ya just need 2 define the soundfile aswell  ::) ;D ;D

class CfgSounds
{
   class MySound
   {
      sound[]={"\MyAddon\ActualsoundFile.ogg",db+20,1};
      name = "This is the DisplayName in Triggers";
      titles[] = {};
   };
};


PS. you can use the following sound file formats:


*oggVorbis" (.ogg), WAVE (.wav), and OFP's own ".wss" format.  :-*


later

Offline Tomb

  • Contributing Member
  • **
  • in2 Metal? Go 2 my sig
Re:Add sound to animation
« Reply #3 on: 15 Jan 2004, 21:52:34 »
dammit, kali... get back 2 work!  >:( d'yanno how much time I just spent on that reply?!!
and how LITTLE time you have 'till a >>certain release<< ?!!  :o ::)



 (j/k)
« Last Edit: 15 Jan 2004, 21:53:32 by Tomb »

Offline scud

  • Members
  • *
Re:Add sound to animation
« Reply #4 on: 15 Jan 2004, 22:08:42 »
Thanks for very fast and helpful replies.
 :) :) :)
Those that know - say nothing. Those that know nothing - tell all.