Angle Between Units

SouLEDGE

Damn you advanced calculus
Okay, well I don't quite know how to put this in words but let's refer
to another spell, Stealth Assassin's Backstab from Dota. How do you
check at what angle the sa hits the target so that the damage can be triggered?
 

tommerbob

Minecraft. :D
Whenever your unit deals damage or attacks, set a temporary point at a distance in front of him. Then check if his target is closer to the point than he is. If so, it means he is behind the target.
 

SouLEDGE

Damn you advanced calculus
Okay well it's not quite like that because I need to check from different angles
like the front, back and both left and right sides. I think I figured it out, just tell me quick is 0 degrees North when it comes to facing angle?
 

SouLEDGE

Damn you advanced calculus
Is this the same for Math - angle between units? So if unit A was north and
unit B is south then the angle between units is 90 degrees?
 

tommerbob

Minecraft. :D
Is this the same for Math - angle between units? So if unit A was north and
unit B is south then the angle between units is 90 degrees?
You could try testing it in game, use a debug message to show you the angle between units and see. ;)
 

DrEvil

FCRI Associate!
Is this the same for Math - angle between units? So if unit A was north and
unit B is south then the angle between units is 90 degrees?
yes it is :)

well from unit B to unit A the angle would be 90
from unit A to unit B the angle would be 270
 

SouLEDGE

Damn you advanced calculus
Okay well I tested it and it was 90 but when I switched the two units positions, so that A was South and B was North then it gave me -90? shouldn't it be 180?
 

vypur85

Hibernate
'Angle between points' gives angle between -180 and 180 degrees. 0, 90, 180/-180, -90, 0 are east, north, west, south and east, respectively.

'Facing angle' gives angle between 0 and 360 degrees. 0, 90, 180, 270, 360 are east, north, west, south and east, respectively.

Just need to positify the negative values. And make comparison. Like this:
Code:
Backstab
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Unit - Set life of (Triggering unit) to 100.00%
        Set Point1 = (Position of (Triggering unit))
        Set Point2 = (Position of (Attacking unit))
        Set Real1 = (Angle from Point2 to Point1)
        Set Real2 = (Facing of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Real1 Less than or equal to 0.00
            Then - Actions
                Set Real1 = (Real1 + 360.00)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Real2 Less than or equal to (Real1 + 45.00)
                Real2 Greater than or equal to (Real1 - 45.00)
            Then - Actions
                - [I]Do whatever you want here...[/I] -
                Special Effect - Create a special effect at Point1 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                Special Effect - Destroy (Last created special effect)
            Else - Actions
 

SouLEDGE

Damn you advanced calculus
Nope, cause my spell is cast from any direction the target faces and
depending on where the caster is, it does different this, like being in front
will cause the target to be stunned, being at the back will cause crits and
being on the side will slow the target
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • M Mulciberxp:
    My power has been off most of the last 2 days. We had a generator installed 3 years ago though, so we're staying warm. Water is another issue...
  • The Helper The Helper:
    Where I live has a pool so we are using that to get water to flush the toilets. We have enough bottled water to drink and brush teeth and stuff but it has been a few days and no shower though....
  • Varine Varine:
    I had some water in gallon jugs, and got our water back on yesterday. We don't seem to have any leaks, but I haven't crawled down there to look yet.
  • The Helper The Helper:
    still no water I cannot remember when I last showered now I know how they felt in the old west lol
  • Varine Varine:
    My poor plants are happy, they aren
  • Varine Varine:
    aren't used to going this long without water or lights or normal heat. I think a couple of them froze, but they look like they'll make it
  • Varine Varine:
    Well one of them is pretty rough but I think it was sick to begin with, that one always had some problems.
  • jonas jonas:
  • jonas jonas:
    ???
  • Ghan Ghan:
    That is such a Texas thing to say lol
  • midnight8 midnight8:
    a positive could come out of this. So many people trapped at home could put a dent in the covid numbers in Texas
  • Varine Varine:
    That dude, Tom Boyd, is really upset about the backlash from his "it's your fault you're freezing" thing because he claims he resigned before saying it, so it wasn't like he said it in his official capacity or anything.
  • jonas jonas:
    Almost as if he was saying "screw you guys, I'm going home"
  • Varine Varine:
    I'm fairly new here still but that seems to be the analogous message by several of our politicians.
  • vypur85 vypur85:
    Nobody?
  • jonas jonas:
    Hi vypur85, long time no see
  • tom_mai78101 tom_mai78101:
    Hi vypur85, long time no see.
  • The Helper The Helper:
    We are all somebody
  • Varine Varine:
    I kinda like being nobody tho.
  • The Helper The Helper:
    Voting for the NUON Controller Contest is open in the NUON-Dome NUON forum
  • vypur85 vypur85:
    Yeaaa! It's been a year since my last chat posting. Not that I chat a lot anyways.
  • vypur85 vypur85:
    Hope everyone is safe and sound throughout the pandemic.
  • The Helper The Helper:
    I think most of us that post here spend more time behind the computer then in places that we would catch coronavirus :)
  • Varine Varine:
    The bar I'm at is still requiring masks anyway, and most of the people that come there are pretty good about sanitizing their hands and shit.

    Staff online

    Members online

    Affiliates

    Hive Workshop NUON Dome
    Top