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
0 registered members (), 16,302 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
falling through the ground? #220267
08/06/08 18:10
08/06/08 18:10
Joined: Mar 2008
Posts: 45
N
nigel Offline OP
Newbie
nigel  Offline OP
Newbie
N

Joined: Mar 2008
Posts: 45
hey, i'm working off a scripting tutorial for a fps, and i have a problem. I just completed my player's z trace so he can fall and land on platforms, but there is a problem. If he falls onto a map entity, a sprite, or a model he stops falling and can walk around on it. But if he lands on a terrain he falls right through it. Any idea what I should change in my code so he can land and walk on terrains? Thanks in advance!

Here is the part of the script that I think would be relevant to the problem:



vec_set(temp,my.x);
temp.z -= 4000;
trace_mode = ignore_me+ignore_sprites+IGNORE_MODELS+USE_BOX;
My.fall_distance = trace(my.x,temp);
move_mode = IGNORE_YOU + IGNORE_PASSABLE + IGNORE_PUSH + ACTIVATE_TRIGGER + GLIDE;

If (my.fall_distance >64 && sign(my.fall_distance) != -1)
{
my.falling = 1; // now I'm falling
}
else
{
if ( my.fall_distance < 64 && my.falling == 0 )
{
move_vec.z = -my.fall_distance * time_step;
}
}

If (my.fall_distance >32)
{
my.falling = 1; // now I'm falling
if (move_vec.z > -15 * time_step)
{
move_vec.z -= .3 * time_step;
}
}

Re: falling through the ground? [Re: nigel] #220296
08/06/08 20:42
08/06/08 20:42
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Im only a noob myself, but if you're using higher than A5
(which I assume seeing as youre using Lite-C) I believe you should
be using "c_trace()" rather than the old obsolete "trace()"

Hope this helps


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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