[Newton] car problem

Posted By: Marky Mark

[Newton] car problem - 09/16/05 02:21

hi, i'm using the code from the car example that comes with newton's plugin. I tryed with the same car settings, but i'm not using a terrain, i'm using blocks.

I start my game, the newton splash comes, then when it's time to spawn, I get an error message : crash in NewtonVehicleAddTyre. I get the errors 4 times because of the 4 wheels, then the game continue. My car loose his wheels in the air and fall to the ground. when he reach the ground, he passes through, like my ground was passable...

What I have to do?
Posted By: Josh_Arldt

Re: [Newton] car problem - 09/16/05 03:00

You cannot have a skybox made of blocks around the level... use a model.

This question has been asked many times... and I've answered all of them... please use the search button next time. It's there for a reason.
Posted By: broozar

Re: [Newton] car problem - 09/16/05 07:26

hi all,

iīm using Newton car physics as well. have a look at the car demo tutorial that comes with NGD 1.51. my problem is: if you zoom close to the car, the camera starts bucking as hell. the problem gets smaller the farther you zoom away but never disappears completely.
Posted By: Marky Mark

Re: [Newton] car problem - 09/16/05 13:25

Quote:

You cannot have a skybox made of blocks around the level... use a model.

This question has been asked many times... and I've answered all of them... please use the search button next time. It's there for a reason.




Sorry for the post again, but I don't know how to use skyboxes. As I understand, it's a textured box model? How I put this in 3dgs? I searched, but i found nothing very interesting...
Posted By: FoxZero

Re: [Newton] car problem - 09/16/05 21:53

There are many things you must do. Trust me. This has all been explained to me, by me, etc... This is a common question. Look harder.
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 06:11

I looked at many topics, its all saying something about using a model for the sky.. but its not explaining how, and it also say that maybe just restard wed... no it don't work ^^
Posted By: Josh_Arldt

Re: [Newton] car problem - 09/17/05 06:20

Quote:

I looked at many topics, its all saying something about using a model for the sky.. but its not explaining how, and it also say that maybe just restard wed... no it don't work ^^




A sky box is a hollow box around the level that has a sky texture applied to it.
You cannot use these with the newton cars.
What I do it make an inside-out box in MED and apply a sky texture to it.
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 06:34

do you have a model that i could use?
Posted By: Josh_Arldt

Re: [Newton] car problem - 09/17/05 06:39

Here ya go: sky_box1
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 06:41

404 errors 4 ever

in other words, link is bad

EDIT: Nevermind
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 06:47

Ok I Added the entity sky_box1.mdl. The box is very small.. I scaled it to my level, but when i run, it's saying "bad scale on skybox1.mdl..."
Posted By: broozar

Re: [Newton] car problem - 09/17/05 07:04

and, btw, that cannot be the only solution. look at the tutorial level in the newton package. the DO use a skybox, but the the render flag is set to "ignore"...
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 07:09

Yeah so it's the reason of why i'm still getting the error without any sky?
Posted By: Josh_Arldt

Re: [Newton] car problem - 09/17/05 07:23

Quote:

look at the tutorial level in the newton package. the DO use a skybox, but the the render flag is set to "ignore"...





Sorry, I forgot about that solution.
Thanks for reminding me
Posted By: broozar

Re: [Newton] car problem - 09/17/05 12:25

lads, i got the ULTIMATE solution ^^

1st: create your level, the car etc. as usual.
2nd: add a hollow cube, name it "skyblock".
3rd: apply a full black texture named "background.tga" (!)
4th: set the flags for all six blocks to "sky" (!)
5th: use the "sky.wdl" that comes with the tut pack (mod it/write your own, as you like)
6th: compile and run. and...... there comes the skybox WITHOUT any error ^^ YAY

proof:


Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 14:50

Thanks, i'm now compiling.. I hope it will work
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 14:57

skybox's working... but still getting the /"$%?&?$% error about AddTyre, and my car is falling through the shaded block i'm using for the floor...

help me plz!
Posted By: Jupp

Re: [Newton] car problem - 09/17/05 15:44

Hi,
Asse wrote an (still unreleased) german tutorial about creating a car in ngd. I got the same message, but with his code it works. You should ask him for help.

