Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Cannot get 1 of the projects Physics to work

Author
Message
leigh4ever36
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location: united kingdom
Posted: 29th Dec 2010 15:35
Hello, im on the windows xp. Ive updated direct x and installed the runtime exe file. The project I used is Using Multiple Ridig Bodies from the getting started. I paste the same code as below compile and run, I get a error Could not determine parameter type of 'levels - y' at line 35. And when I try to open from the db pro the source code and the exe, test. Then runtime error 7007 object already exists at line 20, which is make object cube ID. Im on the db version 7.1 and thats it really


phy start
sync on
sync rate 60
autocam off

make object box 1, 10, 0.5, 10
position object 1, 0, -0.25, 0
phy make rigid body static box 1

position camera 0, 2, -4

levels = 20
ID = 1

for y = 0 to levels
for x = 0 to levels – y
make object cube ID, 0.2
color object ID, rgb ( rnd ( 255 ), rnd ( 255 ), rnd ( 255 ) )
position object ID, ( x + 0.5 * y ) * 0.21 – 1.5, y * 0.21 + 0.1, 0
phy make rigid body dynamic box ID
inc ID

next x
next y

do

if spacekey ( )
make object sphere ID, 0.6
position object ID, camera position x ( ), camera position y ( ), camera position z ( )
phy make rigid body dynamic sphere ID
phy set rigid body linear velocity ID, 0, 3, 10
inc ID
endif

phy update
sync
loop
29 games
18
Years of Service
User Offline
Joined: 23rd Nov 2005
Location: not entirely sure
Posted: 29th Dec 2010 23:22 Edited at: 29th Dec 2010 23:24
Hi leigh,

I've had a quick look at your code. You're in luck as the problem you have has nothing to do with windows XP (it's what I use).

I'll do the easy one first.

The reason that you are getting object already exist errors is to do with where you're putting the "inc ID" command. This needs to go before the lines where you make, color and position additional objects.

Quote: "I get a error Could not determine parameter type of 'levels - y'"


This happened to me when I copied and pasted your code into DBPro and tried to run it. However, after a bit of messing around I found that if I typed in the line:

position object ID, ( x + 0.5 * y ) * 0.21 – 1.5, y * 0.21 + 0.1, 0


,instead of just copying and pasting it, the code ran fine. I have no idea why this worked but you might want to try and see if it works for you.

I've updated your code with the modifications I made to sort out the object already exists errors and commented where I've made changes. However, I do not have dark physics so had to comment out all the lines relating to it (again I have shown this in the code).




One last thing, you might have noticed on other people's post (including my response to you here) that they have their code in these nice expandable code boxes. You can do the same by:

1: pasting your code into your message (as you have done)
2: highlight the code
3: press the "code" button at the top right of the message window. 4: When you post the message, your code will appear in a box. This just helps to keep the code formatted correctly.

Oh, and welcome to the forums.
leigh4ever36
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location: united kingdom
Posted: 7th Feb 2011 14:25
Sorry for the mega late reply, thanks for the advice. Ive posted another one on here when approved it will show up. Its some differculty with darkmatter models. Hope I have sorted out the code snippet thing

Login to post a reply

Server time is: 2024-09-29 00:17:56
Your offset time is: 2024-09-29 00:17:56