안녕하세요^^
완성이 눈 앞에 보이고 있네요..ㅎㅎ
다름이 아니고.. 지금 배경음악은 자동으로 나오는데..
혹시 특정 영역으로 가면 특정 음성이 나오게끔 할 수 있나요?
스크립트를 여러개 한꺼번에 두면 가능할까요? 아니면 함수가 정해져 있나요?
이제 이것만 하면되는데..ㅠㅠ 조금만 도와주세요
지금 제가 첨부한 파일에 보시다시피
if entry[0].getIntoNodePath.getName() == '55f':
self.musicBoxSound = base.loadMusic("sound/55.mp3")
self.musicBoxSound.setVolume(1)
self.musicBoxSound.setLoopCount(0)
self.musicBoxSound.play()
이런식으로 했는데 밑에와 같이 에러가떠요 머가 문제점일까요?
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
File "Tut-Roaming-Ralph.py", line 268, in <module>
w = World()
File "Tut-Roaming-Ralph.py", line 135, in __init__
if entry[0].getIntoNodePath.getName() == '55f':
NameError: global name 'entry' is not defined
**** End of process output ****
게도님 말대로 넣었는데 실행안되고 에러 뜨네요..
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
File "Tut-Roaming-Ralph.py", line 198, in move
if entry[0].getIntoNodePath.getName() == '55f':
TypeError: 'libpanda.CollisionEntry' object does not support indexing
:task(error): Exception occurred in PythonTask moveTask
Traceback (most recent call last):
File "Tut-Roaming-Ralph.py", line 272, in <module>
run()
File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
self.taskMgr.run()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
self.step()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
self.mgr.poll()
File "Tut-Roaming-Ralph.py", line 198, in move
if entry[0].getIntoNodePath.getName() == '55f':
TypeError: 'libpanda.CollisionEntry' object does not support indexing
**** End of process output ****
이렇게욤 ㅠㅠ 머가잘못된거죠?
DirectStart: Starting the game.
Known pipe types:
wglGraphicsPipe
(all display modules loaded.)
Traceback (most recent call last):
File "Tut-Roaming-Ralph.py", line 202, in move
if entries[0].getIntoNodePath.getName() == '55f':
AttributeError: 'builtin_function_or_method' object has no attribute 'getName'
:task(error): Exception occurred in PythonTask moveTask
Traceback (most recent call last):
File "Tut-Roaming-Ralph.py", line 284, in <module>
run()
File "C:\Panda3D-1.7.0\direct\showbase\ShowBase.py", line 2531, in run
self.taskMgr.run()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 496, in run
self.step()
File "C:\Panda3D-1.7.0\direct\task\Task.py", line 454, in step
self.mgr.poll()
File "Tut-Roaming-Ralph.py", line 202, in move
if entries[0].getIntoNodePath.getName() == '55f':
AttributeError: 'builtin_function_or_method' object has no attribute 'getName'
**** End of process output ****
entries로 바꾸고 했는데 이렇게 에러가 뜨네욥.... 제가 혹시 함수 선언을 잘못한걸까요?
에궁 바쁘실텐데 계속 물어봐서 죄송해요 ㅠㅠ..

ralph가 어떤 장소에 들어서면 해당 음성파일이 play되게 하려느거잖아요?
어떤 장소에 들어갔는지 알아내는 방법이 지금 스크립트에서는 collide되는 geom의 이름으로 알아내는 수 밖에 없으니까
collide되는 geom의 이름이 특정 이름이면 sound를 play하면 되겠죠.