Raised This Month: $12 Target: $400
 3% 

Is it possible to detect if a player is touching the ceiling/sky with their head?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 08-31-2016 , 10:37   Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #1

Title ftw
hellmoss is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 08-31-2016 , 14:03   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #2

You can't possibly touch the sky / ceiling with your legs.
eyal282 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-31-2016 , 20:42   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #3

What are you trying to accomplish? By this I mean the end result, not detecting if a player is touching the ceiling/sky with their head.
__________________

Last edited by Bugsy; 08-31-2016 at 20:44.
Bugsy is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 08-31-2016 , 22:10   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #4

There is a wall-climbing zombie class. It can climb on any type of surface except for the ground which is checked by flags FL_ONGROUND. I don't want it to be able to climb on the skybox (or a horizontal wall which is not ground).

As regards: https://wiki.alliedmods.net/FakeMeta...indTextureType
I don't see 'sky' in the list of texture materials.

And Bugsy, while I've got your attention, could you please check out https://forums.alliedmods.net/showthread.php?t=286541 and give me your opinion?

Last edited by hellmoss; 08-31-2016 at 22:15.
hellmoss is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 09-01-2016 , 02:02   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #5

So ... you don't need to detect touching with head, just if a zombie is touching the sky/horizontal wall if he's 'climbing' block/kill him.

After search, for the wall i found this, read entires posts - https://forums.alliedmods.net/showthread.php?t=112915


About the sky i haven't found something, wait others to answer about this.
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
SpannerSpammer
Member
Join Date: Mar 2006
Old 09-01-2016 , 02:11   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #6

Don't use the TextureType route, it's an unreliable method (mappers can use custom textures
and unknown textures will cause the code to return the default material, which is Concrete).

Try this:
Do a Traceline from the Player's eye position straight up for 8192 units.

Get the vecEndPos, and do a point contents check on that origin.

If you get CONTENTS_SKY at that position, then get the Player's
pev->absmax value and subtract the z-axis (vertical component) value
from the vecEndPos z-axis. If the difference is less than about 0.1 - 0.05,
then the player is definitely touching the skybox.

(What you're checking here is to see if the Player's bounding box and the
ceiling intersect, more or less)

As for your wall problem: Traceline + Point Contents. If the result is not
CONTENTS_SOLID then it's not something your player should be able
to climb, unless it's a ladder.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 09-02-2016 , 17:15   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #7

There is a way to achieve what you want, it is rather simple and doesn't require many resources, but you will have to compromise a little

Instead of setting his velocity on x,y,z vector according to his aim, just set his velocity on the z vector, that means he cannot climb along the sky or other ceiling, he can climb only upwards ...
__________________

Last edited by Depresie; 09-02-2016 at 17:19.
Depresie is offline
hellmoss
Senior Member
Join Date: Oct 2009
Location: ZOMBIE PLAGUE
Old 09-04-2016 , 21:18   Re: Is it possible to detect if a player is touching the ceiling/sky with their head?
Reply With Quote #8

Thanks for the advices, I'll look into them more carefully when I'm back.
hellmoss is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:32.


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