OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DEAD RABBIT on 14 Dec 2004, 18:40:01
-
Does somebody know of a mission that uses ambicient soundtracks?
With "ambicient", I mean that a soundtrack will be played according to the situation the player is in. Like when he is hit, a 'heavenly' soundtrack is played.
I am just asking this, wondering if there is some mission that already uses this type of thing. I made a mission using this kind of system (home made scripting) and it totally kicks ass (if you use the right music :afro:)!
-
Shouldn't this go in the cutscene/music section rather than the general section?
-
um, best i can think of is using eventhandlers and conditions. so you have an event handler that goes something like:
player addeventhandler ["killed",{playmusic "heavenlytrack"}]
or
? getdammage player <0.5: playmusic "Runforyourlife"
or something like that... there is a way to count the number of dead using the count command and do something accordingly but the syntax for that escapes me currently ???
-
Yea, I do use eventhandlers like Hit or Fired with some extra conditions. Not Killed, because that somehow can bug the death scene. Though you could customize it completely.
Like:
;;init.sqs
deadteammates = false
? local player : [] exec "deadteammates.sqs"
exit
;;deadteammates.sqs
#start
_size = count units group player
_factor = 0.5
_consize = _factor * _size
@({alive _x} count units group player <= _consize Or not alive player)
if (not alive player) then {exit}
playMusic "deadteammates"
deadteammates = true
~(soundtrack length wait time)
deadteammates = false
goto "start"
The 'deadteammates' condition is used in the other scripts for starting soundtracks to prevent the one soundtrack overlapping the other one without warning. I also use 'fadeMusic' command to enhance the whole.
-
Bored_onion:
2 things:
1) if you are using getdammage, you would want it to be:
?getdammage player > .5
a person at full health has a getdammage of 0
2) ?count units group player < 3:playmusic "We'reFUBAR!!"
-
My Combat Patrol mission (link in signature) does a little bit of this. Basically, I play music when you contact the enemy. If the enemy surprises you, one type of music is played; if you surprise them, another song is played. I also have a custom death sequence, which is always nice. Your teammates cry out when they are killed, and if they die next to you, a little cutscene is played in slo mo.
Unfortunately, not everyone likes music when they are playing though, so it is good to add an option to disable it.
-
a person at full health has a getdammage of 0
it wasnt a question of knowing that, it was a question of typing the right key :P