GearMessages.wiki
author Wuzzy
Fri, 19 Apr 2019 16:07:50 +0100
changeset 1831 365c30b4c669
parent 1705 39af8c72daef
child 1908 d141b806356e
permissions -rw-r--r--
LuaGears: Add temporary mistake to test documentation script

#summary List of all gear messages.

This is a list of gear messages. Gear messages are used to e.g. control hedgehogs.

= List of gear messages =

|| *Identifier* || *Meaning* || *Parameter* ||
|| `gmLeft` || Walk left || _Not used._ ||
|| `gmRight` || Walk right || _Not used._ ||
|| `gmUp` || Aim up || _Not used._ ||
|| `gmDown` || Aim down || _Not used._ ||
|| `gmSwitch` || Switch hedgehog || _Not used._ ||
|| `gmLJump` || Long jump || _Not used._ ||
|| `gmHJump` || High jump || _Not used._ ||
|| `gmSlot` || Weapons slot selected. || Used. ||
|| `gmWeapon` || Weapon seleced. || Used. ||
|| `gmTimer` || Timer set. || Used. ||
|| `gmAnimate` || Start animation || Used. ||
|| `gmPrecise` || Precise || _Not used._ ||
|| `gmDestroy` || Request gear to remove itself. If present, the gear's removal and cleanup routine will be called. || _Not used._ ||
|| `gmDelete` || Delete gear the “hard” way. The gear removal routine will be skipped. Use with care! || _Not used._ ||
|| `gmRemoveFromList` || Remove from gear list || _Not used._ ||
|| `gmAddToList` || Insert in gear list || _Not used._ ||
|| `gmAllStoppable` || Bitwise OR of `gmLeft`, `gmRight`, `gmUp`, `gmDown`, `gmAttack` and `gmPrecise` ||_Not used._ ||

`gmAddToList` and `gmRemoveFromList` are intended for use by the engine when changing order of gears in the list.  It is not recommended that Lua changes these, and at present they are used together when changing a gear's Z (drawing order). For example, if Lua sets `gmRemoveFromList`, it would cause a leak of the gear, since Lua would no longer be able to restore it. Setting both together would have no effect since Lua cannot at present change Z.

See https://hg.hedgewars.org/hedgewars/file/default/hedgewars/uConsts.pas (search for "gear messages") for a current list.