- Joined
- Jun 9, 2008
- Messages
- 308
So on one of my maps I rely on units killing and consuming other units to stay alive, as they themselves gradually lose health.
However, it does not seem to work really well overall. One unit type occasionally does heal itself that way, but another (and yes, I checked, it has "cannibalism" as well, and belongs to the same NPC player) simply keeps on hunting or stands stupidly next to a juicy cadaver until it has starved to death.
I tried triggers to force "cannibalism", making the unit move to its own location, stop, repeatedly order "cannibalism", to no avail. I removed its attack to discourage going after dessert until it has finished its dinner.
Is there something inherent in the "cannibalism" ability, or triggering abilities in general, that I am missing here?
for reference, here is the trigger I use, though I am not convinced the trigger is really the problem, as I made the trigger in the first place precisely because the desired behaviour wasn't happening:
However, it does not seem to work really well overall. One unit type occasionally does heal itself that way, but another (and yes, I checked, it has "cannibalism" as well, and belongs to the same NPC player) simply keeps on hunting or stands stupidly next to a juicy cadaver until it has starved to death.
I tried triggers to force "cannibalism", making the unit move to its own location, stop, repeatedly order "cannibalism", to no avail. I removed its attack to discourage going after dessert until it has finished its dinner.
Is there something inherent in the "cannibalism" ability, or triggering abilities in general, that I am missing here?
for reference, here is the trigger I use, though I am not convinced the trigger is really the problem, as I made the trigger in the first place precisely because the desired behaviour wasn't happening:
-
Feasting
-
Ereignisse
-
Einheit - A unit dies
-
-
Bedingungen
-
(Owner of (Killing unit)) Equal Spieler 7 (Green)
-
-
Aktionen
-
Custom script: call RemoveLocation(udg_HerdLeaderPosition)
-
Set HerdLeaderPosition = (Position of (Dying unit))
-
Set Killer = No Unit
-
Set Killer = (Killing unit)
-
Einheit - Order Killer to Move to HerdLeaderPosition
-
Einheit - Set life of Killer to ((Life of Killer) + 5.00)
-
Einheit - Remove A Predator from Killer
-
Einheit - Order Killer to Stop
-
Einheit - Order Killer to Untoten-Ghul - 'Kannibalismus'
-
Einheit - Add Attack Out to Killer
-
Einheit - Order Killer to Move to HerdLeaderPosition
-
Einheit - Set Killer movement speed to 0.00
-
Einheit - Set Killer acquisition range to 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
'IF'-Bedingungen
-
(Life of Killer) Greater Than ((Max. Life of HerdLeader) / 1.20)
-
-
'THEN'-Aktionen
-
Einheit - Set Killer movement speed to ((Default movement speed of Killer) / 2.00)
-
-
'ELSE'-Aktionen
-
Einheit - Set Killer movement speed to (Default movement speed of Killer)
-
-
-
Custom script: call RemoveLocation(udg_HerdLeaderPosition)
-
Set Killer = No Unit
-
-