-

Good work!

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" )

to


if int( self.fallFunc ) <= -11:
  self.box.setPos( 0, 70, -10 ) #place it on the floor
  return taskMgr.remove( "mFallTask" ) #remove the task

Martin

I got this problem;

What did I do wrong? I clicked on run.bat :confused:

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! :slight_smile:

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 :confused:

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 :

from direct.showbase import DirectObject

to this :

from direct.showbase.DirectObject import *

good tutorial!
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 :slight_smile:

Very nice and well-commented tutorial.

Sorry!It didn’t help me! :frowning:
I couldn’t download the files! :cry:

jup… server seems to doesnt hold the file anymore.
@konfuzius: you’r welcome to join the panda 3d irc channel. #panda3d on freenode.net

EDIT: … just changed a name :stuck_out_tongue:

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:

BoxFall

Regards, Bigfoot29

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:
wglGraphicsPipe
(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
self.mLoadModels( )
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… :confused:

Regards, Bigfoot29

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. :frowning:

Regards, Bigfoot29

I posted the changes. It just needs to have the files renamed with the .x extensions… ^^

Ok, I hope this is ok with everyone I rewrote the gravity so it looks a bit more realistic (purely experimental though).

you can download it here: cdpteam.110mb.com/boxbounceModified.zip