Problems with car setup

Hey guys,

(see blend file at the bottom)

Im trying to setup a car with use of python, i found it somwhere on the forum i guess, but there is a problem. In first case everything worked well but when i Scaled the model down and the tires and apply “scale/rotate to OBdata” it doenst work anymore. I have tried several different settings to the tireAxis and the suspension_Angel but it doenst do any good.

Has someone experience with this or knows what im doing wrong or has a solution for this? Thanks anyways for you time!!!

http://www.bluelabeldesign.nl/tmp/newSetup.blend

cheers
wes

hi wessx,

The python code you are using is mine and it goes with the 4 part tutorial I wrote.

Vehicle Wrapper Part 1 – Car Setup
Vehicle Wrapper Part 2 – Suspension
Vehicle Wrapper Part 3 – Powertrain
Vehicle Wrapper Part 4 – Camera

Your setup has several mistakes in it. Take a look at the tutorial and if you have any questions after that, don’t hesitate to ask.

If you have Blender 2.49, use the updated code for CarSetup.py and Powertrain.py.

Clark

Hey cthames

Thank you for your reply, i check it out and it works fine now (YES).

However i do have another qeustion, when i import the car (assigned to a group in its own file) and want to try it out in the mainfile(where everything comes together) it doesnt seem to work anymore…is it actually possible, or you need to setup everything in the main file to be able to test and play it?

thank you for your help and sharing your script ill put your name in the credits :slight_smile:

wes

hi wessx,

It should work. What could be happening is that you have already have sensors/actuators/models/scripts etc with the same names in your main blend and when you appended the car group, the sensors/actuators/models/scripts etc were renamed by Blender.

In other words, if you have a sensor named gas in both blends, the appended sensor will be renamed to gas.001. The python script will look for an attached sensor named gas but will be unable to find it.

Clark

I dont append them I link them … I know i can append them and that it will work but i prefer to link it becaus it is way much easier to work like this…Im sure there not more files in the Main blend.

wes

I struggled for a long time with linking a grouped vehicle. I’d be very interested to see if anyone has a solution to it, as it’s what has been holding me back from making another driving game.

hi,

Using a library for the cars works for me. Place both blends in the same directory. Open the Vehicle_Main.blend

Add the linked car group from the Garage_Library.blend

Spacebar >> Add >> Group >> Garage_Library >> Car_Red

Start game engine.

Clark

Attachments

Vehicle_Main.blend (423 KB)Garage_Library.blend (392 KB)

Clark thanks so far!

But i still have a question, when i apply everything the scripts etc i get a error from the console… vehicleID does not exist. I have been checking it out in your files and i cant seem to find where you ‘set’ this variable i also checkt out the tut but couldn t find it?

wes

hi wes,

The setup uses 3 state mask groups. The vehicleID property is automatically created in CarSetup.py (line 81) located in State Mask group 1.

Take a look at my setup. You’ll see that State Mask group 1 is selected. Now, look at your setup. I’m going to guess that you have State Mask group 2 or 3 selected.

Clark

Hey Clark,

Your right i had the wrong mask active…how ever it still doenst work… it makes me crazy…maybe someone can tell me what im doing wrong i changed the settings in the suspension script to test and see what happends…with no result. anyway, clark thanks so far for your help and comments! I want it to work so i can continue the demo and finish it :D.

http://www.bluelabeldesign.nl/tmp/player.blend

cheers
wes

hi wes,

Take a look at the State Actuator named “Switch State 2”.

It is set to switch to State 1. Change it so that it switches to State 2 and your blend will work.

Clark

Hi I’m trying to use a wrap for a game I’m making and having problems. I’m using Blender 2.59 and all the ones I’m finding are for old style version. I’m new at this so any help would be great