4.5.6 User Screen Byte 0 to Warp Tile Script

Post Reply
User avatar
TolerantX
Posts: 108
Joined: Fri Jan 18, 2019 7:58 am

4.5.6 User Screen Byte 0 to Warp Tile Script

Post by TolerantX » Sat Oct 17, 2020 9:45 pm

4.5.6 User Screen Byte 0 to Warp Tile Script
FIRST MAKE SURE YOU HAVE DONE THIS TUTORIAL:
viewtopic.php?f=35&t=5842

script:

Code: Select all

		CPX player1_object
	BEQ +doWarpPlayer
		JMP +notWarpPlayer

	+doWarpPlayer:
		LDA userScreenByte0			
		CMP #$00
		BNE doNextWarp
				WarpToScreen warpToMap, warpToScreen, #$01
					;; arg0 = warp to map.  0= map1.  1= map2.
					;; arg1 = screen to warp to.
					;; arg2 = screen transition type - most likely use 1 here.
						;; 1 = warp, where it observes the warp in position for the player.						
	doNextWarp:						
		LDA userScreenByte0			
		CMP #$01
		BNE doNextWarp
					WarpToScreen #$00, #$02, #$01  ;;test numbers to try to warp to screen 2 or 3 i dont care as long as it warps;;

	doNextWarp:						
		LDA userScreenByte0			
		CMP #$02
		BNE doNextWarp
					WarpToScreen #$00, #$03, #$01  ;;test numbers to try to warp to screen 2 or 3 i dont care as long as it warps;;

	doNextWarp:						
;		LDA userScreenByte0			
;		CMP #$03
;		BNE doNextWarp
;					WarpToScreen #$00, #$04, #$01  ;;any screen you want etc.. keep going as long as you want;;
;	doNextWarp:

+notWarpPlayer:


Explanation: The userScreenByte0 user variable will now be used to control where you warp to. Zero number or null will now always result in normal warp tile function AKA it warps to designated screen from the actual screen settings. 1-255 (use hex as always) will be for screens you choose. you'll note this script has limited default warps. You need to set up your warps. the end of the script is commented to be used for copy > pasting and continuing with more map coordinates.
I HOPE ALL THIS MAKES SENSE.
If anyone needs future clarity I can make a video or something. For now it's just a script you need to edit your own coordinates to.
This is so you can warp to two different locations. For example, what if you set on the screen that you want to warp to 0,0 as default yes this on 0 will warp there.... but that's what a normal warp does. so this is al ALTERNATIVE so you can have another... you wont have to use a different tile every time you want two warps per screen. I use 0 as a default in case you mess up. its a safety feature thats all.
Thank you. have a nice weekend!
Post Reply