Rambo-16AAB 0 Posted January 11, 2008 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
ANZACSAS Steven 396 Posted January 12, 2008 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 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 If you run into any problems PM me and I'll see if i can help ya's some more. Share this post Link to post Share on other sites
Rambo-16AAB 0 Posted January 12, 2008 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
ANZACSAS Steven 396 Posted January 12, 2008 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 Share this post Link to post Share on other sites
Rambo-16AAB 0 Posted January 12, 2008 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
ANZACSAS Steven 396 Posted January 12, 2008 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