CanCollideWith and teleporting stuff

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
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

CanCollideWith and teleporting stuff

Post by JPL »

I have a setup where the player teleports (ACS special 70) to a TeleportDestination, and very close by is a ZScript actor that overrides CanCollideWith for some custom touching/not-touching logic. When the player enters and exits the actor's radius by walking its CanCollideWith logic operates as intended, but when the player teleports into its radius as described, CanCollideWith only begins to fire once the player begins moving within its radius - if the player doesn't move after teleporting, they'll never trip the actor's CanCollideWith logic.

This seems like a bug rather than intended behavior... if it is, feel free to move this to the bugs forum. If not I'd be curious as to what the rationale is. There's probably a way I can work around this (manually nudge-moving the player a bit right after the teleport maybe?) but if it's a bug I'll let the fix save me that work.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: CanCollideWith and teleporting stuff

Post by Matt »

Could this be related to the (intended, canonical vanilla) behaviour with pickups where they won't be picked up unless you're moving (or, in ZDoom, crouching)?
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm
Contact:

Re: CanCollideWith and teleporting stuff

Post by JPL »

Vaecrius wrote:Could this be related to the (intended, canonical vanilla) behaviour with pickups where they won't be picked up unless you're moving (or, in ZDoom, crouching)?
As best as I can tell from the code, yes quite possibly. Pickups have their own special case handling via Touch / P_TouchSpecialThing, but that happens during PIT_CheckThing which I don't think is called for players that aren't moving(?).

I think I found a workaround, which is to run CheckPosition in the Tick of the object I want to detect collisions with, effectively re-checking for collisions every frame. On a map with about 30 of these, it appeared to add 1ms to "stat think". The map will eventually have about 200 of them so we'll see how that scales!

If anyone with deep knowledge could weigh in on whether the current behavior is intended (or, alternately, "unintended but way too sensitive to try fixing") that would be useful!
Locked

Return to “Editing (Archive)”