HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Group units in range problem.

04-14-2007, 02:36 AM#1
Amaroqwlf
I'm having a little issue. call GroupEnumUnitsInRange seems to have less range than a spell or call UnitDamagePoint with the exact same range.

When I initially cast my channel spell, the circle that appears (with an AoE equal to my GroupEnumUnitsInRange) will highlight units which do not receive damage in my trigger. The units closer to the center will receive damage as normal. UnitDamagePoint seems to work perfectly fine in relation the the spell's graphics, which I was using initially. I switched to damaging the units in a group so that I could specify the targets that would be hit. Everything else is working but this little discrepancy is bothering me.

Does anyone know why this occurs? A remedy would be nice, as well, such as the exact number difference between GroupEnumUnitsInRange and what is shown by the spell's targeting graphics.

EDIT: If this is a new error, I can attach my map or show my spell's script.
04-14-2007, 02:55 AM#2
Rising_Dusk
Add 30 to the group enum range.
That usually makes it pretty darned accurate in all of my spells.

The AOE circles group those that are partially inside the radius, while the groupenum only groups those whose CENTER COORDINATE are in the radius.
That's the reason this happens.
04-14-2007, 03:51 AM#3
Amaroqwlf
I see. I figured that was the problem. Is there something I can do check if any part of the unit is in the AoE, rather than just using center coordinates? If not, I suppose estimation will have to be good enough. Perhaps there's something to check the unit's collision size/selection size (however it determines if a part of the monster is in the AoE) and then I could use a bigger circle and check if units at the outer edge have a size large enough to fit in the AoE.
04-14-2007, 05:26 AM#4
Rising_Dusk
No, just add like 30-40 to the radius and it'll work the same.
That's about the best you can do, and to be fair it works perfectly.

I can't think of any case when getting units by center coords would be functionally any different than by collision spheres.
04-14-2007, 06:21 AM#5
Pyrogasm
If you had a fuckin' huge unit?

Or just a large unit that was near the edge of the circle.
04-14-2007, 06:21 AM#6
grim001
You could actually create a method of finding the collision radius of each unit (i.e. attach it or store it in some array by unit type)...

and then add the highest collision radius to your groupenumunitsinrange so that it definately finds all of them...

and then for each unit you find, check if the distance from the point is less than or equal to YourSpell'sRadius + Unit'sCollisionRadius.

Whether you would bother with that or not depends on how exact you need it to be.

Assuming all of your units have 32 collision radius like most units do, it would also be exact to do GroupEnumUnitsInRange with your spell's radius + 32
04-14-2007, 08:26 AM#7
blu_da_noob
You could try the method Vex uses in the Caster System. I haven't actually tried it myself, but I assume it works or he wouldn't use it :P. Basically it uses the IsUnitInRange(unit,position) function which must apparently take collision size into account.