Making the hitbox 2D for hitscans

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

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.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
N00b
Posts: 12
Joined: Sat Mar 04, 2023 8:33 am

Making the hitbox 2D for hitscans

Post by N00b »

Hello everyone!
Is it possible to make an actor that is "infinitely tall" when it comes to checking LineTracer intersections with it? I would like to somehow register hitscan attacks that fly *under* an actor's Doom hitbox. This can happen even if the actor is standing on a solid floor, namely if the floor is sloped.

If it is not possible, then another question: can an actor's hitbox be partially submerged into the floor yet still traceable by hitscans? I tried to use something like
mo.A_ChangeLinkFlags(sector: true); mo.UnlinkFromWorld(); mo.SetXYZ(mo.pos - (0, 0, 8)); mo.LinkToWorld();
but to no avail, the actor still stays on the floor and is not submerged (however https://zdoom.org/wiki/SetXYZ says that the floor/ceiling heights need to be adjusted manually after unlinking/linking). My specific actor needs not be solid, it can have +NOGRAVITY and +NOCLIP, the only requirement is for it to work with LineTracers (so +NOBLOCKMAP would not be an option).
yum13241
Posts: 853
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support

Re: Making the hitbox 2D for hitscans

Post by yum13241 »

You could make it "explode" with +OLDRADIUSDMG.
N00b
Posts: 12
Joined: Sat Mar 04, 2023 8:33 am

Re: Making the hitbox 2D for hitscans

Post by N00b »

Thanks, I had considered that option but used a BlockThingsIterator since it is also 2D and has fewer side effects to deal with.

Return to “Scripting”