home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


A music glitch o_o'

by Max of S2D [Fr] on 02/06/2007 12:41, 7 messages, last message: 02/07/2007 14:54, 922 views, last view: 04/13/2024 21:28

I've posted this question many times in the general thread, then in the mapping thread, but nobody answered.

So here's the bug report...

Imagine. You built a map, with a personal music.

Into CFG :

/music folder/music.ogg

In the previous versions of Sauerbraten, the music was playing again and again, when it was finished.

Now, in GUI Edition, THE MUSIC DOES NOT LOOP.

A glitch which will be fixed in later release ?

Thanks,
Max of S2D

   Board Index   

#1: RTFM

by MeatROme on 02/06/2007 12:59

It is advisable to regularly skim and/or re-read the documentation ... for engine changes pertaining to your commands.
Music now takes a secondary argument for what happens after the song finishes.
See the playasong alias in data/default_map_settings.cfg for an example usage.

If you followed the forum I /did/ post some source on this a couple of days back for marcpullen ...

reply to this message

#2: ..

by Max of S2D [Fr] on 02/06/2007 13:11

So it's no RTFM now, it's RTFMA :D

Thanks MeatROme, i'm going to watch and maybe post again if i don't understand.

reply to this message

#3: ..

by Max of S2D [Fr] on 02/06/2007 13:24

Uh yeah, MeatROme, i do not really understand.

Can you explain those lines in detail ?

playasong = [ music (concatword "fanatic/" (+ 1 (rnd 23)) ".ogg") playasong ]
playasong


If i have :

sauercube/demoniac.mid

which is about 2:30 long, what should i do ?

reply to this message

#4: Re: ..

by Pxtl on 02/06/2007 20:07, refers to #3

First, some programming explanation: playasong is a function fanatic is defining. "music" takes two arguments - the song name, and the continuation function.

(concatword "fanatic/" (+ 1 (rnd 23)) ".ogg")

is just building that song name - it randomly picks a number from 1 to 23, and adds it to the filename, so it randomly generates "fanatic/12.ogg" - which is the path and name of one of Fanatic's songs. You do the same if you want your songs done randomly.

Finally, it uses "playasong" - which is the name of the function we just defined. So what happens is

On the next line, it calls playasong.

So, playasong defines a function that plays a random Fanatic song and then, when the music is done, calls playasong (thus, playing another, different random Fanatic song).

For your, simpler purpose of looping a single song, you want

myplaysongfunc = [music "sauercube/demoniac.mid" myplaysongfunc]
myplaysongfunc

reply to this message

#5: This is actually a bug...

by eihrul on 02/06/2007 20:11

"/music foo" should still be looping the song indefinitely, but SDL mixer somehow says the song is "finished" in between the time it gets ready to replay the song, so our code screws up and stops playing it.

You can WORK AROUND it by doing what the people above are saying, but please note that you are right that it is a bug, and it will be fixed by next release.

reply to this message

#6: Re: This is actually a bug...

by MeatROme on 02/06/2007 20:54, refers to #5

thanks for clearing this up!

reply to this message

#7: Re: This is actually a bug...

by Max of S2D [Fr] on 02/07/2007 14:54, refers to #5

Yeah, thanks Eihrul =D

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53864660 visitors requested 71639804 pages
page created in 0.017 seconds using 10 queries
hosted by Boost Digital