@cmorgan, @jcompton or @camdawg - What is the WeiDU COMPILE command for a BS? I just used BCS and then manually changed the extension after it compiled. I needed the test strings.
Confirmed Fixed:) (0813) Can't argue with a picture. So excited to use this now!
@SethDavis You are a genius! If those other 'nth' things pop up ... however you fixed this can be applied to them. Still havent tested all the 'nth' possibilities... but this was the one that never worked right at all in BG1/BG2. Might have to go through some of my old combat scripts and update them.
Still downloading the beta. Can you test something like this to see if it "cascades outwards" (stole that term from IESDP) correctly, with just 2 skeletons :
IF HotKey(D) THEN RESPONSE #100 ActionOverride(TenthNearestEnemyOfType([0.UNDEAD]),DisplayStringHead(Myself,~So far away from you - Mark Knopfler~)) END
That should display the string on 2nd skeleton if I'm not mistaken.
@lansounet That 'would have' displayed the string on the last... but no longer. Now it will correctly display on the SecondNearestEnemyOfType. This will enable specific targetting as it was all messed up before. If you need to test an enemy that is far away, then I suggest using a Range check along with the more simple NearestEnemyOf(Myself). But sure... I can test that to verify.
Edit: yes, Tenth displays that string and it is the tenth nearest.
Late to the party, but I wanted to drop a note about how this is supposed to work:
For the nthNearestEnemyOfType(), the farthest matching object from the caller is returned, out to the nth place. If there are fewer than 'n' matching objects on screen, then the closest one is still returned (i.e., as long as there's any actor you consider an enemy onscreen, then it will match). The only time nothing will match is if there are no visible enemies at all. (You can see this in the behavior of the nthNearest() objects, which do work.)
Although nthNearestEnemyOfType() and nthNearestMyGroupOfType() weren't used in BG, they did see some use in ToB IIRC. And they're probably used in custom AI, even though they never worked right.
@devSin - yep, you should listen to @Bhryaen. You'd be surprised how much stuff that you originally reported lies waiting for you in our dark chambers...
Btw, I can't seem to understand if the current post-fix behavior is the same as @devSin is describing. It looks like it, but my knowledge of IE mechanics is so close to zero as it makes no difference, so I wouldn't stake my life on the accuracy of my assessment...
Speaking of which ... is @DavidW aware? He might be interested in using this command in his AI scripts, now that it finally works (though of course it would only be applicable to BG:EE-compliant versions of his mods).
Comments
@SethDavis You are a genius! If those other 'nth' things pop up ... however you fixed this can be applied to them. Still havent tested all the 'nth' possibilities... but this was the one that never worked right at all in BG1/BG2. Might have to go through some of my old combat scripts and update them.
I'm no modder and have no insight on IE scripting, but jeez am I stoked to see engine bugs fixed!!!
Edit: yes, Tenth displays that string and it is the tenth nearest.
For the nthNearestEnemyOfType(), the farthest matching object from the caller is returned, out to the nth place. If there are fewer than 'n' matching objects on screen, then the closest one is still returned (i.e., as long as there's any actor you consider an enemy onscreen, then it will match). The only time nothing will match is if there are no visible enemies at all. (You can see this in the behavior of the nthNearest() objects, which do work.)
Although nthNearestEnemyOfType() and nthNearestMyGroupOfType() weren't used in BG, they did see some use in ToB IIRC. And they're probably used in custom AI, even though they never worked right.
Wish you were testing it with us then :-P
Btw, I can't seem to understand if the current post-fix behavior is the same as @devSin is describing. It looks like it, but my knowledge of IE mechanics is so close to zero as it makes no difference, so I wouldn't stake my life on the accuracy of my assessment...