OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: OFPfreak on 26 Jun 2005, 00:47:46

Title: scripts activating sounds!
Post by: OFPfreak on 26 Jun 2005, 00:47:46
Thanks to the 3 people that helped me solve the nitro script, I was just wondering if it is possible to make a sound play, activated by a trigger?

Every nitro bottle=10 seconds
This sound is=10 seconds
I could put it at the start of the script so it sounds accurate.
The only problem is, can I activate it in a script?
Title: Re:scripts activating sounds!
Post by: DBR_ONIX on 26 Jun 2005, 01:37:46
Aren't you better of using..
_car say "nitroSound"
or,
this say "nitroSound"

..in a script?
For a trigger to do this, you'd put
Actiavation : Anyone
Condition : nitroSound
On Activation : car1 say "nitroSound"; nitroSound=false

Then to trigger it, nitroSound=true

Bit messy..
- Ben
Title: Re:scripts activating sounds!
Post by: OFPfreak on 26 Jun 2005, 02:02:07
I don't get that. I don't want my car to say the word NitroSound I want to make a real sound effect of nitro being used. I got the sound but I want it to be activated. Is there anyway?

@DBR_ONIX

Altough, It's almost what I want, can you make it so that if it says that, it executes a trigger?
e.g.


in the script:

car1 say "nitrous bottle 1 activated"

in the trigger:

condition: car1 say "nitrous bottle 1 activated"
on activation: *blank*


and in the effect section of the trigger I play the sound. Is this possible?
Title: Re:scripts activating sounds!
Post by: General Barron on 26 Jun 2005, 08:16:27
It is possible to play sounds thru scripting commands, in addition to playing them thru the 'effects' menu of triggers, via the "say", "playsound", and "playmusic" commands. Check bloodmixer's sound tute in the ed depot for more info.
Title: Re:scripts activating sounds!
Post by: OFPfreak on 26 Jun 2005, 08:53:16
ive searched for it but cant find it in any place.
Title: Re:scripts activating sounds!
Post by: 456820 on 26 Jun 2005, 09:04:17
Quote
I don't get that. I don't want my car to say the word NitroSound I want to make a real sound effect of nitro being used. I got the sound but I want it to be activated. Is there anyway?


you need the play sound command like this

playsound "Nitro_sound"

that will just play the sound called nitro_sound
theres something ive noticed with the say command that you cant use the radio until the sound has stopped
Title: Re:scripts activating sounds!
Post by: OFPfreak on 26 Jun 2005, 09:32:39
thanks. Its so simple. No one else sayed it :S! Propably because I didn't tell enough detail. Sorry guys!
Title: Re:scripts activating sounds!
Post by: General Barron on 26 Jun 2005, 09:48:10
Playsound command (http://www.ofpec.com/editors/comref.php?letter=P#playSound)
Playmusic command (http://www.ofpec.com/editors/comref.php?letter=P#playMusic)
Say command (http://www.ofpec.com/editors/comref.php?letter=S#say)
   (online commands reference) (http://www.ofpec.com/editors/comref.php)

Sound tutorials (http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=1&category=1_2&subcategory=1_2&numreturn=25&displayformat=0&ofpv=1&searchstring=sound&searchwhat=1&searchlevel=0&searchopts=)
   (Editor's depot search page) (http://www.ofpec.com/editors/browse.php?searchopts=1)