need help with co-ords

Synthetics

New Member
Reaction score
7
Hey peeps i hope your having a good week. I was wondering if anyone knows how to cause damage in a region which is not previously made in WE basically im tryiong to make an attribute based shock wave i i've got it working but my the damage is dealt via distance between 2 points (caster & target point of ability being cast) how ever this damages every unit between that point so i was wondering if anyone knew how to use convert points to region so i can can damage the correct area that the shockwave missle would cover.

many thanks
 
Reaction score
456
JASS:
function GroupEnumUnitsInLine takes group g, real x1, real y1, real x2, real y2, real width returns nothing
    local real angle = Atan2(y2-y1,x2-x1)
    local real dist = SquareRoot( (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1) )
    local real cdist = 0
    local group temp
    loop
        exitwhen (cdist > dist)
        set temp = CreateGroup()
        call GroupEnumUnitsInRange(temp,x1,y1,width/2,null)
        set bj_wantDestroyGroup = true
        call GroupAddGroup(temp,g)
        set x1 = x1+((width/4)*Cos(angle))
        set y1 = y1+((width/4)*Sin(angle))
        set cdist = cdist + (width/4)
    endloop
    set temp = null
endfunction


Can you understand JASS? Well, if you do, this is almost the easiest way.
 
O

Orcses

Guest
You mean like set the position of the targeted unit to a point variable then have a temporary region move to the point? You could also use "unit within range" if you didn't want to move a region. Do you allready have the distance done in damage figured out?
Edit: oops allready been answered
 

Synthetics

New Member
Reaction score
7
thanks guys unfortunately i cant understand jass but looking at what you've written i shall check out the mathmatics tutorial and see if i can work with angles and cos sine :)
 

TheCrystal

New Member
Reaction score
36
Damage in region?

Set TGROUP = (Every unit in (region))
Pick every unit in TGROUP and do Actions
- loop
- Order No Unit to damage (Picked unit) XXX damage with the attack type <Whatevers here>
Custom Script = DestroyGroup (udg_TGROUP)

Not sure if you have to destroy groups..
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top