Zeta Flow
http://zetaflow.skylogic.ca/forum/

Background music "addon"
http://zetaflow.skylogic.ca/forum/viewtopic.php?f=5&t=336
Page 1 of 2

Author:  Mouzi [ Sun Feb 21, 2010 9:39 am ]
Post subject:  Background music "addon"

This is a user-script I made for the Greasemonkey Add-on on Mozilla Firefox to play background music on levels.
The music will work for anyone playing the level if they have the user-script (and have no problems with YouTube).

Requirements:
Mozilla Firefox
Greasemonkey Add-on

If you already have these then you can click here and install the user-script.

The script allows you to add music from YouTube as the background music of your level.
You only need to specify it in your AI code. An example level can be found here. (The music will only work if you have the user-script.)

The syntax is as follows:
Code:
bgMusic, startingMinutes, startingSeconds, endingMinutes, endingSeconds, volume (0 - 100), youtubeID

Example:
Code:
randomRotate
bgMusic,0,2,3,55,100,YOUTUBEID
randomWaypoints
rotatePart,0,10

The code will play the video specified in youtubeID from 0:02 to 3:55 and then loop. It will also set the volume to 100.

You can get the YouTube ID from the url for example in
youtube.com/watch?v=9SbGP4TlwAQ
The ID would be 9SbGP4TlwAQ. (Only include the ID even if there would be parameters after it eg. &fmt=18 or &feature=related)

If you find any bugs let me know :P

Author:  asdasdg [ Sun Feb 21, 2010 11:09 am ]
Post subject:  Re: Background music "addon"

Does it only work on firefox?

Author:  Mouzi [ Sun Feb 21, 2010 12:01 pm ]
Post subject:  Re: Background music "addon"

Yeah :P I know, I know, FF sucks but it was the easiest one for me.
Other browsers support user-scripts too but you'd have to rewrite it and fix browser specific problems.

Author:  Fruktfisk [ Sun Feb 21, 2010 12:58 pm ]
Post subject:  Re: Background music "addon"

This is awesome, I already use Firefox with GM, so this went fairly quick.
I should do a level for this sometime soon.

btw, Firefox might not be the best browser, but it is so customizable that I can get it to look the way I want it to, which in my opinion makes it awesome. :D

Author:  Mouzi [ Sun Feb 21, 2010 1:17 pm ]
Post subject:  Re: Background music "addon"

I hope this doesn't turn into Browser Wars™ but anyway I too liked Firefox for a long time and I'm still using it because I couldn't live without the extensions. The best thing about Firefox is also the worst thing. All the extensions make it a bit buggy and slow at least for me (it's not the fastest even without the extensions) so I'm also using Chrome on the side sometimes. [/offtopic]

Glad you liked it Fruktfisk :P

Author:  Zeke [ Sun Feb 21, 2010 7:37 pm ]
Post subject:  Re: Background music "addon"

The install is painless and it worked great. Now please write one for IE :-)

Author:  NARFNra [ Sun Feb 21, 2010 11:07 pm ]
Post subject:  Re: Background music "addon"

It seems totally impossible to transplant this into Seamonkey...

Shame really, as it works in Iceweasel, which JUST SO HAPPENS to completely fail at using Zeta Flow.

I swear the world is conspiring against me...

Author:  Mouzi [ Mon Feb 22, 2010 2:10 am ]
Post subject:  Re: Background music "addon"

I guess I'll have to look into making different versions of this then.

Author:  NARFNra [ Mon Feb 22, 2010 2:15 am ]
Post subject:  Re: Background music "addon"

Can anybody hear music in this?
http://zetaflow.skylogic.ca/game/profile/12294

Author:  Mouzi [ Mon Feb 22, 2010 2:39 am ]
Post subject:  Re: Background music "addon"

Works for me.

Author:  Zeke [ Mon Feb 22, 2010 4:29 am ]
Post subject:  Re: Background music "addon"

NARF - Your level worked for me too. Yours differed from Mouzi's example, in that the music started as soon as I clicked the joystick icon and went to the level title page. Whereas Mouzi's music doesn't begin until a few seconds after level play starts.

There also seemed to be a difference of about 1 FPS. It would appear that the music file size has an impact.

Author:  Mouzi [ Mon Feb 22, 2010 10:05 am ]
Post subject:  Re: Background music "addon"

I noticed a small mistake there. It said background music loading even if there is no bgmusic. Fixed the code now, so update if you have it installed.

Author:  Zeke [ Mon Feb 22, 2010 10:11 am ]
Post subject:  Re: Background music "addon"

Mouzi - Do I have to uninstall and then reinstall? Pardon my ignorance, but I rarely use FF and this is the first add-on I've ever installed.

Author:  Mouzi [ Mon Feb 22, 2010 11:22 am ]
Post subject:  Re: Background music "addon"

You can just click the link again and reinstall. It replaces the old one.

Author:  asdasdg [ Sun Mar 14, 2010 6:11 pm ]
Post subject:  Re: Background music "addon"

Even though I don't have the software required, I have put music in a few of my levels.
Most recent example is the chaleng enhanced. Enjoy! :)

Page 1 of 2 All times are UTC - 8 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/