Crazy MP3 player idea

For the bits and bobs created by Fester's Place members
User avatar
AngryWolf
Posts: 1244
Joined: Sun Oct 19, 2008 6:09 pm
Contact:

Crazy MP3 player idea

Post by AngryWolf » Sat Feb 07, 2009 4:51 am

I've got this idea that I could add a cheap MP3 player support to TF2 by scripting. It currently works like this: create a [GAME]\tf\sound\mp3 directory and copy exactly 10 of your favorite songs there named in the following scheme: 1.mp3, 2.mp3, ..., 10.mp3. Then with the script below, you'll be able to switch forth and back between the songs by pressing F6 and F7, in addition, F8 starts and stops the current song.

The code is like this:

Code: Select all

// ************* ALIASES ***************

alias mp3_next "mp3_1"
alias mp3_prev "mp3_10"

alias mp3_1  "play mp3/1.mp3;  alias mp3_next mp3_2;  alias mp3_prev mp3_10; alias mp3_stopstart mp3_stop"
alias mp3_2  "play mp3/2.mp3;  alias mp3_next mp3_3;  alias mp3_prev mp3_1; alias mp3_stopstart mp3_stop"
alias mp3_3  "play mp3/3.mp3;  alias mp3_next mp3_4;  alias mp3_prev mp3_2; alias mp3_stopstart mp3_stop"
alias mp3_4  "play mp3/4.mp3;  alias mp3_next mp3_5;  alias mp3_prev mp3_3; alias mp3_stopstart mp3_stop"
alias mp3_5  "play mp3/5.mp3;  alias mp3_next mp3_6;  alias mp3_prev mp3_4; alias mp3_stopstart mp3_stop"
alias mp3_6  "play mp3/6.mp3;  alias mp3_next mp3_7;  alias mp3_prev mp3_5; alias mp3_stopstart mp3_stop"
alias mp3_7  "play mp3/7.mp3;  alias mp3_next mp3_8;  alias mp3_prev mp3_6; alias mp3_stopstart mp3_stop"
alias mp3_8  "play mp3/8.mp3;  alias mp3_next mp3_9;  alias mp3_prev mp3_7; alias mp3_stopstart mp3_stop"
alias mp3_9  "play mp3/9.mp3;  alias mp3_next mp3_10; alias mp3_prev mp3_8; alias mp3_stopstart mp3_stop"
alias mp3_10 "play mp3/10.mp3; alias mp3_next mp3_1;  alias mp3_prev mp3_9; alias mp3_stopstart mp3_stop"

alias mp3_stopstart "mp3_stop"
alias mp3_stop "play nothing; alias mp3_stopstart mp3_start"
alias mp3_start "mp3_next; mp3_prev"

// ********** CONFIGURATION ************

bind f6 "mp3_next"
bind f7 "mp3_prev"
bind f8 "mp3_stopstart"

// ****** PRECACHE SOUND FILES *********

play mp3/1.mp3
play mp3/2.mp3
play mp3/3.mp3
play mp3/4.mp3
play mp3/5.mp3
play mp3/6.mp3
play mp3/7.mp3
play mp3/8.mp3
play mp3/9.mp3
play mp3/10.mp3
play nothing
You paste this stuff into an empty file called mp3player.cfg in your [GAME]\tf\cfg directory and then write exec mp3player into your autoexec.cfg.

Unfortunately I have problems with the script:

1. Limited coding abilities (the number of songs is not changable dinamically).

2. Does not support voice (if you enable voice in the game, you can expect multiple songs to be played simultaenously or simply crashes your client). Which sucks.

3. Precaching is necessary, otherwise you can expect "file not found" errors when you're connected to a server. However it could still not work for 10.mp3, as I happened to run into that kind of bug once, and I have no clue why...

So I'm not sure if I should develop this script any further. Maybe I should just play MP3 files on my cell phone using an earphone and at the same time put a headset on so I can also play TF2. :)

Any help welcomed.

Edit: fixed typos
Last edited by AngryWolf on Sat Feb 07, 2009 3:28 pm, edited 3 times in total.
Image

User avatar
Johnimus Prime
Posts: 2915
Joined: Wed Mar 26, 2008 11:30 pm
What is 3hirty p1us 4orty?: 70
Location: Cheshire

Re: Crazy MP3 player idea

Post by Johnimus Prime » Sat Feb 07, 2009 7:59 pm

Might be useful for the admins to play sounds with. Not so with song's though for legal reasons. Genetix can probbably tell you about that.
"Quit your whinging, lets start binging'"

Image

