Jump to content

How to detect my last kill


argent77

Recommended Posts

I’ve written a creature script which simulates a hunter. The creature should look for animals in the area and attack them when found. This part works well already, but I have trouble to detect when the animal has been killed by the attacker.

 

This is the basic script for my creature. The last block doesn’t get executed however.

// *** No target in sight ***
IF
   Detect([PC])
   !See([0.ANIMAL.0.0.0.0.0])
THEN RESPONSE #100
   RandomWalk()
END

// *** Action when target is in sight ***
IF
   Detect([PC])
   See([0.ANIMAL.0.0.0.0.0])
THEN RESPONSE #100
   AttackReevaluate(LastSeenBy(Myself), 30)
   Continue()
END

// *** Action when target has been killed (doesn't work) ***
IF
   Killed(LastSeenBy(Myself))
THEN RESPONSE #100
   DisplayStringHead(Myself, 74156)
END

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...