A
ADNORM
Guest
I am working on a unit ability for knights that allows them to trample ground units, but I have encountered two problems:
1) I turned off collision for the knights so that they walk through instead of around other units, but I want them to still treat walls as solids.
2) I am having trouble detecting collision from the front only. When a knight passes to the side of a unit it shouldn't kill it.
I haven't given much thought to problem #1, but here's what I have so far for #2:
For those of you too lazy to scroll to the right, the condition specifies that the angle between the knight and the entering unit be between +15 and -15 of the knights facing angle.
The problem I still have is that the trigger only kills the unit sometimes, other times the knight walks right through them and they dont die. Any thoughts?
1) I turned off collision for the knights so that they walk through instead of around other units, but I want them to still treat walls as solids.
2) I am having trouble detecting collision from the front only. When a knight passes to the side of a unit it shouldn't kill it.
I haven't given much thought to problem #1, but here's what I have so far for #2:
Code:
Trample:
Events
Unit - A unit comes within 128.00 of Knight 0000 <gen>
Conditions
And - All (Conditions) are true
Conditions
(Entering unit) Not equal to Knight 0000 <gen>
((Angle from (Position of Knight 0000 <gen>) to (Position of (Entering unit))) Greater than or equal to ((Facing of Knight 0000 <gen>) - 15.00)) and ((Angle from (Position of Knight 0000 <gen>) to (Position of (Entering unit))) Less than or equal to ((Facing of Knight 0000 <gen>) + 15.00))
Actions
Unit - Kill (Entering unit)
The problem I still have is that the trigger only kills the unit sometimes, other times the knight walks right through them and they dont die. Any thoughts?


