Author Topic: Quick question about behaviour of GetObjectByTag  (Read 346 times)

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Quick question about behaviour of GetObjectByTag
« on: May 25, 2015, 12:12:07 pm »


               

If I have a number of objects with the same tag I can step through them one by one by using the nNth parameter of the GetObjectByTag function. This will find all objects with the same tag including those that are not in the current area. The thing is there is something all versions of the lexicon are unclear on. Which finally brings me to my question - Does this function step through all the objects with the same tag in the current area first before returning objects not in the current area? Or is there different scheme at work here?


 


TR



               
               

               
            

Legacy_Tchos

  • Sr. Member
  • ****
  • Posts: 454
  • Karma: +0/-0
Quick question about behaviour of GetObjectByTag
« Reply #1 on: May 25, 2015, 12:39:35 pm »


               

Experience says it steps through them based on which was created first, not whether they're in the same area as the object calling the script.  GetNearestObjectByTag does the latter.



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Quick question about behaviour of GetObjectByTag
« Reply #2 on: May 25, 2015, 11:40:49 pm »


               

Thanks. Just means a minor re-jig of the routine. Everything is looking OK (so far...).


 


TR



               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Quick question about behaviour of GetObjectByTag
« Reply #3 on: May 26, 2015, 12:21:37 am »


               

To the best of my understanding, the order they are returned in, is determined by object type and has nothing to do with the area they are in.   


 


So if a waypoint is returned before a placeable.   All waypoints will always be returned before Placeables. 



               
               

               
            

Legacy_Tarot Redhand

  • Hero Member
  • *****
  • Posts: 4165
  • Karma: +0/-0
Quick question about behaviour of GetObjectByTag
« Reply #4 on: May 26, 2015, 01:52:56 am »


               

Since I am writing this for some placeables that I have made, I have control over the tag that they all share. So I shouldn't have any problem with any other type of object. Thanks for the clarification though.


 


TR