Jupp
Posted By: broozar

Re: [Newton] car problem - 09/17/05 15:44

a) you did not do what i post before or
b) i forgot to say (oh, i really did!) to say: you have to set the flag "disable" in "render options" so that it will appear green
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 15:48

ok I disabled the render... now compiling.. 530 seconds left
Posted By: broozar

Re: [Newton] car problem - 09/17/05 16:04

woha.... what a level is this?!
Posted By: broozar

Re: [Newton] car problem - 09/17/05 16:07

man, use a test level! mine takes only 40s
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 16:11

Still getting the error! :S:(
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 16:25

Project folder .CD with the level... Can you take a look?
Posted By: broozar

Re: [Newton] car problem - 09/17/05 16:34

sure... DLing atm.

edit: i c.... i said "name the sky texture for the skybox "BACKGROUND.TGA" not balck.dunno

should be it

BTW: your nexus is much too small and i donīt have all your WADS to compile it ^^
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 16:54

I didn't found any background.tga, so i placed a black tga... for the wads, I placed them in the folder.. what are the wads you need?
Posted By: broozar

Re: [Newton] car problem - 09/17/05 17:06

all the building wads.
it is IMPORTANT to have a background.tga for sky texture.... ALL others wonīt work.

and, btw, u didnīt set the "disable"-flag
and you didnīt name the block "skyblock"...
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 17:34

can you link the background.tga?

I'll do the other things, flags and rename to skyblock

Do I have to rename the 6 blocks "skyblock" ?
Posted By: broozar

Re: [Newton] car problem - 09/17/05 17:37

you could use ANY black *.tga image with 256x256x24 or similar.
and yeah, i guess renaming is important. for me, it didnīt work without.

BTW, have you used any other sky texture in your level?
Posted By: Marky Mark

Re: [Newton] car problem - 09/17/05 21:53

Firdt, I was using the template sky, a simple box with a template animated sky texture. Now I deleted it, im using what you said.
Posted By: Marky Mark

Re: [Newton] car problem - 09/18/05 03:14

and I still get the error message...

if you want to test it, the wads are included in the folder, just re-locate them with the Texture Manager in WED.
Posted By: broozar

Re: [Newton] car problem - 09/18/05 14:48

i got it. your erreor does not depend on the skybox, it occurs even if itīs deleted. so there are several possibilities:

a) you didnīt include the cls file properly
b) you have another block in your level with a sky texture that iīm unable to find
c) your car action is strange (the tutorial car code looks different)

[edit] AAAAAAAAAAAAAAAAHHH! i donīt believe it!
look at the level strings u typed in your v0_1 wdl ^^
man, load YOUR level, not the Vehicle_playgrond and all works fine ^^

LOL

and, btw, check your camera script, it produces funny errors... eg, it sets your car to the camera position after a few seconds and gets stuck^^
Posted By: Marky Mark

Re: [Newton] car problem - 09/18/05 19:39

LOL.. shame on me! hmm for the camera.. what should I do

EDIT: yeah it works, but my car is in the air at 0,0 :P
Posted By: Marky Mark

Re: [Newton] car problem - 09/19/05 21:30

Quote:

and, btw, check your camera script, it produces funny errors... eg, it sets your car to the camera position after a few seconds and gets stuck^^




Do you know where is the problem in the script?
Posted By: broozar

Re: [Newton] car problem - 09/20/05 05:07

sorry, i didnīt look further into your script, it seemed too long. and, btw, iīm no scripting expert. sry
Posted By: Marky Mark

Re: [Newton] car problem - 09/20/05 14:47

Ok thanks anyway.. Anyone know what I should do?
Posted By: Marky Mark

Re: [Newton] car problem - 09/20/05 15:01

This is my camera code.. The problem is : When the game starts, my car is in the air and start to fall to the ground. Before reaching the ground, he is teleported to the default camera position at 0,0...


