LuaAPI.wiki
changeset 419 861e9e89e19c
parent 418 a7d34a3e5786
child 421 d584704354ad
equal deleted inserted replaced
418:a7d34a3e5786 419:861e9e89e19c
   465 
   465 
   466 === <tt>!GetGearMessage(gearUid)</tt> ===
   466 === <tt>!GetGearMessage(gearUid)</tt> ===
   467 
   467 
   468 <blockquote>returns the message of the gear.
   468 <blockquote>returns the message of the gear.
   469 </blockquote>
   469 </blockquote>
       
   470 
       
   471 === <tt>!GetTag(gearUid)</tt> ===
       
   472 
       
   473 Returns the tag of the specified gear (by `gearUid`). 
       
   474 
       
   475 A “tag” of a gear is simply an extra variable to modify misc. things. The meaning of a tag depends on the gear type. For example, for gtBall gears, it specifies the ball color, for gtAirAttack gears (airplane) it specifies the direction of the plane, etc. `tag` has to be an integer.
       
   476 
       
   477 Note that the word “tag” here does _not_ refer to the name and health tags you see above hedgehogs, this is something different. 
       
   478 
       
   479 <code language="lua">
       
   480 -- This adds a ball (the one from the ballgun) at (123, 456):
       
   481 ball = AddGear(123, 456, gtBall, 0, 0, 0, 0)
       
   482 -- The tag of a ball defines its color. It will automatically chosen at random when created.
       
   483 colorTag = GetTag(ball)
       
   484 -- Now colorTag stores the tag of ball (in this case a number denoting its color)
       
   485 </code>
       
   486 
       
   487 
   470 === <tt>!GetFollowGear()</tt> ===
   488 === <tt>!GetFollowGear()</tt> ===
   471 
   489 
   472 <blockquote>Returns the uid of the gear that is currently being followed.
   490 <blockquote>Returns the uid of the gear that is currently being followed.
   473 </blockquote>
   491 </blockquote>
   474 === <tt>!GetTimer(gearUid)</tt> ===
   492 === <tt>!GetTimer(gearUid)</tt> ===
   704 <blockquote>Sets the message of the specified gear.
   722 <blockquote>Sets the message of the specified gear.
   705 </blockquote>
   723 </blockquote>
   706 
   724 
   707 === <tt>!SetTag(gearUid, tag)</tt> ===
   725 === <tt>!SetTag(gearUid, tag)</tt> ===
   708 
   726 
   709 <blockquote>Sets the tag of the specified gear, different for every gear.
   727 Sets the tag of the specified gear (by `gearUid`). A “tag” of a gear is simply an extra variable to modify misc. things. The meaning of a tag depends on the gear type. For example, for gtBall gears, it specifies the ball color, for gtAirAttack gears (airplane) it specifies the direction of the plane, etc. `tag` has to be an integer.
   710 </blockquote>
   728 
       
   729 Note that the word “tag” here does _not_ refer to the name and health tags you see above hedgehogs, this is something different. 
       
   730 
       
   731 <code language="lua">
       
   732 -- This adds a ball (the one from the ballgun) at (123, 456):
       
   733 ball = AddGear(123, 456, gtBall, 0, 0, 0, 0)
       
   734 -- This sets the tag of the gear. For gtBall, the tag specified the color. “8” is the color white.
       
   735 SetTag(ball, 8) -- 
       
   736 </code>
       
   737 
       
   738 Extensive documentation on what the different tags for gear types mean is still pending.
   711 
   739 
   712 === <tt>!SetTimer(gearUid, timer)</tt> ===
   740 === <tt>!SetTimer(gearUid, timer)</tt> ===
   713 
   741 
   714 <blockquote>Sets the timer of the specified gear. Also see !GetTimer.
   742 <blockquote>Sets the timer of the specified gear. Also see !GetTimer.
   715 </blockquote>
   743 </blockquote>