Overlapping BlockThingsIterator Detection

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!)
XLightningStormL
Posts: 389
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here

Overlapping BlockThingsIterator Detection

Post by XLightningStormL »

Hi all,

I've been trying to integrate a dynamic radiation actor object for a while and hit all sorts of roadbumps until I finally got *something* functional for what I want.

However there is an issue where If two of these actors overlap you get double the effect, I only want one effect at a time. Technically there is also another issue where the radius of the effect isn't square - but that's probably more due to BlockThingsIterator using a cylinder than a square and probably can't be resolved.

File included below, including the actors, and test map (replacing MAP01) - the giant cross near the middle of the map will show the overlapping issue, just travel from left to right (map wise, not perceptionally)
You do not have the required permissions to view the files attached to this post.
User avatar
phantombeta
Posts: 2110
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Overlapping BlockThingsIterator Detection

Post by phantombeta »

XLightningStormL wrote: Fri Jun 14, 2024 6:43 am Technically there is also another issue where the radius of the effect isn't square - but that's probably more due to BlockThingsIterator using a cylinder than a square and probably can't be resolved.
That's because BlockThingsIterator doesn't do any distance checks on the actors. The "distance" argument is only used to determine which blockmap blocks it touches, but it gives you all actors inside those blocks. You need to do any distance or bounds checks yourself.

Return to “Scripting”