|
Post by commended on Aug 15, 2016 12:04:04 GMT
Hi all, In my open-world game their are several radio station all as an individual set of song's to play. I want the player to be able to switch between them, which so far seems easy enough, just make multiple Event On Inputs stopping the other tracks and starting the new one, however each station has about a 20 minute cycle, so I don't want to have it so you start them all the same, I was wondering if it was possible to temporarily mute a track and un-muting the other one to create the illusion of a real time radio station? Thanks in advance
|
|
|
Post by Famer on Aug 15, 2016 12:40:17 GMT
Did you mean the pause and play type?
|
|
|
Post by Power Supersport on Aug 15, 2016 14:42:16 GMT
If you know scripting this is relatively easy... Let me give you the necessary help...
I will use examples during the tutorial... You can change those later, but let's say that you have 5 radio stations...
When you chose a certain radio station, you want the other ones to shut up, but continue playing in the background... How simple is that? You just need to lower their volume to 0...
Let's go in scripting...
int radioCount = 5; int currentRadio; int [] radioVolume(5);
float globalVolume = 1;
void Main () {
for (int i = 0; i < radioCount; i++) { if (i == currentRadio) radioVolume [i] = 1; else radioVolume [i] = 0; }
OUT_1 = radioVolume [0] * globalVolume; OUT_23 = radioVolume [1] * globalVolume; OUT_45 = radioVolume [2] * globalVolume; OUT_67 = radioVolume [3] * globalVolume; OUT_89 = radioVolume [4] * globalVolume; } The things that you have to edit here are the outputs (if you have more or less radios than 5) and the values before the Main ()...
The FOR cycle is automatic and you don't need to do anything there... The globalVolume float allows you to lower the volume of the current radio station (like a player customization)...
And also, you need to make sure how you will set the currentRadio integer...
|
|