OFPEC Forum
Addons & Mods Depot => OFP - Addons & Mods General => Topic started by: scud 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?
???
-
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:
-
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
-
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)
-
Thanks for very fast and helpful replies.
:) :) :)