470 <code language="lua"> local player = AddHog("HH 1", 0, 100, "NoHat") -- botlevel 0 means human player |
470 <code language="lua"> local player = AddHog("HH 1", 0, 100, "NoHat") -- botlevel 0 means human player |
471 SetGearPosition(player, 1500, 1000)</code> |
471 SetGearPosition(player, 1500, 1000)</code> |
472 == Functions to get gear properties == |
472 == Functions to get gear properties == |
473 |
473 |
474 === <tt>!GetGearType(gearUid)</tt> === |
474 === <tt>!GetGearType(gearUid)</tt> === |
475 This function returns the [GearTypes gear type] for the specified gear. |
475 This function returns the [GearTypes gear type] for the specified gear, if it exists. If it doesn't exist, `nil` is returned. |
476 |
476 |
477 === <tt>!GetVisualGearType(vgUid)</tt> (0.9.23) === |
477 === <tt>!GetVisualGearType(vgUid)</tt> (0.9.23) === |
478 This function returns the [VisualGearTypes visual gear type] for the specified visual gear. |
478 This function returns the [VisualGearTypes visual gear type] for the specified visual gear, if it exists. If it doesn't exist, `nil` is returned. |
479 |
479 |
480 === <tt>!GetGearPosition(gearUid)</tt> === |
480 === <tt>!GetGearPosition(gearUid)</tt> === |
481 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`. |
481 Returns x,y coordinates for the specified gear. Not to be confused with `GetGearPos`. |
482 |
482 |
483 === `GetGearCollisionMask(gearUid)` === |
483 === `GetGearCollisionMask(gearUid)` === |
677 |
677 |
678 <code language="lua"> gear = AddGear(...) |
678 <code language="lua"> gear = AddGear(...) |
679 HideHog(gear) -- Hide the newly created gear.</code> |
679 HideHog(gear) -- Hide the newly created gear.</code> |
680 |
680 |
681 === <tt>!RestoreHog(gearUid)</tt> === |
681 === <tt>!RestoreHog(gearUid)</tt> === |
682 Restores a previously hidden hedgehog. |
682 Restores a previously hidden hedgehog. Nothing happens if the hedgehog does not exist or is not hidden. |
683 |
683 |
684 Example: |
684 Example: |
685 |
685 |
686 <code language="lua"> gear = AddGear(...) |
686 <code language="lua"> gear = AddGear(...) |
687 HideHog(gear) -- Hide the newly created gear. |
687 HideHog(gear) -- Hide the newly created gear. |
688 RestoreHog(gear) -- Restore the newly hidden gear.</code> |
688 RestoreHog(gear) -- Restore the newly hidden gear.</code> |
689 |
689 |
690 === <tt>!DeleteGear(gearUid)</tt> === |
690 === <tt>!DeleteGear(gearUid)</tt> === |
691 Deletes a gear. |
691 Deletes a gear. If the specified gear did not exist, nothing happens. |
692 |
692 |
693 Example: |
693 Example: |
694 |
694 |
695 <code language="lua"> gear = AddGear(...) |
695 <code language="lua"> gear = AddGear(...) |
696 DeleteGear(gear) -- Delete the newly created gear.</code> |
696 DeleteGear(gear) -- Delete the newly created gear.</code> |
697 |
697 |
698 === <tt>!DeleteVisualGear(vgUid)</tt> === |
698 === <tt>!DeleteVisualGear(vgUid)</tt> === |
699 Deletes a visual gear. Note, most visual gears delete themselves. |
699 Deletes a visual gear. If it does not exist, nothing happens. |
|
700 |
|
701 Note, most visual gears delete themselves after a while. |
|
702 |
|
703 |
700 |
704 |
701 Example: |
705 Example: |
702 |
706 |
703 <code language="lua"> vgear = AddVisualGear(...) |
707 <code language="lua"> vgear = AddVisualGear(...) |
704 DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code> |
708 DeleteVisualGear(vgear) -- Delete the newly created visual gear.</code> |