i put [for example] 2 songs into a mission and i want one of them to start at the beginning of each gameplay like a kind of intro song. the main point is that i want the mission to randomly select which one to play, so maybe at the briefing screen players can have bettings whether we'll hear some DUMDUMDUMDUM or something by pavarotti ;D [that's not my goal to make gambling out of ofp of course], so random music.
The "official method" to select random from an array is like this:
_myArr select ((random count _myArr)-0.5)
So for example to play music:
playMusic (["Track1", "Track2", "Track3"] select ((random 3)-0.5))
Using a randomly placed unit is okay for MP though, because it will be synced automatically. No need to publicVariable it to have same song on each client.
Chris Johnson
06-06-2009, 04:35 PM
(05-23-2009, 11:38 PM)Ferenczi link Wrote:i was thinking about something like:
i put [for example] 2 songs into a mission and i want one of them to start at the beginning of each gameplay like a kind of intro song. the main point is that i want the mission to randomly select which one to play, so maybe at the briefing screen players can have bettings whether we'll hear some DUMDUMDUMDUM or something by pavarotti ;D [that's not my goal to make gambling out of ofp of course], so random music.
any idea?
Let me guess - You are going to put HEADUNTERZ there? ;D