Car Physics Demo Script Problems

Posted By: iprogramgames2

Car Physics Demo Script Problems - 11/18/04 19:08

I have several problems with the demo SCRIPT (not the compiled demo):

I must make this clear. I have played the compiled demo and it runs great. I expected the same from compiling the script but this is not the case.

1. Am I the only person that had to change the scripts to get the car demo to work? I really appreciate the free (for pro users) script but it doesn't work as is. Certain functions required a vector and had values set to 0 (zero). I had to change these to nullvector.

2. Am I the only person that is having problems with the car breaking (stopping) when I try to accelerate? This happens with the keyboard and joystick. I have narrowed it down to this piece of code located within the SpeedControl() function located within physics_car.wdl:

// if we drive in one direction and want to change direction, apply brakes
// (angSpeed>0 checks if rear wheel is turning forward
// direction<0 checks if user hits reverse key
if ((angSpeed>5 && direction<0) || (angSpeed<-5 && direction>0))
{
targetSpeed=0; // brake
// press brakes quarter down when rolling at high speed
if (abs(angSpeed)>0.25*maxAngSpeed)
{
phcon_setmotor(wheelRL, nullvector, vector(angSpeed*0.5, 0.5*maxTorqueBrake,0), nullvector);
phcon_setmotor(wheelRR, nullvector, vector(angSpeed*0.5, 0.5*maxTorqueBrake,0), nullvector);

if (abs(angSpeed)>0.50*maxAngSpeed)
{
EventBrake(); // braking sound
}

}

Why in the world is this code automatically breaking for me with that EventBrake(); call?

Someone please give me some good code.
Posted By: indiGLOW

Re: Car Physics Demo Script Problems - 11/18/04 21:39

Why dont you create a debug panel to display all the variables, maybe the equation is always true? At least this way you might spot the problem.

Im no expert, but I can't see anything wrong with the script
Posted By: b_102373

Re: Car Physics Demo Script Problems - 11/19/04 03:54

Obviosly you have the PRO Version. It should run fine with no problems. What version of PRO are you using and if not then how did you get the scripts?

Cheers
Posted By: iprogramgames2

Re: Car Physics Demo Script Problems - 11/19/04 05:07

Yes, I have pro version 6.22. Just to make sure it wasn't my version I updated (after copying my original gstudio verrsion 6.22 folder) to 6.31.3. It still does the same thing. Why doesn't the scrip work like the compiled demo?

One of my main reasons for choosing Game Studio to develop on is the resources and community. Am I the only one who has noticed that even though Game Studio has many great contributions more than half seem to be buggy and one must fix these problems by his/herself. For example, why can't I simply run this script as opposed to having to correct the errors first? And with the NewtonCar action (3rd party product) why all the problems with adding tires to a vehicle. Even when one such as myself follows each and every direction things just don't work as stated. I've been using this engine since the A4 in 1998 and have seen it become what it is today. Just a little effort on ensuring free contributions WORK would be VERY nice. It's like saying: "Here, use this great tool." And when you try to use the tool as shown it simply doesn't work. Hey, I'll even volunteer to be a tester prior to the release of these extras. I believe it's VERY important as the "easier" Game Studio is to use the more successful it will be.

Sincerely,

Iprogramgames
Posted By: Marco_Grubert

Re: Car Physics Demo Script Problems - 11/19/04 06:02

Quote:

1. Am I the only person that had to change the scripts to get the car demo to work? I really appreciate the free (for pro users) script but it doesn't work as is. Certain functions required a vector and had values set to 0 (zero). I had to change these to nullvector.


Not with more recent versions, phFunctions support 0 for nullvector.

Quote:

2. Am I the only person that is having problems with the car breaking (stopping) when I try to accelerate?


Unplug your joysticks to make sure it's not stopping the car.

If anyone else encounters this problem please confirm. I just tested it with 6.31.3 and there was a problem with a panel definition but everything else worked fine.
Posted By: iprogramgames2

Re: Car Physics Demo Script Problems - 11/19/04 09:02

WooHoo it works as is with version 6.31.3. I looked around and never found a reference to requirements for running it (another commonality I experience). Anyway, while I have your attention have you ever created that phent_clearvelocity() function? The original thread is here:

http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=309750&page=1&view=collapsed&sb=5&o=&fpart=1#309750

Thanks
Posted By: Marco_Grubert

Re: Car Physics Demo Script Problems - 11/23/04 05:59

Yes, phent_clearvelocity(phent) is part of 6.31.3
Posted By: iprogramgames2

Re: Car Physics Demo Script Problems - 11/23/04 19:34

Freekin sweet!!! Thanks Marco.
© 2024 lite-C Forums