HerrSvensson Posted February 12, 2013 Posted February 12, 2013 Here is an example of a script I just did to test if the AI would react to being attacked by different enemies: IF AttackedBy(NearestEnemyOf(),DEFAULT) THEN RESPONSE #100 DisplayStringHead(NearestEnemyOf(),40734) Continue() END IF AttackedBy(SecondNearestEnemyOf(),DEFAULT) NumCreatureGT([ENEMY], 1) THEN RESPONSE #100 DisplayStringHead(SecondNearestEnemyOf(),40735) Continue() END IF AttackedBy(ThirdNearestEnemyOf(),DEFAULT) NumCreatureGT([ENEMY], 2) THEN RESPONSE #100 DisplayStringHead(ThirdNearestEnemyOf(),40736) Continue() END What is weird about this script is that it works only after I set the script in combat. By that I mean, when I am outside of combat, and activate the script and then go to combat, nothing happens. But when I set the script when combat has started, it works like expected. Does anyone know how to make it work regardless of whether you're in combat or not?
Gwendolyne Posted February 17, 2013 Posted February 17, 2013 IESDP is your friend : 0x4083 CombatCounter(I:Number*) This trigger does may not work as expected. Returns true only if the combat counter (counts down from 150 after each attack) is of the value specified. CombatCounter(0) returns true only if there is no combat in the active area at the moment. CombatCounter can give false results after dialog has been completed or after a Hide in Shadows check has been failed.
HerrSvensson Posted February 22, 2013 Author Posted February 22, 2013 IESDP is your friend : 0x4083 CombatCounter(I:Number*) This trigger does may not work as expected. Returns true only if the combat counter (counts down from 150 after each attack) is of the value specified. CombatCounter(0) returns true only if there is no combat in the active area at the moment. CombatCounter can give false results after dialog has been completed or after a Hide in Shadows check has been failed. I didn't use CombatCounter. How does this information help?
argent77 Posted February 23, 2013 Posted February 23, 2013 You are using NearestEnemyOf without an argument. Try using NearestEnemyOf(Myself).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.