Skip to content

[(BG1\2) BUG] nthNearestEnemyOfType objects (51-59) not working properly. (0813)

2»

Comments

  • CuvCuv Member, Developer Posts: 2,535
    @Wisp Thank you!!! Sorry I didnt mention you for the question.
  • SethDavisSethDavis Member Posts: 1,812
    Potentially fixed - If the function doesn't find enough enemies it no longer goes down the list until it finds one.
  • CuvCuv Member, Developer Posts: 2,535
    @SethDavis Awesome stuff!!! Will test this next build
  • CamDawgCamDawg Member, Developer Posts: 3,438
    Cuv said:


    @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.

    The easiest hack I've seen is something like
    COPY ~path/to/my/foo.baf~ ~scripts/foo.bs~
    COMPILE_BAF_TO_BCS
  • CuvCuv Member, Developer Posts: 2,535
    Thanks @CamDawg:)
  • cmorgancmorgan Member Posts: 707
    Sweeeet. Simple, hacky, and useful.
  • CuvCuv Member, Developer Posts: 2,535
    edited August 2012
    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.
  • lansounetlansounet Member Posts: 1,182
    edited August 2012
    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.
  • AndreaColomboAndreaColombo Member Posts: 5,525
    @SethDavis You are a genius!
    +1.

    I'm no modder and have no insight on IE scripting, but jeez am I stoked to see engine bugs fixed!!!
  • CuvCuv Member, Developer Posts: 2,535
    edited August 2012
    @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.
  • TanthalasTanthalas Member Posts: 6,738
    This should be in the Confirmed Fixed subforum.
  • devSindevSin Member Posts: 32
    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.
  • BhryaenBhryaen Member Posts: 2,874
    @devSin
    Wish you were testing it with us then :-P
  • AndreaColomboAndreaColombo Member Posts: 5,525
    edited August 2012
    @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...
  • CuvCuv Member, Developer Posts: 2,535
    @AndreaColombo and @devSin Yes, this finally works correctly now:D Much of this thread was purged due to the NDA.
  • frossfross Member Posts: 12
    What different software do you mainly use to edit Baldurs Gate scripts and files. Any links would be greatly appreciated
  • AndreaColomboAndreaColombo Member Posts: 5,525
    Cuv said:

    Yes, this finally works correctly now

    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).
Sign In or Register to comment.