• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Effects on Random point in unit group

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,229
The task the person is asking is impossible.
Unit groups do not have any retreivable position data as they are a collection of units (links). The only posssibly solution I can imagine is to use an n efficency algerthim to find the mid point (average position of all units in group) and then get the devation from it and then find a random position within that circle.

Did you mean...
"How do i trigger a spell in GUI that causes effects at the position of a random unit in a unit group? "
Well, blizzard provides a BJ which can retreive random units from a unit group that scales with an efficency of n (the number of units in group). After getting your random unit (or units if many), you then enumerate through them and get their positions.
Additionally you could map the group to a unit array and then use a random index to retreive a random unit from it.
 
Level 15
Joined
Jul 6, 2009
Messages
889
That would be an effect created at a random distance (between 0and 500), at a random angle:

  • Special Effect - Create a special effect at ((Position of (Triggering unit)) offset by (Random real number between 0.00 and 500.00) towards (Random angle) degrees) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,229
It is possible, like dota's Diabolic Edict which causes random explosions to a 500 aoe.
How do i trigger a spell in GUI that causes effects on random point in unit group?

Those 2 are not even slightly related.

Creating a random explosion in an Area is easy peasy, just get a random X and Y in the range of the area you want to affect...
Creating a random explosion at the position of a unit group is impossible as unit groups have no position...

What you want is possible, but what you were asking was not.
 
Status
Not open for further replies.
Top