- Joined
- Jul 7, 2010
- Messages
- 709
I need an GUI method for an back stab, +REP
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Events

Unit - Peasant 0000 <gen> Takes damage
Events

Unit - A unit Is attacked
Conditions

(Facing of (Triggering unit)) Less than ((Facing of (Attacking unit)) - 40.00)

(Facing of (Triggering unit)) Greater than ((Facing of (Attacking unit)) + 40.00)
Actions
Attack GUI Copy Copy 2

Events


Unit - A unit Is attacked

Conditions

Actions


-------- -------------------------------------------------- --------


-------- Set unit variables --------


-------- -------------------------------------------------- --------


Set u1 = (Attacking unit)


Set u2 = (Triggering unit)


-------- -------------------------------------------------- --------


-------- Set location variables --------


-------- -------------------------------------------------- --------


Set p1 = (Position of u1)


Set p2 = (Position of u2)


-------- -------------------------------------------------- --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(Cos(((Angle from p1 to p2) - (Facing of u2)))) Greater than 0.00



Then - Actions




Game - Display to Player Group - Player 1 (Red) the text: Backstab!



Else - Actions


-------- -------------------------------------------------- --------


-------- Clear leaks --------


-------- -------------------------------------------------- --------


Custom script: call RemoveLocation(udg_p1)


Custom script: call RemoveLocation(udg_p2)
But I thought that solution works and is more efficient although I have not tested it.
Also Maker I don't see why you would need to put the units in a variable.....
Events

Unit - A unit Is attacked
Conditions

(Facing of (Triggering unit)) Less than ((Facing of (Attacking unit)) + 40.00)

(Facing of (Triggering unit)) Greater than ((Facing of (Attacking unit)) - 40.00)
Actions