Author Topic: GetObjectByTag nTH  (Read 338 times)

Legacy_DragonTayl

  • Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
GetObjectByTag nTH
« on: January 11, 2012, 01:29:37 am »


               Greeting all '<img'>

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)
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
GetObjectByTag nTH
« Reply #1 on: January 11, 2012, 01:53:38 am »


               in this case
0 -> first
1 -> second
2 -> third
               
               

               
            

Legacy_DragonTayl

  • Newbie
  • *
  • Posts: 40
  • Karma: +0/-0
GetObjectByTag nTH
« Reply #2 on: January 11, 2012, 06:47:24 pm »


                Thanks! So go with Random(6) '<img'>