|
7 registered members (3run, miwok, AndrewAMD, Quad, TipmyPip, fairtrader, 1 invisible),
637
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Gravity Problem
[Re: Frits]
#75558
06/08/06 23:30
06/08/06 23:30
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Hmm....
I know the code works, as I've used it...
Could it be your terrain (model)? It has it's "Polygon" flag set on right???
xXxGuitar511 - Programmer
|
|
|
Re: Gravity Problem
[Re: xXxGuitar511]
#75559
06/09/06 09:05
06/09/06 09:05
|
Joined: Mar 2006
Posts: 724 the Netherlands
Frits
User
|
User
Joined: Mar 2006
Posts: 724
the Netherlands
|
According to the manual: Quote:
on - use the entity's polygonal shape (default on terrain and maps) off - use the entity's oriented bounding box (default on models and sprites).
When I use a terrain (.hmp) it does not mather if the flag is on or off, the player does not fall through the surface. The only thing is that the player is not stopped at slopes, it climbs on it even if it 90 degrees.
When I use a terrain as a model (.mdl) and set the flag, after a short walk the player falls through the surface. When the flag is not set, when the player steps on the surface it falls immediately through the surface. Mayby I must make a sort of 'floor' just below the terain model.
I will explain why I have to use a terrain as a model; my level is for the greatest part below the surface, so I can't use a terrain (.hmp) because you can't make a hole in it. (Or I must make 4 terrains that surrounds the actual level). Therefore I have to make a terrain, convert it into a model and make a hole in it.
Any advice?
Regards, Frits
I like to keep scripting simple, life is hard enough as it is. Regards, Frits
|
|
|
Re: Gravity Problem
[Re: Frits]
#75560
06/09/06 14:19
06/09/06 14:19
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
If your using a model for terrain, then you HAVE TO use the Polygon flag. Otherwise, It will not detect the model, just fall.
Second, Please post a screen/or more precise example of the problem you are having. When the model is walking across the model, after a few steps, it falls through?
xXxGuitar511 - Programmer
|
|
|
Re: Gravity Problem
[Re: xXxGuitar511]
#75561
06/09/06 14:31
06/09/06 14:31
|
Joined: Mar 2006
Posts: 2,503 SC, United States
xXxGuitar511
Expert
|
Expert
Joined: Mar 2006
Posts: 2,503
SC, United States
|
Here's one more trace example (I know your tired of 'em). This one traces from the center of the entity down, so even if the origin is under the surface, the model won't fall through unless it's halfway under. Code:
define TraceDist, 500; var TraceFrom[3]; var TraceTo[3]; // ... vec_set(TraceFrom, my.x); TraceFrom.z = my.z + my.min_z + ((my.max_z - my.min_z) / 2); vec_set(TraceTo, TraceFrom); TraceTo.z -= TraceDist; my.trace_distance = c_trace(TraceFrom, TraceTo, ignore_me | ignore_passable | ignore_passents); if (my.trace_distance == 0) {my.trace_distance = TraceDist;} my.trace_distance -= (my.max_z - my.min_z) / 2; ... TraceTo.z -= TraceDist
xXxGuitar511 - Programmer
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|