Author Topic: GetObjectByTag problem/limitations?  (Read 581 times)

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
GetObjectByTag problem/limitations?
« on: February 17, 2016, 08:16:37 pm »


               

Does anyone know why GetObjectByTag looping through the entire module would be dependent on whatever area the PC is in?  The script is called from a conversation, but does not rely on the PC's location at all.  Usually it finds all of the objects with a specific tag (132 at present) but if the script is called in one specific area, it will only find 2 objects.


 


Any idea what could be causing this?



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
GetObjectByTag problem/limitations?
« Reply #1 on: February 17, 2016, 11:11:47 pm »


               The normal behaviour is as you describe, so my first instinct is to look for a script error (please post), or a bug in the rogue area which removes the other instances (for debugging. perhaps).


The Lexicon seems to imply that the order of results is area-dependent (I haven't tested this), but the number of instances found should be constant.


http://www.nwnlexico...=GetObjectByTag
               
               

               
            

Legacy_3RavensMore

  • Hero Member
  • *****
  • Posts: 1153
  • Karma: +0/-0
GetObjectByTag problem/limitations?
« Reply #2 on: February 18, 2016, 12:37:18 am »


               

I think it has something to do with the area.  The somewhat weighty script finds and processes all the desired objects--even the ones in the possibly borked area--but only when called outside of that one area.  I tested the script in about twenty other areas now, and it works fine.  I thought it was do to the area being very large and full of placeables, but I've bigger areas that have more stuff in them, and they all work fine.  It's more of a, "why is this happening" over something that will cause any issues in the game--the script shouldn't ever be called from that area anyway.