projectile flat/wall detection? possible?

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.
Posts: 2058
Joined: Mon Feb 07, 2011 5:02 am

projectile flat/wall detection? possible?

Post by osjclatchford »

this is a curious question for me to ask as I'm not exactly actively modding these days but its something I've been wondering about today and I can't honestly think of a better/ more appropriate place to ask;
is it possible (using decorate) to make projectiles detect if they are hitting a wall, ceiling or even specific flat and jump to a specific death animation depending on which. an example application for such would be for a rocket to do an alternative death state when hitting a floor to a wall (different sprites. mushroom cloud for floor standard for wall.) also you could have mushroom clouds inverted in the event of a ceiling impact much like the way it does in duke3d. (FYI it was playing some duke3d this weekend that made me think of this)

another use/possible method or whatever for this I can think of would be if you could have the rocket/grenade or whatever projectile detect what type of terraintype flat it was impacting on it could jump to a death state that spawned a large splash effect/sprite without having to use up the limit of two splashes from the terrain lump.

just an idea. a brainstorm that ended in my musing on the subject some and searching online on the fact came up with nought so I thought I'd ask here and see if its a pointless endeavor or not and hell, perhaps it might help someone else thinking of doing the same thing in a mod of their own...

to my mind zdoom 2.8.1 compatibility would be best as if it works in that It'll work in anything I figure. and I love that engine LOL
anyway food for thought...
User avatar
Posts: 17390
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: projectile flat/wall detection? possible?

Post by Nash »

Check for the projectile's Z position in the death state. If it's <= FloorZ, it hit the floor. If it's >= CeilingZ, it hit the ceiling. Anything in between, it hit the wall. Alternatively, there's A_CheckFloor and A_CheckCeiling. Can be done in both DECORATE and ZScript.

Detecting what kind of terrain: not exactly possible, but you can check a specific texture name of a flat in ZScript.

Return to “Editing (Archive)”