OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Clue on 05 Jun 2004, 20:58:49
-
I'm having trouble getting the fademusic command to work. It plays ok... but then just stops suddenly rather than fading away at the end of my intro cutscene.
The music is defined in the description.ext as follows
class CfgMusic
{
tracks[] = {Music1, Music2, Music3};
class Music1
{
name = "Requiem";
sound[] = {"\music\Mozart1.ogg",db+50,1.0};
};
class Music2
{
name = "AveMaria";
sound[] = {"\music\AveMaria.ogg",db+50,1.0};
};
class Music3
{
name = "Allover";
sound[] = {"\music\Allover.ogg",db+50,1.0};
};
};
My script for the cutscene starts with
playmusic "Music2"
then goes through all the camera moves, and ends like this
4 fademusic 0.0
~4.5
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
enableradio true
showcinemaborder false
clipend = true
exit
I've searched through the forums... and as far as I can tell it should all work fine. But it doesn't... any ideas?
-
hey
I don't think you need to put 0.0 after the fadeMusic command, just put 0.
Hope this helps ;D
sim
-
Thanks for the quick reply sim. :)
I've already tried that and it doesn't make any difference whatsoever! Whether it's 0.0 or just 0, the music still cuts out abruptly. :-\
-
I'm not experienced enough to probably be much help, but maybe the 4.5 sec delay is affecting it. You might not need it, and still get the delay with a fadeout, as in:
1 fademusic 0
titlecut [" ","BLACK OUT", 1]
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
; fade back in over 1 seconds
titlecut [" ","BLACK IN", 1]
enableRadio true
exit
-
Hey
Yea, a long time ago I had this very same prob, but I never got any help. In the end (about a year later) I found that that to be the excact reason why the music cut out (rokkets' idea). So follow his idea & you should be sweet
(O'Neil
-
Still no luck I'm afraid... :-\
The reason the delay was in there in the first place was to give the camera time to black out. Now the end of the description.ext looks like this:
4 fademusic 0
titlecut [" ","BLACK OUT",4]
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
enableradio true
showcinemaborder false
clipend = true
exit
...and it still cuts the music out abruptly, but also blacks out the screen instantly! I have not put in a fade camera in again command before the end because you get a quick glimpse of the player before getting to the briefing page if I do that.
I also tried doing it with triggers. One trigger over the whole area,
activated by anybody,
once
to start the music.
Another trigger acted by
player,
not present,
once,
on activation 4 fademusic 0,
to fade it out again when the player left a certain area.
This didn't work either! :(
I have no idea why this command is giving me so much grief!!!
-
I just tried a test, it worked great several tiems. Music fades, shot fades to black, fades back in from black (no shot of Player in there):
playmusic "track5"
0 fademusic 1
_camera = "camera" camcreate [-64177.43,-52723.59,6.90]
_camera cameraeffect ["internal", "back"]
titlecut [" ", "black in", 4]
_camera camSetTarget ranger1
_camera camSetPos getpos CAM1
_camera camSetFOV 0.7
_camera camCommit 0
@camCommitted _camera
~10
4 fademusic 0
~4
titlecut [" ","BLACK OUT", 5]
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
; fade back in over 1 seconds
titlecut [" ","BLACK IN", 1]
enableRadio true
exit
Maybe you've got a weird OFP bug. Before v1.85 I used to get units placed in odd places, miles from where I'd put them, and sometimes units would ignore their WPs and just follow a bizarre route miles from their WPs
Can you make a test in a new mission folder? Just a short version of script with player and the target unit, and see what happens. It really should work.
-
Hey
Lol, then we can have a competition on the fastest person to come up with a solution ;)
Jks
Anys, try this first man (end part of the script) :
titlecut [" ","BLACK OUT", 5]
~0
4 fademusic 0
titleText [" ", "PLAIN"]
~4
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
; fade back in over 1 seconds
titlecut [" ","BLACK IN", 1]
enableRadio true
exit
If that doesn't work . . . I think I will kill myself ;)
(O'Neil
-
Ok... I think I've got it sorted. :)
The end of the cutscene now looks like this:
6 fademusic 0
titlecut [" ","BLACK OUT", 4]
~6.5
_camera cameraeffect ["terminate", "back"]
camdestroy _camera
enableradio true
showcinemaborder false
clipend = true
exit
...where 'clipend' is the trigger to end the cutscene. It works... but not as well as I'd hoped. It seems the music won't start to fade out until the camera has almost completely faded out, and then the music fades over about 2 seconds rather than 6! I was trying to make the music and picture fade out at the same time... :-\
Thanks for all the help guys, I couldn't have got this far without your suggestions.
:)
-
Heh, nice to see it fixed. :)