how should I go about doing this?

CaptDeath

New Member
Reaction score
103
coneexample.jpg

red equals unit within the cone the squrres are units the big X is the unit with cleave how do i pick the units within the red circle?
cause after i do that i will pick a random 3 of those just how do i get the big V of unit selection?
 

yunusowic

New Member
Reaction score
7
Trigger:
  • Deneme
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Unit-type of (Attacking unit)) Equal to <Your unit>
    • Actions
      • Unit Group - Pick every unit in (Random 3 units from (Units within <AoE of your skill> of (Position of (Triggering unit)))) and do (Actions)
        • Loop - Actions
          • -------- Your actions --------


I dont know if this will work for you. It picks random 3 unit when an enemy is attacked by your hero.

Edit : You should use Units in range matching condition if you want to pick certain units.
 

perkeyone

something clever
Reaction score
71
make a square region
once the spell activates
move the region to the position of the cleave unit
offset by some_distance to (the unit's facing - some_angle)
then add all the units to a unit group
then move the region slightly
using the same offset but with an increased angle
again, add the units if they are not already in the group
then move it again
etc
until you get to (unit facing + some_angle)

basically
you make a region
and sweep it across an angle
and add all the units to a group

some_distance is the range of your unit's attack i guess
and some_angle is (half) the angle you would like the attack to affect

example

event
unit is attacked

condition
level of cleave for attacking unit greater than 0

actions
for each integer A from 1 to 5
__do move cleave_region to position of attacking unit offset by 100 to (((integer A -3) * 5) + facing of attacking unit)
__pick every unit in cleave_region and do
____if picked unit not in cleave_group add picked unit to cleave group
DO YOUR ACTIONS HERE
THEN EMPTY THE UNIT GROUP
 

CaptDeath

New Member
Reaction score
103
thanks perkeyone im understanding what your saying but hat dosent sound very mui
maybie ill create the rects in jass


btw would that leak(any jasser know?)
that is creating and using rects 3 times per time ran?
 

ShadowInTheD

Active Member
Reaction score
12
The rect wouldn't leak. The point you move the rect to would leak, as well as the unit group.

Unless you use reals for the rect
 

ShadowInTheD

Active Member
Reaction score
12
To clean the unit group:

call DestroyGroup(udg_<Group>)

Honestly, I'm trying to think of a completely different way to do this, but if this way works, great.
Code:
Unit Group - Pick every unit in (Units within 512.00 of (Center of (Playable map area)) matching ((Angle from ((Center of (Playable map area)) offset by 512.00 towards ((Facing of (Triggering unit)) + -22.50) degrees) to ((Position of (Triggering unit)) offset by 512.00 towards ((Facing of  and do (Actions)
    Loop - Actions

You can change the range to what ever you like, I don't know if this will work or not either..
 

perkeyone

something clever
Reaction score
71
thanks perkeyone im understanding what your saying but hat dosent sound very mui
maybie ill create the rects in jass


btw would that leak(any jasser know?)
that is creating and using rects 3 times per time ran?

i think mine would be mui as long as there were no waits in the actions you specify
all you need to add to it is some anti leak stuff
like shadowinthed said
 

takethat

Active Member
Reaction score
12
if i not wrong, you cant move preplace region, either u play with the unit with range with polar offset, or u do it will jass
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top