starter move_camera()
{
camera.arc=72;
camera.clip_near=20;
camera.clip_far=24000;

var cam_ang[3];
var cam_dist=500;
cam_ang.pan=180;
cam_ang.tilt=30;
cam_ang.roll=0;

while(!p_vehicle){wait(1);}

while(1)
{
if(mouse_right)
{
cam_ang.pan+=10*mouse_force.x;
cam_ang.tilt=clamp(cam_ang.tilt+(10*mouse_force.y),5,80);
}

cam_dist=clamp(cam_dist-mickey.z,200,2000);

camera.x=p_vehicle.x+cos(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt));
camera.y=p_vehicle.y+sin(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt));
camera.z=p_vehicle.z+sin(cam_ang.tilt)*cam_dist;

vec_set(temp,p_vehicle.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);

wait(1);
}
}


THIS is in my main:

dll_handle=newtonHandle;
NewtonAddMap(s_level,0);
Posted By: Marky Mark

Re: [Newton] car problem - 09/20/05 21:08

Maybe I have to do something with my CLS??
Posted By: Asse

Re: [Newton] car problem - 09/22/05 13:34

Don't make a starter!

Code:

function main()
{
wait(3);

level_load(wmb_Level);

wait(1);
dll_handle = newtonHandle;
NewtonAddMap(wmb_Level, splashscreen);


camera.arc=72;
camera.clip_near=20;
camera.clip_far=24000;

var cam_ang[3];
var cam_dist=500;

cam_ang.pan=180;
cam_ang.tilt=30;
cam_ang.roll=0;

while(!p_F360)
{
wait(1);
}

while(1)
{
if(mouse_right)
{
cam_ang.pan+=10*mouse_force.x;
cam_ang.tilt=clamp(cam_ang.tilt+(10*mouse_force.y),5,80);
}

cam_dist=clamp(cam_dist-mickey.z,200,2000);

camera.x=p_F360.x+cos(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt));
camera.y=p_F360.y+sin(cam_ang.pan)*(cam_dist*cos(cam_ang.tilt));
camera.z=p_F360.z+sin(cam_ang.tilt)*cam_dist;

vec_set(temp,p_F360.x);
vec_sub(temp,camera.x);
vec_to_angle(camera.pan,temp);

wait(1);
}
}


Posted By: Carloos

Re: [Newton] car problem - 09/22/05 13:56

I think your car keeps falling for another reason. I used to have this problem very often when I played with newton for the firs times, but now I can make it work almost all the time in my project. Thereīs something mistical with it lol.

Are you working on a demo ? Do you have a Newton car demo ? I started loading a demo level , studing the newton parameters and then deleting the car and tyres and inserting mine ones, and made it a thousand times till my car finally got his tyres and fall in the ground with his wonderfull working suspension. Someone told you that you have to group the tyres before group them with the car model ? Are you placing your car far from the ground ? Arent you by mistake grouping something else with the car or tires ?

Cya
Posted By: Marky Mark

Re: [Newton] car problem - 09/22/05 15:14

I'm using the car that comes with the newton's tutorial. I have:

Group CAR
car.mdl
Group Tires
the 4 tires models....
Posted By: Marky Mark

Re: [Newton] car problem - 09/22/05 15:21

like this

Posted By: alphaindigo

Re: [Newton] car problem - 09/24/05 12:46

i had trouble with the groupings of the tyres and stuff at the start

by the way dose anyone know how to en_move the whole car group not just the body ...?
Posted By: Asse

Re: [Newton] car problem - 09/24/05 13:53

Code:

// vehicle control loop
while (1)
{
my.carEngineTorque = 0.0;
my.carSteerTorque = 0.0;

// read wheel controls
if(key_a)
{
my.carSteerTorque = 100.0;
}
if(key_d)
{
my.carSteerTorque = -100.0;
}
if(key_w)
{
my.carEngineTorque = 2600.0;
}
if(key_s)
{
my.carEngineTorque = -400.0;
}
wait(1);
}


Posted By: testDummy

Re: [Newton] car problem - 09/25/05 04:36

Quote:

by the way dose anyone know how to en_move the whole car group not just the body...?



Quoted Alphaindigo.
I'm curious. Alphaindigo, when using Newton to move the car, why would you want to move the whole car group with ent_move? This would probably create a conflict.
I'd suppose that you'd have to first remove it from the Newton physics simulation, and then move all objects by the same distance.
Posted By: Marky Mark

Re: [Newton] car problem - 09/25/05 06:55

I do not have problems for grouping the car and stuff, cuz i just copied/paste the group
Posted By: Asse

