OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: DEAD RABBIT on 14 Dec 2004, 18:40:01

Title: Ambicient music
Post 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:)!
Title: Re:Ambicient music
Post by: djackl on 14 Dec 2004, 18:45:00
Shouldn't this go in the cutscene/music section rather than the general section?
Title: Re:Ambicient music
Post by: bored_onion on 14 Dec 2004, 19:40:12
um, best i can think of is using eventhandlers and conditions. so you have an event handler that goes something like:

Code: [Select]
player addeventhandler ["killed",{playmusic "heavenlytrack"}]
or

Code: [Select]
? 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 ???
Title: Re:Ambicient music
Post by: DEAD RABBIT on 14 Dec 2004, 20:01:10
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:

Code: [Select]
;;init.sqs

deadteammates = false

? local player : [] exec "deadteammates.sqs"

exit


Code: [Select]
;;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.
Title: Re:Ambicient music
Post by: Triggerhappy on 14 Dec 2004, 22:23:56
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!!"
Title: Re:Ambicient music
Post by: General Barron on 15 Dec 2004, 03:33:10
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.

Title: Re:Ambicient music
Post by: bored_onion on 15 Dec 2004, 19:03:47
Code: [Select]
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