OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: penguinman on 18 Jul 2006, 00:40:42

Title: One man charge yell
Post by: penguinman on 18 Jul 2006, 00:40:42
I am making some kind of one man charges from the enemy that occur durring the mission where an enemy comes out of the bushes and charges the players position, problem is, I have them yelling,(like ahhhhhhhhhhhhhhhhhhhhh!) when they charge, they are almost always cut down by one of the players teammates before they get to close but after they die, the yelling sound continues, how do I end the yelling abrptly right as the soldier is shot.

thanks 
Title: Re: One man charge yell
Post by: Cheetah on 18 Jul 2006, 08:52:35
Check in a loop if the soldiers is still alive, if he's toasted, end the sound. But I don't know how to properly stop the sound, fadeSound isn't a good solution if you ask me.
Title: Re: One man charge yell
Post by: penguinman on 18 Jul 2006, 17:53:00
yeah thats the problem i know
Title: Re: One man charge yell
Post by: Raptorsaurus on 18 Jul 2006, 23:20:37
Make the sound shorter (like about .25 seconds) then run the sound in a loop like this:

Code: [Select]
_charger = _this select 0

;this will make the charger scream for 5 seconds
_tmlim = _time + 5

#loop
? alive _charger : _charger say "scream"
~ .25
? _time < _tmlim && alive _charger : goto "loop"
exit

"scream" is the name of the sound, change it to whatever you want to name your sound.
_charger is the dude who is charging out of the bushes. Make him run this script by puting this in the trigger or waypoint or whatever you are using to signal him to attack:

Code: [Select]
[dude] exec "scream.sqs"

Dude is the editor name for the attacking man, make it whatever name you want. Also you can name the script something other than "scream".

Good luck.
Title: Re: One man charge yell
Post by: penguinman on 19 Jul 2006, 03:39:27
haha, rapto that sounds so funny. it sounds like a screaming MG.
but it is not sutable, is there aanother way to do this besides editing the sound, maby a comand that can end it?




By the way raptosaurus: I PMed you but you havent responded,
please send me the Planes in valley by email
Title: Re: One man charge yell
Post by: MrN on 19 Jul 2006, 12:27:49
IIRC when another sound is played the first sound will be stopped. Although I can't test it because my main box had a HDD failure so I could be wrong.

So, try adding a killed eventhandler and say either a silent ogg to stop the sound or find a groan/grunt sort of sound that'll end the screaming charge.

Title: Re: One man charge yell
Post by: Mr.Peanut on 19 Jul 2006, 15:20:16
Um, my experience is that sounds using the say command get fifo(First In First Out) queued. If the sound file is long, it will play itself out, nothing you can do about it. If a unit is told to say several sounds in succession without a pause between them, each sound will eventually play in turn.  Solution, make sure your pauses between say commands are slightly longer than the sounds themselves. The say command will not work one a unit once it is dead, but all say commands issued before the unit is dead will still be played.

If you want to make a dead man speak, however, setPos a game logic to his position and make it say the sound. I discovered this when trying to make a dead man fart.
Title: Re: One man charge yell
Post by: The-Architect on 19 Jul 2006, 16:59:56
Config the yell as a music file instead of a sound file. Then FadeMusic.
Or cut the sound into sections and script each like 0.5 secs to have a check after it.