Aller au contenu

Photo

GetObjectByTag nTH


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

#1
DragonTayl

DragonTayl
  • Members
  • 34 messages
Greeting all :)

What a fantastic thread about GetObjectByTag and it's efficiency, that was spectacular. I found it however, because I was trying to find out information on the "nth" parameter.

nth defaults to zero, so if you send GetObjectByTag(sTag, 1); do you end up with the 2nd object with that tag, or is it the same as sending zero? If you wanted to get a random object by tag would you use

GetObjectByTag(sTag, d6());   (which gives a 1-6 value)

or 

GetObjectByTag(sTag, Random(6));   (which gives a 0-5 value)

#2
Shadooow

Shadooow
  • Members
  • 4 471 messages
in this case
0 -> first
1 -> second
2 -> third

#3
DragonTayl

DragonTayl
  • Members
  • 34 messages
 Thanks! So go with Random(6) :)