projectile flat/wall detection? possible?

Discuss all aspects of editing for ZDoom.
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

projectile flat/wall detection? possible?

Postby osjclatchford » Sat Sep 30, 2017 5:56 pm

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...
osjclatchford
 
Joined: 07 Feb 2011

Re: projectile flat/wall detection? possible?

Postby Nash » Sat Sep 30, 2017 11:14 pm

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.
User avatar
Nash
Nash Muhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 4 guests