Author Topic: music  (Read 2617 times)

Offline JoeBlo

Re: music
« Reply #20 on: May 29, 2010, 12:57:45 PM »
also make sure the song is in that folder
 

Offline daleksec7

  • Heavyweight
  • Posts: 421
  • Rep: 8
  • Working hard
    • View Profile
    • Awards
Re: music
« Reply #21 on: May 29, 2010, 01:00:59 PM »
where do i put the coding?

Offline JoeBlo

Re: music
« Reply #22 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

Offline Sol Vector

  • Antweight
  • Posts: 26
  • Rep: 0
    • View Profile
    • Awards
Re: music
« Reply #23 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.
Le continuel ouvrage de votre vie, ces't batir la mort

Offline cephalopod

Re: music
« Reply #24 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
bristol bot builders / two headed death flamingo / snappy robots
//
kindest and friendliest '13, '15, '16, '17 / favourite staff member '14, '15

Offline JoeBlo

Re: music
« Reply #25 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'

Offline Clickbeetle

  • *
  • Posts: 3374
  • Rep: 21
  • In Soviet Russia, bugs stomp YOU!
  • Awards BOTM Winner
    • View Profile
    • Beetle Bros site
    • Awards
Re: music
« Reply #26 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.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings