Difference between revisions of "If switch not pressed"
From Unofficial QEdit Wiki Guide
(Created page with "==Syntax== ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:blue'>if_switch_not_pressed </span>register</span> * ''register'' = Start of contin...") |
|||
Line 1: | Line 1: | ||
+ | ==Note== | ||
+ | This opcode is incorrectly named. The purpose of this opcode is to check that a switch is pressed/unlocked on the current floor. It is very similar to opcode 0xf82e <span style='color:blue'>if_switch_pressed</span>. | ||
+ | |||
==Syntax== | ==Syntax== | ||
''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:blue'>if_switch_not_pressed </span>register</span> | ''Syntax:'' <span style='font-size:12px;font-family:courier'><span style='color:blue'>if_switch_not_pressed </span>register</span> |
Revision as of 18:40, 26 April 2025
Note
This opcode is incorrectly named. The purpose of this opcode is to check that a switch is pressed/unlocked on the current floor. It is very similar to opcode 0xf82e if_switch_pressed.
Syntax
Syntax: if_switch_not_pressed register
- register = Start of continuous registers.
Continuous registers
(2 registers.)
Register 1 = Switch id
Register 2 = Unlock Register
Use
Used to set a register to check if a switch is not pressed through scripting or map event scripting
Example
100: thread_stg 101 //Threads function 101 for the current floor.
ret
101: sync //Waits 1 frame.
leti R1, 00000001 //Makes register 1 equal 00000001 for switch id 1.
if_switch_not_pressed R1
leti R3, 00000002 //Makes register 2 equal 00000002 for switch id 2.
if_switch_not_pressed R3
jmp_on 102 2:2:4 //If register 2 and 4 = 1, jump to Function 102
jmp 101 //Jump to function 101.
102: window_msg Switch IDs 1 and 2 are now pressed //Displays a window message.
winend //Closes the window message.
ret
Also see
thread_stg, ret, sync, leti,