gametechmods

Robot Arena => Modifications => Topic started by: daleksec7 on May 29, 2010, 11:43:50 AM

Title: music
Post by: daleksec7 on May 29, 2010, 11:43:50 AM
hiya im just wondering is there anyway to add music when your fighting?
Title: Re: music
Post by: G.K. on May 29, 2010, 11:46:44 AM
Mad has a 'MusicBoxArena' somewhere.
Title: Re: music
Post by: daleksec7 on May 29, 2010, 11:48:24 AM
ah but im just wondering is there any py codes for it?
Title: Re: music
Post by: G.K. on May 29, 2010, 11:48:40 AM
I'll check the .py
Title: Re: music
Post by: daleksec7 on May 29, 2010, 11:59:04 AM
what you see the py or me? becuase i know know his arena
Title: Re: music
Post by: G.K. on May 29, 2010, 12:01:48 PM

That's the .py. Try and work out what you need to add to yours. (Backup your .py first)
Title: Re: music
Post by: JoeBlo on May 29, 2010, 12:06:35 PM
by the looks you will need the stuff between the #MMMM parts...

but backup for sure.. especially as im reading this at 1am after a night of gambling and Jack Daniels :P

Edit: also the original post https://gametechmods.com/forums/index.php?topic=1117.msg19641#msg19641 (https://gametechmods.com/forums/index.php?topic=1117.msg19641#msg19641)
Title: Re: music
Post by: G.K. on May 29, 2010, 12:07:14 PM
and Jack Daniels

:O

What did you do with him? :P
Title: Re: music
Post by: JoeBlo on May 29, 2010, 12:08:47 PM
mixed him with coke and lemonade and drank him
Title: Re: music
Post by: G.K. on May 29, 2010, 12:09:14 PM
:O

Again?
Title: Re: music
Post by: daleksec7 on May 29, 2010, 12:09:37 PM
lol ive tryed but still nothing :S
Title: Re: music
Post by: G.K. on May 29, 2010, 12:11:15 PM
Post your .py here.
Title: Re: music
Post by: JoeBlo on May 29, 2010, 12:12:45 PM
did you put all the music sections into the correct sections of your python?
Title: Re: music
Post by: daleksec7 on May 29, 2010, 12:16:03 PM
Title: Re: music
Post by: JoeBlo on May 29, 2010, 12:44:19 PM
there isnt any of the music stuff in there ?
Title: Re: music
Post by: daleksec7 on May 29, 2010, 12:45:15 PM
yer i know becuase im just wondering if he could put it in becuase i tryed and dident work
Title: Re: music
Post by: G.K. on May 29, 2010, 12:46:58 PM
I'm not your best option, but I'll try.
Title: Re: music
Post by: Sage on May 29, 2010, 12:49:28 PM
PM madiaba. He'll be like: "It's elementary, my dear dalek...."
Title: Re: music
Post by: daleksec7 on May 29, 2010, 12:54:36 PM
ah yer i just rememberd i have his msn :D
Title: Re: music
Post by: Serge on May 29, 2010, 12:54:57 PM
It's easy.
Code: [Select]
self.custom_sound = plus.CreateSound("blabla.mp3", False, (0, 0, 0))This goes when other stuff for the arena is loading, since it takes some time to precache the sound. self.custom_sound now holds a "handle" to the sound you want to play later.

Then, when you want the music to play, just run
Code: [Select]
plus.loopSound(self.custom_sound)
Title: Re: music
Post by: JoeBlo on May 29, 2010, 12:57:45 PM
also make sure the song is in that folder
 
Title: Re: music
Post by: daleksec7 on May 29, 2010, 01:00:59 PM
where do i put the coding?
Title: Re: music
Post by: JoeBlo on May 29, 2010, 01:03:10 PM
It's easy.
Code: [Select]
self.custom_sound = plus.CreateSound("blabla.mp3", False, (0, 0, 0))This goes when other stuff for the arena is loading,

Then, when you want the music to play, just run
Code: [Select]
plus.loopSound(self.custom_sound)

so the initial load up stuff for the arena and then when you want it to play
Title: Re: music
Post by: Sol Vector on June 30, 2010, 04:08:43 PM
Easy alternative without coding:
Obviously not for everyone...

Replace a sound effect for a component you dislike with the music you want, then place the component in your bot and wire it. Use component in battle to initiate playback. If you have extra weight/space/wiring in said bot you can do this with multiple components to create a jukebox function. You could also create new components without weight/space requirements if so inclined I suppose, but I've never tried.
Title: Re: music
Post by: cephalopod on June 30, 2010, 04:18:12 PM
Yeah, you could edit a .txt so the motor or whatever has no collision and weighs like 0.1kg. But you'd have to trust yourself not to abuse the component's new assets XD
Title: Re: music
Post by: JoeBlo on July 01, 2010, 02:43:11 AM
or a sharktooth size plain box with no collision that weighs 0kg ?

in any case nice 'bumpage'
Title: Re: music
Post by: Clickbeetle on July 01, 2010, 10:56:43 PM
It's easy.
Code: [Select]
self.custom_sound = plus.CreateSound("blabla.mp3", False, (0, 0, 0))This goes when other stuff for the arena is loading, since it takes some time to precache the sound. self.custom_sound now holds a "handle" to the sound you want to play later.

Then, when you want the music to play, just run
Code: [Select]
plus.loopSound(self.custom_sound)


I'm pretty sure you can't play mp3's with Python code.  You need to convert them to wav's, which are huge, which is why you don't see very much in-battle music.