Author Topic: Blender: Parenting/Export issues [Solved]  (Read 623 times)

So, I got down how the new exporter works, but the collision issue was simply a problem with Blockland's hard coded ground. I made it irrelevant by making the center of mass right the vehicle, but there was nothing wrong with the collision. Thank you to Barnabas and Pecon for the help.

This has been by far the most difficult part of any add-on I create. While creating a wheeled vehicle, I discover that the collision is glitchy, and sometimes even tilts over and begins to move up and down out of the ground, and slide away while bouncing rapidly. What am I doing wrong with the collision? Here's how I have it at the moment:

shape>Col0>Collision-1
shape and Col0 are empties, Collision one is the two names of the rectangular bounding collision box. I have Collision-1 on the second layer, so it does not show up with the rest of my model. While exporting, I do the following:
Make sure under detail levels there is detail32 (min pixel size 32) on layer 1, and Collision-1 (min pixel size -1) on layer 2. Everything except for Camera and Lamp are selected under nodes, I haven't used materials yet, and I turn on Triangle Strips.

It shows up correctly with the temporary wheels, and I can jump in and drive it, but the collision is screwy. What do?

If someone could explain to me how to change the third person camera location while mounted as well, that would be nice too.

Edit: Note that I have looked at various vehicle tutorials and they contradict in various ways. I'm not sure which to trust.
« Last Edit: February 21, 2014, 01:30:07 AM by Narkro555 »

Parenting is only needed when you are using the older versions of the exporter. Since you talk about layers, you don't have to bother with that at all.

Could it be possible to have a look at your model? I'm not sure what you are really referring to as screwy. If it is moving like an earthworm with a seizure, it's most likely to be an issue with the mass centre, which can be remedied in the script.

You can change the 3rd person camera position in the script too. Find the following in the vehicle script:

Code: [Select]
// 3rd person camera settings
cameraRoll = false;         // Roll the camera with the vehicle
cameraMaxDist = 10;         // Far distance from vehicle
cameraOffset = 7.5;        // Vertical offset from camera mount point
cameraLag = 0.0;           // Velocity lag of camera
cameraDecay = 0.75;        // Decay per sec. rate of velocity lag
cameraTilt = 0.4;
collisionTol = 0.1;        // Collision distance tolerance
contactTol = 0.1;

You'll most likely need to edit the "cameramaxdist" and the "cameraoffset" values.

Earthworm having a seizure describes it pretty well, here:


It's bobbing up and down very rapidly, so much that it kills me to attempt to mount it. It then slides off faster and faster as well.

So when you say I don't need parenting any more, what do you mean? Can the model and armatures just be floating on layer one and the collision box on layer 2, and as long as I specify those two locations in the exporter, it will be fine?

Oh, and in the node exporter, what are the only things I'm letting it export?

At the moment I'm just using jeep wheels and the jeep script until I get the model itself done. The mass center is "0 0 0". I'm testing the camera distance thing now.

EDIT: Changed viewpoint to a good location, thank you. Adjusting the mass center, however, messed up how it turned, so I kept it at "0 0 0".
« Last Edit: February 19, 2014, 03:34:33 PM by Narkro555 »

May I see the script of your vehicle? I'm suspecting some foul play with the mass settings.

As for the parenting issue: empties were needed before the exporter got the layer system. Empties used to serve as the "layers" for blender objects, and the old exporter versions sorted the objects accordingly to the empties. Now that the last version of the exporter has the layers interface, empties are simply redundant for that purpose. So shortly, yes, they can just float in the vast nothingness of the blender layers.

If you give an object node for a mesh piece, it means you can control it with a script. Let's say, you export the node of a car roof object. Now that it has an object node you can create a script to change its colour depending on the colour of the rest of the car i.e. for certain colours you can make the roof turn black and for the rest you can make it turn white.

Though when I exported meshes without their nodes, sometimes seams appeared between mesh pieces.

Attached is the vehicle's script. Right now it's just a modification of the Jeep server.cs script, and I copied the other require files until I can replace them.
« Last Edit: February 20, 2014, 07:02:13 PM by Narkro555 »

Bump. Collisions with players, bricks, and projectiles all appear to work fine, but upon any collision with the ground, it jumps up and down inside the ground so fast unmounting kills me. The camera is also giving me trouble.