User avatar
DragoonKnight
Posts: 3679
Joined: Wed Jun 25, 2008 6:38 pm
What is 3hirty p1us 4orty?: 4
Location: In the shadows, waiting persistently for the right moment to strike...

Re: Crazy MP3 player idea

Post by DragoonKnight » Sat Feb 07, 2009 8:58 pm

and maybe have f10 for the stop button :lol:
Dare you to enter the Festertrix? Home of the slow motion Weed!
ImageImageImage

User avatar
indivisible
Posts: 811
Joined: Mon Jan 12, 2009 6:26 pm
What is 3hirty p1us 4orty?: 4
Location: 127.0.0.1

Re: Crazy MP3 player idea

Post by indivisible » Sat Feb 07, 2009 10:10 pm

What's all this F10 lark? I've heard it mentioned a few times in relation to hacks.
Image
Cheers BBloke! You're the grease that oils the cogs of Festers!
Props to Cali for all his ETF2L organisation skills!!

User avatar
Advent
Posts: 2478
Joined: Fri Apr 11, 2008 12:04 am
What is 3hirty p1us 4orty?: 4
Location: Dublin

Re: Crazy MP3 player idea

Post by Advent » Sat Feb 07, 2009 10:13 pm

It quits :)
Image

"Advent retreats forward" - Supernova

User avatar
indivisible
Posts: 811
Joined: Mon Jan 12, 2009 6:26 pm
What is 3hirty p1us 4orty?: 4
Location: 127.0.0.1

Re: Crazy MP3 player idea

Post by indivisible » Sat Feb 07, 2009 10:18 pm

Ah, [bind F10 quit] kind of way??

I changed mine to disconnect and F12 for quit.
Image
Cheers BBloke! You're the grease that oils the cogs of Festers!
Props to Cali for all his ETF2L organisation skills!!

User avatar
Johnimus Prime
Posts: 2915
Joined: Wed Mar 26, 2008 11:30 pm
What is 3hirty p1us 4orty?: 70
Location: Cheshire

Re: Crazy MP3 player idea

Post by Johnimus Prime » Sun Feb 08, 2009 1:01 am

Advent wrote:It quits :)
Your a liar! It's a direct link to loads free money and stuff. Press it, you know you want to
"Quit your whinging, lets start binging'"

Image

User avatar
Fester
Posts: 6528
Joined: Thu Mar 13, 2008 6:47 pm
What is 3hirty p1us 4orty?: 4
Location: Right Here!
Contact:

Re: Crazy MP3 player idea

Post by Fester » Sun Feb 08, 2009 9:00 pm

real nice work Angry thats a nice little toy for the music lovers.. i must get a section together for these little ideas tips and tricks for the game or game settings..
Image

User avatar
Llama@bad
Posts: 822
Joined: Sat Jul 12, 2008 1:37 am
Location: Frankfurt

Re: Crazy MP3 player idea

Post by Llama@bad » Tue Feb 10, 2009 9:37 pm

if your machine is good enough: Play TF2 in a Window!
I Have it in a window with only a very very thin blue line at the upper edge of my screen.

Only thing is you have to move the window always in the position when you start tf2 but thats worth the work. I can happyly switch between chat, itunes and internet and tf2, only bad thing:
If you go outside of tf2 of course the sound will stop so you cant keep talking in tf2 or listening to an interesting speech of someone while chatting...
"I'd like to congradulate Llama on having the longest ever post (LEP) at Fester's Place. And second longest. And third longest. And fourth longest! Long live the king of anti-spam!" by Jonnywhy
Image

User avatar
Jonnywhy
Posts: 2570
Joined: Wed Apr 30, 2008 4:18 pm
What is 3hirty p1us 4orty?: 4
Contact:

Re: Crazy MP3 player idea

Post by Jonnywhy » Tue Feb 10, 2009 9:42 pm

Llama@bad wrote:if your machine is good enough: Play TF2 in a Window!
I Have it in a window with only a very very thin blue line at the upper edge of my screen.

Only thing is you have to move the window always in the position when you start tf2 but thats worth the work. I can happyly switch between chat, itunes and internet and tf2, only bad thing:
If you go outside of tf2 of course the sound will stop so you cant keep talking in tf2 or listening to an interesting speech of someone while chatting...
Just add -noborder to the startup options of tf2. My laptop is not great, but i run no border and it works well. (graphics all turned down to minumum of course)
"Hey actually Jonnywhy is right" - AngryWolf

"I agree with Jonnywhy" - Supernova

"Jonnywhy you're about as useful as a ashtray on a motor bike!" - Fester

Post Reply