Failure on Using direct tools

I have:

self.accept(“t”, render.place)

In my code and it has been working fine, then added a bunch of code not requiring using direct tools, currently when I hit “t” I get the following error

U:\scalende\Desktop\Source Control Server Upload\BVW-PGH-2006\assignment2\Group0
1\world>ppython JODTeam1.py
DirectStart: Starting the game.
Warning: DirectNotify: category ‘Interval’ already exists
Known pipe types:
wglGraphicsPipe
(3 aux display modules not yet loaded.)
:util(warning): Adjusting global clock’s real time by 0.462572 seconds.
:util(warning): Adjusting global clock’s real time by -9.25147 seconds.
:09-27-2006 18:44:55 Messenger(warning): object: JamODrum already accepting: esc
ape
Traceback (most recent call last):
File “JODTeam1.py”, line 601, in ?
run()
File “C:\Panda3D-1.2.993\direct\src\showbase\ShowBase.py”, line 2014, in run
self.taskMgr.run()
File “C:\Panda3D-1.2.993\direct\src\task\Task.py”, line 838, in run
self.step()
File “C:\Panda3D-1.2.993\direct\src\task\Task.py”, line 786, in step
self.__stepThroughList(taskPriList)
File “C:\Panda3D-1.2.993\direct\src\task\Task.py”, line 720, in __stepThroughL
ist
ret = self.__executeTask(task)
File “C:\Panda3D-1.2.993\direct\src\task\Task.py”, line 643, in __executeTask
ret = task(task)
File “C:\Panda3D-1.2.993\direct\src\showbase\EventManager.py”, line 38, in eve
ntLoopTask
self.doEvents()
File “C:\Panda3D-1.2.993\direct\src\showbase\EventManager.py”, line 32, in doE
vents
self.processEvent(self.eventQueue.dequeueEvent())
File “C:\Panda3D-1.2.993\direct\src\showbase\EventManager.py”, line 86, in pro
cessEvent
messenger.send(eventName, paramList)
File “C:\Panda3D-1.2.993\direct\src\showbase\Messenger.py”, line 223, in send
apply(method, (extraArgs + sentArgs))
TypeError: spawnMoveToView() takes exactly 2 arguments (3 given)
Fatal Python error: PyEval_RestoreThread: NULL tstate

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application’s support team for more information.

spawnMoveToView() is an undocumented panda function

Thanks for any help

spawnMoveToView() is a method that is called when buttons ‘1’ through ‘8’ are pressed (that is, in response to messages ‘1’ through ‘8’). It’s set up along with a host of other keyboard response methods when want-directtools is configured on.

You said there is no requirement to run directtools; do you have it configured on by mistake?

David

Ok,

I added some collision event handling for the 4 players in my game, each passing a message 0 - 3 respectively so I knew how to Identify them. That must be what is causing the problem.

Thanks a ton

I had to comment out all of the lines

#self.sq.addInPattern(’%fn’)
#self.sq.addAgainPattern(’%fn’)
#self.accept(“0”,self.Collision)
#self.accept(“1”,self.Collision)
#self.accept(“2”,self.Collision)
#self.accept(“3”,self.Collision)

and direct tools worked again

You could replace them with lines like:

self.sq.addInPattern('coll-%fn')
self.sq.addAgainPattern('coll-%fn')
self.accept("coll-0",self.Collision)
self.accept("coll-1",self.Collision)
self.accept("coll-2",self.Collision)
self.accept("coll-3",self.Collision) 

As long as you don’t throw an event named just “0” or “1” or something like that, you should be fine.

David