GoToScreen Arguments

tornotlukin

Member
Code:
MACRO GoToScreen arg0, arg1, arg2
; arg 0 = screen to warp to.
; arg 1 = map
; arg 2 = transition type

I want to set my own arguments, but what data is it looking for? "Screen to warp to" and "Map" would presumably be XY coordinates. What numbers would I put in there? Is it a hex? A Binary?
 

dale_coop

Moderator
Staff member
For screen to warp to... just put the screen id (counting the screen from 0 to 255, from top left to down right). So it goes from #$00 to #$FF.
MAP it's #$00 or #$01 (for overworld / underworld).
the last one "transition type"... in most cases use #$01 or #$02 (the other ones #$00 to #$04, are use in the engine for different cases, like the first starting screen, after loosing a life checkpoint, special screen ...)
 

tornotlukin

Member
dale_coop said:
For screen to warp to... just put the screen id (counting the screen from 0 to 255, from top left to down right). So it goes from #$00 to #$FF.
MAP it's #$00 or #$01 (for overworld / underworld).
the last one "transition type"... in most cases use #$01 or #$02 (the other ones #$00 to #$04, are use for different cases, like the first starting screen, special screen ...)
I had an inkling that the magic number 255 has something to do with this. Thank you for the clarifications. I am going to keep notes on the my experience using NESMaker. Thanks again.
 

dale_coop

Moderator
Staff member
It's very fun experimenting :)
(Don't forget to make backups before... just in case you forgot how to come back to previous state)
 

tornotlukin

Member
I couldn't get custom variables to work with goToScreen. I did get great screen artifacts and freezing, saved a couple of those roms for more art based applications. I will try another approach. If anyone has already tried and succeeded it would be great to get some insight. I was looking to do two different warp tiles (on same screen) that go to two different places.
 

Mugi

Member
one way to pull that off would be to hardcode it if you dont use it in too many screens.

you can use tileX and tileY to get the coordinates of the tile you're interacting with, and compare that,
like if the tile is at X #$80 store room number of room 1 to temp, then replace arg0 with temp, and if the tileX is #$90 store room 2 number to temp.

that will make you warp into different rooms based on where you place the tile on the screen.

it works but it will bloat the script really fast if you use it a lot, as you will have to hardcode any tile position to the script you want to use, and you also cant use the same position in 2 screens or they would both warp you to the same location.
 
Top Bottom