| 10-21-2009, 06:26 PM | #1 |
I have an idea for a script which involves a mobile region, but I can't figure out how to do it. One scenario for the use of such a script would be as follows: Imagine that just by glance your Hero strikes mortal fear into his enemies. Whenever an enemy unit enters such a region the unit would flee in terror. This could be done by adding sounds and animations. What I think is that in order for this to work the region would have to move in exact correspondence with the position of the Hero. Does anyone have any ideas? Is there an easier way to do this? Perhaps some function that measures the distance between units and then initiates a sequence of commands that would provide the appropriate responses? |
| 10-21-2009, 06:31 PM | #2 |
Moving regions dynamically is completely impossible, last I remember... If the only purpose of the region is to detect when units are near the hero (which is basically the only real use for regions, last time I checked...) then you can use the GroupEnumUnitsInRange native to enumerate all of the units near the hero every __ seconds. (For something like this, 0.2 or 0.1 would likely be enough.) |
| 10-21-2009, 06:33 PM | #3 |
Thank you. I'm not familiar with JASS at all. So... I guess I'll have to learn. Do you think that script would be difficult to make? |
