Aller au contenu

Photo

Quick question about behaviour of GetObjectByTag


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Tarot Redhand

Tarot Redhand
  • Members
  • 2 684 messages

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



#2
Tchos

Tchos
  • Members
  • 5 064 messages

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.


  • Proleric aime ceci

#3
Tarot Redhand

Tarot Redhand
  • Members
  • 2 684 messages

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

 

TR



#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

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. 



#5
Tarot Redhand

Tarot Redhand
  • Members
  • 2 684 messages

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