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 / Having trouble loading vehicles from DarkMatter packages

Author
Message
leigh4ever36
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location: united kingdom
Posted: 7th Feb 2011 14:12
Hello I was wondering if anyone could help me, I've used one of the examples from DarkBasic pro project files its called Automatic and manual driving. Ive got all the files in place, I havent changed the code apart from the car modal. The car they have on there is the beach buggy,

beachBu2.tga
and beach.x.
It loads ok, But as soon as I replace that with another car
or any car

Lincon Town Car.x
and lincntc1.bmp

I compile it, I get the Runtime Error 7023- Limb does not exist at line 51 which is the phy update line

Thankyou for your time




Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 7th Feb 2011 16:11
Each object is made of one or several limbs that can be controlled separately using the limb commands. The number of limbs an object contains depends on the object. The object beach.x probably has more limbs than the object Lincon Town Car.x.

There's no elegant fix for this in DBP. You'll need some kind of 3D modeling software to remake or reorganize the model so that it has the correct number of limbs and so that the limb numbers match with the other object.
An easier way is just changing the limb numbers in the code. But this means changing your code based on which model you're loading, so the original (beach.x) won't work anymore.

Sven B

Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 7th Feb 2011 16:19 Edited at: 7th Feb 2011 16:20
I'm afraid you can't just change the car model!

The car object consists of several components - the chassis, and the four wheels are the crucial ones. These components are called "Limbs", in the same way that an arm is a limb of a human body.

Now, the beach buggy has its wheels as limbs 5, 7, 3, 9 - hence the second parameter in the four "Phy add Vehicle Wheel" commands is 5, 7, 3, then 9. However, the Lincon Town Car model will have its four wheels assigned to a different set of limb numbers - so you have to change the "Phy Add Vehicle Wheel" commands.

To find out what limb numbers have been assigned, load the Lincon Town Car in the DarkMatter browser, and if memory srevres me right there is a button that lists the names of the limbs and their ID numbers - just look for Left Front Wheel, Right Front Wheel, etc. and modify your code accordingly.

Oh, and it could be the chassis limb number that's wrong - might be as well to check that too!

Hope this helps!

EDIT - Sven B beat me to it (I'm slow at typing )

We spend our lives chasing dreams. Dark Basic lets us catch some of them.
leigh4ever36
13
Years of Service
User Offline
Joined: 29th Dec 2010
Location: united kingdom
Posted: 7th Feb 2011 22:39
Thanks for replying back, I tried the browser in darkmatter 3. I changed the limbs for the wheels, no more error messages. But the model didnt turn out what I expected. The limb numbers for the lincon car are:
1 x3ds_G_Node
2 x3ds_V_Node
3 x3ds_FL_Wheel
4 x3ds_FR_Wheel
5 x3ds_BL_Wheel
6 x3ds_BR_Wheel
7 x3ds_Chasis


Even if I put the limbs in the wrong and right order the model still dosent come out right and I have noticed when I press the up arrow the chasis spins round along with the wheels

I have put a snapshot on

Attachments

Login to view attachments
Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 8th Feb 2011 10:41
Are you sure all four wheels are spinning? If the chassis is rotating, I suspect that one wheel isn't. The only thing I can think of right now is that you're not assigning the right limb numbers to the wheels, or the new car's different size to the Beach Buggy means that some of the parameters ought to be changed.

You might want to check out this program, which is an app to help set up vehicles in Dark Physics:
http://forum.thegamecreators.com/?m=forum_view&t=144632&b=30

Hope this helps!

We spend our lives chasing dreams. Dark Basic lets us catch some of them.

Login to post a reply

Server time is: 2024-09-29 00:22:55
Your offset time is: 2024-09-29 00:22:55