HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Facing Angle

11-06-2004, 09:06 PM#1
MaLiCiOuS-NeXuS
I need help please, How do you make that when a unit gets attacked from the back gets additional damage?
11-07-2004, 12:50 AM#2
Anitarf
This is a c&p of a backstab trigger from my map, slightly edited so it uses the new damage unit action:

Code:
backstab
    Events
        Unit - A unit Is attacked
    Conditions
    Actions
        Set TempPoint1 = (Position of (Attacking unit))
        Set TempPoint2 = (Position of (Attacked unit))
        Set TempInteger = (Integer((Angle from TempPoint1 to TempPoint2)))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        And - All (Conditions) are true
                            Conditions
                                ((Facing of (Attacked unit)) - (Real(TempInteger))) Greater than or equal to -45.00
                                ((Facing of (Attacked unit)) - (Real(TempInteger))) Less than or equal to 45.00
                        ((Facing of (Attacked unit)) - (Real(TempInteger))) Less than or equal to -315.00
                        ((Facing of (Attacked unit)) - (Real(TempInteger))) Greater than or equal to 315.00
            Then - Actions
                damage attacked unit (the new damage trigger action)
            Else - Actions
                do nothing
        Custom script:   call RemoveLocation( udg_TempPoint1 )
        Custom script:   call RemoveLocation( udg_TempPoint2 )
11-07-2004, 07:15 AM#3
MaLiCiOuS-NeXuS
I don't know how to make this part.
((Facing of (Attacked unit)) - (Real(TempInteger))) Greater than or equal to -45.00
11-07-2004, 08:40 AM#4
th15
Condition> Arithmetic> Real Comparison> Conversion: Integer to Real

Those are the relevant sub categories.

Anitar, you realise that it's pretty silly to do a real conversion on a variable that could be stored as a real value in the first place, right? Right now, you're taking a real variable and converting it to integer to store it, then you're converting it back to a real value before using it.
11-07-2004, 09:21 AM#5
MaLiCiOuS-NeXuS
doesn't seem to work :(
11-07-2004, 10:51 AM#6
Anitarf
Quote:
Originally Posted by th15
Condition> Arithmetic> Real Comparison> Conversion: Integer to Real

Those are the relevant sub categories.

Anitar, you realise that it's pretty silly to do a real conversion on a variable that could be stored as a real value in the first place, right? Right now, you're taking a real variable and converting it to integer to store it, then you're converting it back to a real value before using it.
Yeah, i know. As I said, it's a c&p, and in the map, I already had an integer variable handy, and I didn't feel like creating another real one.


Quote:
Originally Posted by MaLiCiOuS-NeXuS
doesn't seem to work
Well, what did you do? Can you post anything you have done? You are not being very helpful.