Anonymous

Changes

From Final Fantasy Inside

FF7/Field/Script/Opcodes/30 IFKEY

672 bytes added, 12:21, 11 September 2020
Amend button IDs
{| border="1" cellspacing="1" cellpadding="3" style="border: 1px solid black; border-collapse: collapse;"
! width="40" | 0x30
! width="4080" | ''B''
! width="40" | ''A''
|}
==== Description ====
Checks the status of a button being pressed; if pressed, regardless of the previous condition of the button press state (see [[FF7/Field/Script/Opcodes/31 IFKEYON|IFKEYON]] / [[FF7/Field/Script/Opcodes/32 IFKEYOFF|IFKEYOFF]]), the "if" body executes (that is, the script pointer is moved to the opcode after the current IFKEY). If the checked button fails the condition check, then the script pointer moves ahead ''A'' bytes. The highlighted keys in the button ID table below do not quite act as the rest when used with this particular opcode. For these keys, IFKEY acts in the same manner as IFKEYON; these keys cannot be checked repeatedly, and the if statement body will only execute once, regardless of whether the key is being held down. Button IDs can be ORd with each other to produce a combination of keys to check in one statement. For example, IFKEY with a key ID of 0x00F0 will check if any of the directional buttons are being pressed.
==== Button IDs ====
! style="background:rgb(204,204,204)" | ID
! style="background:rgb(204,204,204)" | Button
|-#
| 0b1 / 1
| L2 / Camera
|-
| 0b10 / 2
| R2 / Target
|-
| style="background:rgb(255,255,204)" align="center" | 0x00010b100 / 4| style="background:rgb(255,255,204)" | AssistL1 / PageUp
|-
| align="center" | 0x00080b1000 / 8| StartL2 / PageDown
|-
| align="center" | 0x00100b10000 / 16| UpTriangle / Menu
|-
| align="center" | 0x00200b100000 / 32| RightCircle / OK
|-
| align="center" | 0x00400b1000000 / 64| DownCross / Cancel
|-
| align="center" | 0x00800b10000000 / 128| LeftSquare / Switch
|-
| style="background:rgb(255,255,204)" align="center" | 0x01000b100000000 / 256| style="background:rgb(255,255,204)" | CameraSelect / Assist
|-
| style="background:rgb(255,255,204)" align="center" | 0x02000b1000000000 / 512| style="background:rgb(255,255,204)" | TargetUnknown 1
|-
| alignstyle="centerbackground:rgb(255,255,204)" | 0x04000b10000000000 / 1024| Page Upstyle="background:rgb(255,255,204)" | Unknown 2
|-
| align="center" | 0x08000b100000000000 / 2048| Page DownStart / Pause
|-
| align="center" | 0x10000b1000000000000 / 4096| MenuUp
|-
| align="center" | 0x20000b10000000000000 / 8192| OKRight
|-
| align="center" | 0x40000b100000000000000 / 16384| CancelDown
|-
| align="center" | 0x80000b1000000000000000 / 32768| SwitchLeft
|-
|}
50
edits