• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Dummy projectiles encounter

Status
Not open for further replies.
Level 20
Joined
Jul 6, 2009
Messages
1,885
I have a problem with a spell that is similiar to fireball from "Warlock" map.
The thing is that 2 fireballs don't explode when they encounter and the problem is that function "pick all units..." doesn't pick locust units and my projectile dummy has locust (without it would look ugly) - How can i make them explode on encounter?
Help will be appreciated and rewarded with +rep :wink:
 
Level 9
Joined
Nov 4, 2007
Messages
931
I'm pretty sure someone made a function to pick locusted units already, search THW, but then again I'm really not sure that thats your problem with fireball, does it explode on contact with regular units?
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
When fireball is moving,it picks all units (and destructibles in this case) in an area around it,if there is unit around it,it will explode,but since "pick units" function doesn't pick locust units,it won't recognize the other fireball,since both fireballs are locust units,so they wont colide and explode.
I hope you understand...

EDIT: Seems you were right,i've found someone also asked this,and there's suitable answer too - solved
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
If you use the GroupEnumUnitsOfPlayer function then it will detect locust units. What you would want to do is loop through all the other players and see if there are any units in range of the locust projectile (using IsUnitInRange). The nice thing about this method is that the IsUnitInRange function factors unit-collision into its response, so if you have a unit with a huge collision (for example, a unit that is scaled up in size) it will still work as you want. In fact, this is how I do collision with my custom projectiles and it solves potential problems with having really large projectiles (though in my system you don't have to use a locust unit, so there is more room for error).
 
Level 10
Joined
Oct 5, 2008
Messages
355
Why don't you put all missile-dummis into a big unit group and check the range between the picked dummi and all other Dummis, except the picked one, in this group? Then, when the range is too low, both units will be killed. Of course, you have to add the Dummi into the group after it's created and it could create a bunch of lags or leaks if you forget to make the points as lokals or to destroy them when you use globals, but it could work this way.
 
Status
Not open for further replies.
Top