Jump to content
Sign in to follow this  
Rambo-16AAB

Custom vehicle startup/shoutdown sounds

Recommended Posts

Can someone give me an example of code for using a custom engine startup /shutdown sound for a vehicle.

thanks.

Share this post


Link to post
Share on other sites

Hi m8,

Try this

class eventhandlers

{

engine = "if ((_this select 1)) then {_this exec ""\YourAddonFolder\startsound.sqs""};";

};

This should work,i was playn around yesterday with em too tounge2.gif

I cant post the script that it executes cos i didnt write it and i dont wanna offend anyone.Armo could prolly help with that one smile_o.gif

If you run into any problems PM me and I'll see if i can help ya's some more. smile_o.gif

Share this post


Link to post
Share on other sites

Thanks Steve.

Armo isworking on a different part of the project this is for so I dont want to overburdon him ( hes allowed 2 hrs sleep a week and I dont want to deprive him of that ).

Share this post


Link to post
Share on other sites

hi m8,

Try this , it's from an old OFP chopper from years ago.

_plane2 = _this select 0

_pos = GetPos _plane2;

_x = _pos select 0;

_y = _pos select 1;

_z = _pos select 2;

?(speed _plane2 >=0 and _z>=10): goto "exit"

?(speed _plane2 <=0 and _z<=1):goto "startup";

#startup

playsound "startup2";

exit

#exit

exit

This is an .sqs file

biggrin_o.gif

Share this post


Link to post
Share on other sites

Ok when I use :- playsound "startup2";

with the format playsound "\addonname\sound\soundfile.wav";

I get a file not found error when the script tries to execute the soundfile.

Share this post


Link to post
Share on other sites

You'll have to make a cfg entry into to the addon 's cfg in question.

Try this-

class CfgSounds

{

class BritkitCH47startupsound

{

  sound[]={"\YourAddon\startupsound.wav",db+8,1.0};

  name = "BritkitCH47startupsound";

titles[] = {};

};

};

Btw, when naming a sound for the cfg try to name it uniquely so as not to conflict in the future with other addons that may have been named too simple/common.

Hence the odd looking name - BritkitCH47startupsound

Also if renamed to "BritkitCH47startupsound", change the script that calls "startup2" soundfile to "BritkitCH47startupsound" aswell.

They have to match.

All in all were just introducing a sound ,naming it in the cfg so the game now knows about it and then of course we just call it.

These sounds will show up in the editor under sounds in the triggers part.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×