Anonymous

Changes

From Final Fantasy Inside

FF7/Field/Script/Opcodes/31 IFKEYON

No change in size, 16:07, 20 January 2007
m
Description: sp
Similar to [[FF7/Field/Script/Opcodes/30_IFKEY|IFKEY]], '''IFKEYON''' checks if a button is being pressed with the given ID (matching those in IFKEY). However, the body of the "if" statement only executes if this is the first time the button has been recorded as being pressed. If this is not the first time it is being pressed (that is, the user has held the key down), the condition evaluates to false, and the "if" statement body does not execute, moving the script pointer forward by ''A''.
This is an effective way to stop repeatedly executing the body if of the "if" statement due to the user holding the key down; thus, the body of the statement will only execute once. The button state is reset when the user lets go of the button, and at this point, IFKEYON may evaluate to true once more when the button is repressed.