Nearest[ENEMY]
Mathsorcerer
Member Posts: 3,042
Is it just me or is Nearest([ENEMY]) not working when I try to use it in a script? I can get NearestEnemyOf(Myself) or LastSeenBy(Myself) to work just fine but the one referencing the EA IDS doesn't appear to work. Other things do seem to work, such as See([ENEMY.0.0.MAGE]).
Similarly, I was introducing our 10-year-old son to scripting--bright kid--and we couldn't gett See([0.0.0.FAIRY_SIRINE]) to work but if I removed that line the rest of his script worked perfectly.
Or...is this a known issue and I missed that main thread? Anyway....if any of you have any insights or inside knowledge I would appreciate it.
Similarly, I was introducing our 10-year-old son to scripting--bright kid--and we couldn't gett See([0.0.0.FAIRY_SIRINE]) to work but if I removed that line the rest of his script worked perfectly.
Or...is this a known issue and I missed that main thread? Anyway....if any of you have any insights or inside knowledge I would appreciate it.
0
Comments
IF
Heard([ANYONE],111)
THEN
RESPONSE #100
MoveToObject(NearestEnemyOf(Myself))
END
IF
AttackedBy([GOODCUTOFF],DEFAULT)
!Allegiance(Myself,ENEMY)
THEN
RESPONSE #100
Enemy()
END
IF
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END
IF
AttackedBy([ANYONE],DEFAULT)
THEN
RESPONSE #100
Attack(LastAttackerOf(Myself))
END
IF
See([ENEMY])
THEN
RESPONSE #100
Attack(NearestEnemyOf(Myself))
END
This works but if I replace it with
IF
See([ENEMY])
THEN
RESPONSE #100
Attack(Nearest([ENEMY])
END
it doesn't work.
NearestEnemyOfType([ENEMY.0.0.CLERIC_ALL]) does. NearestMyGroupOfType also works fine. It's possible that BGEE addressed the top-block usage of Nearest, but overlooked its bottom extensions.
In the script you have above, try using:
Attack(LastSeenBy(Myself)) instead of Attack(Nearest([ENEMY])) and you'll be golden.
My wife thinks I am making certain parts too difficult, but I have been upgrading certain encounters so that the characters have a better balance of spells and use them correctly. Davaeorn will now use Stoneskin and Improved Invisibilty but if you don't defeat him quickly enough he will go up to the first level of the mine and flood it with you inside. I had Mulahey opening up with Unholy Blight if the party's alignment is good but the first time I tried it he killed 4 out of 6 people, so I had to take that out, going back to Rigid Thinking, Hold Person, and Silence 15' Radius. There were also some loops in Mulahey's dialog that I fixed. Nimbul will Haste himself, use Horror and Web on you, then starts throwing poisoned daggers. I haven't gotten to other specific encounters yet but this is a work in progress.
Since I don't download and use other people's mods I have to do something to fix little things in the game I think should be improved.