0

I can't seem to be able to execute mon Main.py because it's giving me this error:

Traceback (most recent call last):
  File "main.py", line 383, in <module>
    gamebase = GameBase()
  File "main.py", line 278, in __init__
    DGG.setDefaultRolloverSound(self.sounds['GUI_rollover'])
KeyError: 'GUI_rollover'
:TaskManager: TaskManager.destroy()

(for sure, it's sound related... and dict related, but i cant seem to figure out where the problem is)

The part where the error occur is right here:

       exts = ('mp3','wav','ogg')
            for x in (3,3.5,5,0):
                for ext in exts:
                    for s in ToonGlobber.glob("phase_"+str(x)+"/audio/sfx/GUI_*."+ext,"phase_"+str(x)+"/audio/sfx"):
                sf = s.split('/')[-1].split('.')[0]
                self.sounds[sf] = loader.loadSfx(s)

    DGG.setDefaultRolloverSound(self.sounds['GUI_rollover'])
    DGG.setDefaultClickSound(self.sounds['GUI_click'])

    self.pickerNode = CollisionNode('mouseRay')
    self.pickerNP = camera.attachNewNode(self.pickerNode)
    self.pickerNode.setIntoCollideMask(BitMask32.allOff())
    self.pickerNode.setFromCollideMask(BitMask32(16))
    self.pickerRay = CollisionRay()
    self.pickerNode.addSolid(self.pickerRay)

What's causing this? What can be done to fix it?

  • If all you are trying to do is just run the code, you can simply remove the two offending DGG.setDefault* lines, since they are only used to set the GUI sounds. – rdb Feb 27 '14 at 23:39

1 Answers1

0

It cannot find the named sound files, presumably because the phase MF is not properly mounted or does not contain the given GUI sounds.

rdb
  • 1,488
  • 1
  • 14
  • 24