argent77 Posted July 26, 2010 Share Posted July 26, 2010 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
Miloch Posted August 24, 2010 Share Posted August 24, 2010 Might want to try a StateCheck(LastSeenBy(),STATE_REALLY_DEAD) instead of the Killed() trigger. And then you want to put a variable check in there to make sure it doesn't loop endlessly. Link to comment
jastey Posted August 24, 2010 Share Posted August 24, 2010 I think you have to tell what the "lastSeenByMyself" is suppposed to be. Does it work if you add the "See([0.ANIMAL.0.0.0.0.0])" into that scriptblock. And what Miloch said. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.