Page 1 of 1

possible bug in spellcaster attack script

Posted: Sat Jun 09, 2001 11:48 am
by Lucian_Garland
ive noted when spellcaster attack script is on, my chars with it, occassionally attacks my main char..who is a cavalier. pretty annoying if i cant tell keldorn to go whack mages or priest with his carsomyr without him hitting me.

Posted: Sat Jun 09, 2001 11:35 pm
by Hobbes82
Don't mean to be rude, But your post dosn't make alot of sence. Try rewording it , and you will probably get a reply that is worth it. Have a great day!! :p :p

Posted: Sun Jun 10, 2001 3:29 am
by Lucian_Garland
as i meant, WHEN i set the spellcaster attack scrip on one of my npc's, ive noted that the npc will occassionally attack my main char, who is a cavalier. I especially use the spellcaster attack combat script with keldorn, because he use carsomyr.

the spellcaster attack script sets the char to go for enemy spellcasters, supposedly.

Posted: Sun Jun 10, 2001 11:55 pm
by KensaiRyu
I will take a look at this script and tell you why this is happening.

Posted: Mon Jun 11, 2001 12:10 am
by KensaiRyu
Heres the script:
_____________________________________________
IF
ActionListEmpty()
OR(4)
See(NearestEnemyOfType([0.0.0.LONG_BOW]))
See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
See(NearestEnemyOfType([0.0.0.BARD_ALL]))
!Range(LastSeenBy(Myself),10)
THEN
RESPONSE #100
EquipRanged()
AttackReevaluate(LastSeenBy(Myself),30)
END

IF
ActionListEmpty()
OR(4)
See(NearestEnemyOfType([0.0.0.LONG_BOW]))
See(NearestEnemyOfType([0.0.0.CLERIC_ALL]))
See(NearestEnemyOfType([0.0.0.DRUID_ALL]))
See(NearestEnemyOfType([0.0.0.BARD_ALL]))
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackReevaluate(LastSeenBy(Myself),30)
END

IF
ActionListEmpty()
Help([PC])
THEN
RESPONSE #100
AttackReevaluate(LastAttackerOf(LastHelp(Myself)),60)
END

IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
!Range(NearestEnemyOf(Myself),10)
THEN
RESPONSE #100
EquipRanged()
AttackReevaluate(NearestEnemyOf(Myself),30)
END

IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
EquipMostDamagingMelee()
AttackReevaluate(NearestEnemyOf(Myself),30)
END
_____________________________________________

The problem is in this line right here:
AttackReevaluate(LastSeenBy(Myself),30)

The last seen by sometimes changes from an enemy to an ally during combat thus causing your friendly fire. I can update this script so this no longer happens and send it to you if you want.Email me if you want this done it would take about 20 seconds.

AstroBouncer@Aol.com

Posted: Mon Jun 11, 2001 1:28 am
by Lucian_Garland
sounds good, i emailed you with my adress. you should send the updated version to kevin dorner as this is a bug in the game.

Posted: Mon Jun 11, 2001 12:31 pm
by KensaiRyu
I sent you a script that checks if the last seen by is not in the party before attacking. Let me know how it works as I dont have time to test. If it works good then I will send it to Kevin Dorner.

If it dosent work then email me or post and I will rewrite the script to utilize a different targeting than Last seen by.

Posted: Mon Jun 11, 2001 12:39 pm
by Lucian_Garland
ive gotten the script..but unfortunately i wont have much time to play bg2 over the next week..i think youre better having another testing it