1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Car Physics
#88654
09/04/06 01:33
09/04/06 01:33
|
Joined: Mar 2005
Posts: 134
jeffmorris
OP
Member
|
OP
Member
Joined: Mar 2005
Posts: 134
|
I found code for car physics at this link: http://www.coniserver.net/wiki/index.php/Commercial_Edition_Single_Car_PhysicsI created a large cube for the ground, loaded rally car model into 3DGS, and attached physics_ent action to the car. When I used "File/Preview Level" command, the car was bouncing. When I used "File/Run Level" command, the "A6 Engine" window is all black. How can I fix the problems?
|
|
|
Re: Car Physics
[Re: jeffmorris]
#88655
09/04/06 06:05
09/04/06 06:05
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
If that is the only code you're using I don't see a camera control script, or a function main for that matter. What else have you added?
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: Car Physics
[Re: jeffmorris]
#88656
09/04/06 08:39
09/04/06 08:39
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Quote:
I found code for car physics at this link: http://www.coniserver.net/wiki/index.php/Commercial_Edition_Single_Car_Physics I created a large cube for the ground, loaded rally car model into 3DGS, and attached physics_ent action to the car. When I used "File/Preview Level" command, the car was bouncing. When I used "File/Run Level" command, the "A6 Engine" window is all black. How can I fix the problems?
keep in mind this code was written under A6.31, I havent had the time to upgrade yet, so as soon as i do, i'll fix the code to work under A6.40 for everybody out here... untill then, youre on your own.
regards,
|
|
|
Re: Car Physics
[Re: jeffmorris]
#88658
09/04/06 10:46
09/04/06 10:46
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Quote:
Should I go back to A6.31?
I didnt say that. but in order to have it work correctly, that version is needed. I'll update it soon, im gonna update this week... untill then just hold on.
regards,
|
|
|
Re: Car Physics
[Re: Helghast]
#88659
09/04/06 21:25
09/04/06 21:25
|
Joined: May 2006
Posts: 398
Bot190
Senior Member
|
Senior Member
Joined: May 2006
Posts: 398
|
it works for me ps im the one that wanted it
Wait, there isn't a "Make My Game Now" button?
|
|
|
Re: Car Physics
[Re: Helghast]
#88663
09/18/06 16:18
09/18/06 16:18
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
ok, i've had some time, tested this under A6.40, but seems to work... here's the code i use: Code:
entity* car;
//Environment Defines var earth_gravity[3] = 0,0, -887;
action physics_ent { car = me; phent_settype(my, PH_RIGID, PH_BOX); ph_setgravity( earth_gravity ); phent_setmass(my, 7, PH_BOX); phent_setfriction(my,20); phent_setelasticity(my, 25, 1); phent_setdamping(my, 30, 15); control(); }
function control { var velocity; var velocity3[3]; while(1) { phent_getvelocity(my, velocity3, nullvector); velocity = vec_length(velocity3); if(key_w == 1){vec_set(temp.x, my); vec_normalize(temp, 5000); phent_addforcelocal(my, temp, nullvector);} if(key_s == 1){vec_set(temp.x, my); vec_normalize(temp, -2500); phent_addforcelocal(my, temp, nullvector);} if(key_a == 1 && velocity > 60){phent_addtorqueglobal (my, vector(0, 0, 200));} if(key_d == 1 && velocity > 60){phent_addtorqueglobal (my, vector(0, 0, -200));} wait(1); } }
function main { video_switch(7, 32, 2); fps_max = 60; level_load("nascar_test.wmb"); wait(5); } should work. regards,
|
|
|
|