| 03-06-2008, 04:01 PM | #1 |
I had 1 song before that was a Sound variable (not music variable) so it would play in the regular sound channels and i simply had it check-marked to be looping and it would play forever for the player (localplayer) that happened to type "-musicOn". And that worked great.. BUT Now i have added another song! I am having trouble figuring out the best way on how to loop them both back and forth so that it plays track1 then track 2.. then track 1 then track 2.. forever for ONLY the localplayer that happens to turn it on with the -musicon command.. it's a 12 player map and i dont want it spamming other players that dont wish to hear it. |
| 03-06-2008, 04:18 PM | #2 |
How about a countdown timer ? Event -Players types -musicon -Countdown timer2 expires Actions -start coundown timer1 (length of the first song) -play song1 trigger 2 event -countdown timer 1 epxpires action start countdown timer2 play song2 |
| 03-06-2008, 06:15 PM | #3 |
Okay, thanks. thought it might be something like that but I didn't know if there was a smoother more innate & simplier way that the editor handles tracks. |
| 03-07-2008, 07:14 AM | #5 |
Here's a list of functions that I think exist (but not in these words): - Wait until sound finishes - Run trigger So my plan would be to make the songs sound files. It would run in this order: 1. Play song A 2. Wait for song A to finish 3. Play song B 4. Wait for song B to finish 5. Run (this trigger) I'd post it but I have a... lack of World Editor. |
| 03-07-2008, 05:07 PM | #6 |
lol. wow that's a simple way to do it. i shy away from wait states.. think it's okay to use them here? i've grown afraid of them. heh and pyro's method confusing me. i'm still staring it unsure of what all that back and forthing of making things equaling eachother would do. |
| 03-07-2008, 09:08 PM | #7 |
It's running everything through variables and switching them before re-starting the timer. Oh, and I wouldn't use waits. They're very inaccurate and just bad in general if you can use timers instead. |
| 03-08-2008, 06:51 AM | #9 |
That last played sound will be unique to each player, so syncing that sound on a variable wouldn't be a great idea. EDIT! What's wrong with my method? |
| 03-08-2008, 07:40 AM | #10 | ||
Quote:
i dont quite grasp what you mean here. you mean the "udg_MusicLastCreatedTrack[(Player number of (Triggering player))]" variable? where should it be? inside or outside of that localplayer check? Quote:
I'm not sure. just decided on the other guy's cuz im leary of wait states. |
| 03-08-2008, 07:45 AM | #11 |
Ok, what I meant was that each player have the "last played song" registered as something different. If you were to refer to "last played song", it would cause a different event for each player, causing a server split because you're using data from each player to a global variable. It's hard to explain because I know how it works but never told quite... in words how it worked. I figured it out after a few statements before auto-tuning out of it. I think someone else will give a better answer. EDIT! The best comparison I can think of at the moment... say you stored an integer (somehow) using GetLocalPlayer() and then you tried to create a number of units based on that integer. It's going to give a different physical result to each player, causing a desync. |
| 03-08-2008, 07:56 AM | #12 |
so which is causing the desync.. that i set a variable outside of the condition or that i'm stopping that variable inside of it? edit: also, doesn't the array on that variable help to restrict it to the same player? If the localplayer check was compared to the triggering player.. and then i have the variable set to that sound played there to that triggering player.. then shouldn't setting the array on the variable to that same triggering player also restrict it to equal out? |
| 03-08-2008, 08:24 AM | #13 |
Array variables wouldn't help at all... array is just a capability to have multiples of any one variable. The desync is being caused when you're storing the "last played song"... so yes, it is just out of the conditions. |
| 03-08-2008, 09:56 AM | #14 |
Okay, so i need to keep it generalized and not have anything outside of it ever target the "last played sound" when that maybe different outside of the local machine? Here is what i came up with. Is this better? Trigger: Actions
![]() Set MusicBooCheckON[(Player number of (Triggering player))] = True
![]() Countdown Timer - Start MusicTrack_Timer[(Player number of (Triggering player))] as a One-shot timer that will expire in (Length of MusicTrack[MusicTrackNum[(Player number of (Triggering player))]]) seconds |
| 03-08-2008, 10:01 AM | #15 |
That should work as far as I know. I haven't GUI'd in a little bit, but I see no reasons why that would desync. |
