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?
 
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.
 
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
 
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?
 
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
 
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..
 
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
 
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.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top