Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,513 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help Please! #58308
11/01/05 20:49
11/01/05 20:49
Joined: Sep 2005
Posts: 6
Guitar_Mace Offline OP
Newbie
Guitar_Mace  Offline OP
Newbie

Joined: Sep 2005
Posts: 6
I have just created a small tester level for my racing game but physics are not working with the car since it will not fall down an elevation but float at the same height. Please Please Please help! P.S the car is placed on a block with a grass texture.
Thx






// rallycargame.wdl
var video_mode = 7;
var video_depth = 16;
var move_vec[3] = 0,0,0;
var tempy = 0;

action player_move
{
player = me;
phent_settype(me,PH_RIGID,PH_box);
phent_setmass(my,23,PH_box);
phent_setfriction(my,25);
phent_setelasticity(my,50,5);
phent_setdamping(my,50,90);
ph_setgravity ( vector(0,0,-386) );
while(player!=NULL)
{
update_views();
//Moving Commands
move_vec[0] = (key_cuu - key_cud)*30*time;
player.pan += (key_cul - key_cur)*4*time;
ent_move(move_vec,NULLVECTOR);
if (move_vec[0] == 0)
{
//Stationary Animations
//
}
else
{
//Moving Animations
//
}
wait(1);

}



}
//Basic Camera varible definitions
var dist_planar = 50;
var cam_angle = 0;
var dist_traced;
var tilt_3rd=15;
var dist_total=200;
var updown=100;
entity* player;
//3rd Person camera setup
view 3rd_person
{
layer = 1;
pos_x = 0;
pos_y = 0;
}
function init_cameras()
{
camera.visible = off;
3rd_person.size_x = screen_size.x;
3rd_person.size_y = screen_size.y;

3rd_person.visible = on;
}
var camsw;
function validate_view()
{
my = player;
trace_mode = ignore_me + ignore_passable;
dist_traced = trace (player.x, 3rd_person.x);
if (dist_traced == 0) { return; } // No obstacles hit... fine
if (dist_traced < dist_total&&camsw==0)
{
dist_traced -= 5; // Move it out of the wall
dist_planar = cos (tilt_3rd) * dist_traced;
3rd_person.x = player.x - cos (cam_angle) * dist_planar;
3rd_person.y = player.y - sin (cam_angle) * dist_planar;
3rd_person.z = player.z + sin (tilt_3rd) * dist_traced;
}}
function update_views()
{
vec_set(temp,vector(player.x,player.y,0));
vec_sub(temp,3rd_person.x);
vec_to_angle(3rd_person.pan,temp);
dist_planar = cos (tilt_3rd) * dist_total;
3rd_person.x = player.x - cos (3rd_person.pan) * dist_planar;
3rd_person.y = player.y - sin (3rd_person.pan) * dist_planar;
3rd_person.z = player.z+updown;
3rd_person.tilt=-asin(updown/vec_dist(3rd_person.x,player.x));
cam_angle=3rd_person.pan;
validate_view();
}

//Main Function Follows:

function main()
{
level_load("rallycargame.wmb");
init_cameras();
ph_setgravity (vector (0,0,-386));

wait(2);

}

Last edited by Guitar_Mace; 11/01/05 20:50.

whens a door not a door? ..... When its ajar! haha so funny...
Re: Help Please! [Re: Guitar_Mace] #58309
11/03/05 06:36
11/03/05 06:36
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
make sure you have a hollow cube around all your level, else it will keep hanging in the air (you could see that kinda like the galaxy, just an empty space).

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Help Please! [Re: Helghast] #58310
11/03/05 16:23
11/03/05 16:23
Joined: Sep 2005
Posts: 6
Guitar_Mace Offline OP
Newbie
Guitar_Mace  Offline OP
Newbie

Joined: Sep 2005
Posts: 6
It still hangs in midair =-(


whens a door not a door? ..... When its ajar! haha so funny...

Moderated by  HeelX, Spirit 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1