Re: [Newton] car problem - 09/25/05 07:50

@ testDummy: Take a look above your post

Removing the car from physics-simulation is senseless since he wants to use it with physics.
Posted By: testDummy

Re: [Newton] car problem - 09/26/05 22:14

@Asse.
Quote:

@ testDummy: Take a look above your post

Removing the car from physics-simulation is senseless since he wants to use it with physics.



Quoted Asse.

Quote:

by the way dose anyone know how to en_move the whole car group not just the body ...?



Quoted Alphaindigo again.

Perhaps I have misread the post. The post appears to indicate that the individual wants to move a group of objects with function ent_move.
However, the individual does not appear to explicitly define that this group of objects should be moved with ent_move while they are active in the Newton physics simulation.
Maybe this was supposed to be obvious from the thread context.

Is it your intention to indicate that after moving a group of objects with ent_move that the representation of those objects within the Newton physics simulation will remain valid and accurate?
It was my intention to make an educated guess concerning the validity of objects moved with ent_move that were active in the Newton physics simulation. I was merely indicating that there may be a conflict, and that objects that are to be moved with ent_move should probably be removed from the simulation temporarily. Perhaps you have first-hand knowledge as to whether not this may be necessary.
Posted By: HackerL

Re: [Newton] car problem - 10/03/05 20:30

Cool car you got !
Posted By: Marky Mark

Re: [Newton] car problem - 10/04/05 15:15

Ok I "solved" the problem, when I place my car at the origin of my level, it works. But my origin is in the air of my level.. so my car falls and crash on the ground.. If i place my spawn at another place, its not working.
Posted By: HackerL

Re: [Newton] car problem - 10/04/05 17:15

Strange my level is working fine! No glitch at all!
Posted By: Marky Mark

Re: [Newton] car problem - 10/05/05 14:17

what kind of sky you are using? and are you on terrain? i'm on blocks...
Posted By: HackerL

Re: [Newton] car problem - 10/05/05 14:33

i am using block too! i can send to you my Skyblock textures collection! If you need?
Posted By: Carloos

Re: [Newton] car problem - 10/06/05 00:30

I have some problems like this one in my game sometimes, with newton engine . But basically always the alignment, grouping, absurd physical properties , and sometimes the file saving issue I comment further, that make it happen.

With and without sky, I had this problem. Basically, I compiled 500 times to have a good result trying to figure out how it works. When u say "my origin is in the air" are you talking that you are placing the car close to the ground or touching it ? Or, that newton only works when you let the car fall in the ground ?You must must let the car fall a bit.

When you change your grouping etc etc ,Save the level, close wed, sometimes make even a winxp logoff, open wed again, and try to compile/run the level. I figured that sometimes if you dont restart WED the Newton engine will keep in error even when u did everything correctly.

Hope this can help, Iīm new to all this.
Posted By: Marky Mark

Re: [Newton] car problem - 10/06/05 14:09

I mean that I didnt created my level at the origin, 0,0,0. So this Origin point is situated in the air, like 20 meters of the ground on my level.. Maybe I should move all my level, but it will be long to compile.. any suggestions?
Posted By: alphaindigo

Re: [Newton] car problem - 10/24/05 15:01

hi its alphaindigo again
sorry for getting you guys confused but the reason for wabting to ent_move the car was to do with multiple levels and moveing the car to where it left the level when it re-entered the level... if you can understand that but it dosent matter.
i have another question i have got quite good at driveing the newton_vehicle but even so i still cant help flipping it over dose anyone know how to script it to rewrite itself lift itself up a bit and then let it go again si i dont have to keep restarting the level every time i crash?
Posted By: HackerL

Re: [Newton] car problem - 11/03/05 20:43

Quote:

entity* p_vehicle;

with p_vehicle pointing to the Newton car, you should declare a function like this:

function ResetMyPosition()
{
var car;

p_vehicle.roll = 0;
p_vehicle.tilt = 0;
p_vehicle.pan = 0;

car = NewtonGetBody (p_vehicle);

NewtonBodySetTransform(car);
}



Next time SEE in the forum old topics! Copy this script at end of your main scripts! Sorry for my bad english!!!
© 2024 lite-C Forums