Release.key

From AGI Wiki
Revision as of 14:35, 19 April 2019 by Andrew Korson (talk | contribs) (Created page with "The '''release.key''' command restores ego control keys to normal mode. == Syntax == release.key(); == Remarks == By default, when AGI starts, pressing and releasing a d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The release.key command restores ego control keys to normal mode.

Syntax

release.key();

Remarks

By default, when AGI starts, pressing and releasing a direction key starts ego moving. Ego will continue moving until a different direction key, or the 'stop' key ('5' on the numeric keyboard) is pressed.

The hold.key command changes this behavior such that while a direction key is pressed, ego will move in that direction. As soon as the key is released, ego will stop. The player must hold the key down for ego to keep moving.

The release.key command restores normal ego control behavior.

Possible Errors

Although the hold.key command was available beginning in version 2.911, the release.key command was not added until version 3.002.098. This means that if you use the hold.key command in an earlier version, you will not be able to go back to the default behavior for ego direction keys.

Example

Code:

<syntaxhighlight lang="agi"> hold.key; [ sets key behavior to hold mode ... release.key(); [ resets key behavior to normal </syntaxhighlight>

Technical Information

Required Interpreter Version: Available in version 3.002.098 and above.
Byte-Code Value: 181 (0xB5 hex)

See Also

Player Input Commands
hold.key