Template:Command:ifwarp

ifwarp (, ,  ,  )

Check if the warp background of the given room is a certain warp background, and if so, jump to the given custom script.

This command can be used in internal scripting without having to prefix either the command with  or the script with. You cannot jump to a main game script with this command, but you could jump to a custom script that jumps to a main game script.

In 2.2 and below, if the room number you end up indexing (which is just, without accounting for 1-indexing, ) is not in the range 0..399, undefined behavior will be triggered. In 2.3 and later, this undefined behavior is fixed.


 * : The x-coordinate of the room whose warp background you want to check, 1-indexed.
 * : The y-coordinate of the room whose warp background you want to check, 1-indexed.
 * : The warp background to check. There are four intended values:
 * : No warping
 * : Horizontal
 * : Vertical
 * : All sides
 * Additionally, you can set the warp dir of the room to any arbitrary integer with, and then check that arbitrary value with this command.


 * : The custom script to jump to, if the check succeeds.