Gamestudio Links
Zorro Links
Newest Posts
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (1 invisible), 21,732 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
MaliceTheMaker, Haitao_Ren, JimSimons, julienp, julienper
19248 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