Nice work, I’m sure some ppl would love to see more example code like this. Perhaps you should use some easier to read names for your functions, ppl starting out might get confused on cApplication or w/e. Also, a few more words on what ie DirectObject does and why its there.
Great idea putting tutorials together!
Just one thing:
I think its better to change the folowing lines
if int( self.fallFunc ) == -11: #is it neg eleven? self.box.setPos( 0, 70, -10 ) #place it on the floor return taskMgr.remove( "mFallTask" ) #remove the task elif int( self.fallFunc ) == -12: self.box.setPos( 0, 70, -10 ) return taskMgr.remove( "mFallTask" ) elif int( self.fallFunc ) == -13: self.box.setPos( 0, 70, -10 ) return taskMgr.remove( "mFallTask" )
if int( self.fallFunc ) <= -11: self.box.setPos( 0, 70, -10 ) #place it on the floor return taskMgr.remove( "mFallTask" ) #remove the task
You may not have fully set up Panda3D to run properly on your machine.
Have you tried downloading and installing the latest version of Python? (a standalone version from www.python.org, not the one packaged with Panda)
Are you running the scripts right from the package or did you copy/paste into a new project? If you copy/pasted, did you make sure to define all the necessary Panda3D includes?
Hope this helps!
Yeah I downloaded the full version of python and no I did not copy and paste. With the Manual (A Panda “Hello World”) everything works just fine
It has completely nothing to do with Python. The error was generated when instancing DirectObject. The DirectObject import statement in this tutorial was intended to be ran on older version of Panda. For the later version, you should change it,
from direct.showbase import DirectObject
to this :
from direct.showbase.DirectObject import *
but… uhm… the box doesn’t really bounce. It ‘bounces’ very weird (at my computer).
Theres spose to be a Readme.txt file it says in the MS DOS batch file but when i downloaded it, there wasnt one to be found? Idk but good example all together anyways I can try and figure out how you did everything through the boxbounce.py but if there was more in the Readme.txt it may be easyer? Idk message me back byes
Very nice and well-commented tutorial.
Sorry!It didn’t help me!
I couldn’t download the files!
EDIT: … just changed a name
Hmmm… the latest zip-file on panda3dprojects? seemed to work… at least it did a few seconds ago.
Note: Don’t use the original link posted in the first post - use the one given by IPKnightly at the end of the thread:
I’ve just downloaded the 1.5 version of panda and I can’t seem to get boxbounce to start. The following is what outputs:
Warning: DirectNotify: category ‘Interval’ already exists
DirectStart: Starting the game.
Known pipe types:
(all display modules loaded.)
:display:windisplay(warning): SetForegroundWindow() failed!
:util(warning): Adjusting global clock’s real time by 1.16634e-005 seconds.
:loader(error): Couldn’t load file assets/models/floor.egg: not found on model path (currently: “/c/Users/Chris/Desktop/boxbounce;/c/Panda3D-1.5.0/etc/…;/c/Panda3D-1.5.0/etc/…/models”)
Traceback (most recent call last):
File “boxbounce.py”, line 132, in
gApp = cApplication( )
File “boxbounce.py”, line 78, in init
File “boxbounce.py”, line 89, in mLoadModels
self.floor.reparentTo( render )
AttributeError: ‘NoneType’ object has no attribute ‘reparentTo’
I’m relatively new to python and panda, so I’m not exactly sure how to fix it. In the models folder, there is a floor.x, but not a floor.egg, is this a problem?
older engine could would look for any kind of file of floor - it does not do that any more you have to convert floor.x to egg (recommended) or change the name in the file to load the .x.
Maybe IPKnightly/lettier can change that in the code?
If not: Well, maybe I can modify the archive…
The earlier one looks like wind resistance. ^^
Dude, this looks so ghetto. ^^ Needs another update for 1.5. I’m going to send out the request. Basically, the update will require the coder to change …/floor to …/floor.x and …/box to …/box.x . Otherwise, you get an error that floor.egg and box.egg cannot be found.
Is it still being downloaded from P3DP or is the tut integrated into Panda3D lately? If its on P3DP, I can try fixing the stuff if you tell me what to fix. ^^
I didn’t have the time to follow the errors in detail. Being quite busy these days - sorry.