AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Surfing detection (https://forums.alliedmods.net/showthread.php?t=62971)

alien 11-08-2007 18:29

Surfing detection
 
Does anyone know the way to detect sliding (or surfing) down the slope? I was hoping to get something out from entity flags, but there's no difference between the state where player is just in air (like during a jump) and the sliding.

Someone able to help?

Regards

A

Hawk552 11-08-2007 18:30

Re: Surfing detection
 
Check when they touch a func_friction or whatever the classname is, can't remember now.

Wilson [29th ID] 11-08-2007 18:34

Re: Surfing detection
 
If that doesn't work...just logically thinking...you could test to see if they have velocity, make sure they are on ground, and check if they are not pressing any movement buttons

If I remember correctly, you have to hold in buttons to surf though. So you'd have to compare the buttons to which direction and velocity and agh...

Actually re-reading what you're saying...if the entity flags say he is in air when he is jumping, just do a trace-hull of a slightly larger space and see if you hit any ground.

alien 11-08-2007 18:51

Re: Surfing detection
 
Hawk552: Touch might work with func_friction thing but this is more about world brushes with slope faces (> 45 degrees I think). You can't stand or walk on them. As soon as you touch one, entity flag will change to 8 (which is exactly the same value as during falling).

Wilson: Whatever player is pressing and his speed is will not help in distinguishing falling state from sliding. But trace_hull idea sounds interesting. I'll be right back.

Thank you both.

UPDATE:

Trace_hull with with large_hull almost did the job. But then I've noticed that the states where player is in the air + ducked + few units above ground and the state when player is touching a brush (possibly slope) + is above ground are identical in the engine. So another problem - and I don't see a way through trace_hull anymore. This problem is more complicated than I expected.

I possibly have a solution but that includes a bit of vector algebra ... and lot of optimalisations.
Garh >_<


All times are GMT -4. The time now is 01:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.