How to recognize a class is touching a wall

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Locked
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

How to recognize a class is touching a wall

Post by Death Egg »

How do I go about checking if a class, specifically the player, is touching a wall? I am using Nash's platformer starter kit, and don't know how to do this, which at the moment is the cause of the biggest issue with my physics atm. The issue is if the player is running against a wall and jumps over it, due to building up speed because the player thing doesn't recognize the wall as putting friction to a stop, the player will bolt over it at whatever speed was built up. What kind of expression (or something else? New to both ZScript and programming proper in general) would I call to help remedy this?
User avatar
Nash
 
 
Posts: 17494
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: How to recognize a class is touching a wall

Post by Nash »

The best way to do it would be to fire line traces. AimLineAttack can be used for this. The real problem right now though is that there's no way to detect if the trace result is either a wall, a floor or a thing (there's no way to distinguish uniquely what exactly the trace hit). Graf has said some vague things about scriptified trace results, my best guess is that it's not currently on his priority list.

Another approach (which was popular during the ACS/DECORATE days) is to spawn a "collision checker" every tic - if the Spawn fails, it means something is in the way.
User avatar
Death Egg
Posts: 198
Joined: Tue Aug 14, 2012 10:16 pm

Re: How to recognize a class is touching a wall

Post by Death Egg »

Hm. Hopefully I can something to work but not being able to tell what the thing is the player touched is going to be a bit of an issue with the way the engine I'm trying to make works. Hopefully I can get something sorted out.
Locked

Return to “Editing (Archive)”