Help on multiple warps per screen?

terminalsyzygy

New member
NESMaker is great so far but an odd limitation is that you can't easily have multiple warp tiles per screen. Or, natively at least.
Bucket Mouse's solution
I've seen this solution which I hear works great but the creator never gave any instructions on how to add the script into a project. I'm a ways through learning 6502 ASM so I can come to understand the scripting side of things better but am I seriously going to have to get fluent at assembly to learn how to add such a basic feature?

If anyone has any solutions on how to add multiple warps, or at least any tips on implementing Bucket Mouse's solution, that would be highly appreciated because this is putting me at sort of a road block currently.
 
Hi Terminalsyzygy,

I had the same problem a long time ago and asked exactly the same question on this forum. It was before the pandemic and a guy who was a reporter visiting E3 answered my question. He gave me the same link as you to Bucket Mouse's solution and said it was easy to implement. But he did agree the solution was for advanced users only. Which is no good to a beginner, I even asked him if he could make me a guide on how to implement this solution with screen shots? He said he didn't have the time, because he was going to E3. So after that response I complained to Joe about this limitation this forum has. Because if user's of this forum won't show how the solution's are implemented with guide's/videos. Then new users of Nesmaker can easily hit this road block wall and it can stop them completely in there tracks. Because you can't even ask Joe for help either and he knows more about Nesmaker than anyone. That's why I made my original complaint to him.

So thank you for asking the same question again! I would love to know this solution too, so I will tell you everything I know so far. It's great that you are learning 6502 assemby. That is 100% the key to solving this problem, as to how to add New scripts to Nesmaker. I think you are asking? Well if you open Nesmaker and go to Scripts/Input Scripts and left click the folder. You will see 2 field's 1 called (".asm script folder") and 1 called ("visable .asm files"). In the second field you have the (<DIR> Base_4_5) link which you can go into the folders and directly click on the scripts to add them to the game. But in the first field there is a path directing Nesmaker to a folder on the users computer.

E.g. (C:\Users\Folder_Name\Another_folder_name_like_programfiles_documents_desktop_etc\Another_folder_name\Nesmaker_4_5_9\NESmaker_4_5_x\GameEngineData\Routines

(This link is going to be different for everybody. So to see the correct path, just go to Scripts/Input Scripts in Nesmaker and look at the ".asm script folder" field to see the correct path)

So if you go to this location on your computer. It will take you to where the scripts for Nesmaker are located. Like I did below: (How to do that just copy and paste the path into your search bar below on your "Toolbar" and press return. Then once the search results come up just left click on "Open File Location"). This will bring to the "Routines" folder on your computer.

1) 2021-05-03.png

Now when the user left clicks and opens this folder you will come to this folder.

2)2021-05-03 (1).png

Look Familiar?

3)2021-05-03 (2).png

Left click this file again and you are bought to.

4)2021-05-03 (3).png

Looking Familiar Yet?

5)2021-05-03 (4).png

You sholud be getting the idea now, that the (Visible .asm files) field. Is a interface where Nesmaker is exploring the users computer. Searching for these ".asm" script files, depending which file you click on and now you know. Where these files are located on your computer. So now click on the "Game" folder you are bought to a very familiar screen.

6)2021-05-03 (5).png

7)2021-05-03 (6).png

So these are all the file folders users, usually open up and explore to double left click on the .asm script files directly. To add them to there game, so these files are just text based files usually opened in "Notepad" and are saved ending (.asm) and written in 6502 assemby language of course. So lets's open "Mod_AdventureBase" folder then "Inputs" folder as a example.

8)2021-05-03 (7).png

These are the files you get in this folder and let's open up "SelectWeapon_AdventureBase.asm" into "Notepad"

And this is what the script looks like without the Nesmaker interface, below.

9)2021-05-03 (8).png

And there it is! So as long as you just write a "Notepad" document in 6502 assemby language and save it as a ".asm" (Ending in) file name and drop it into one of these folders and then select the script through Nesmaker the classic way. You can add as many original scripts to your game as you want to.

That's as much as I can help you for now. I am sorry I couldn't help you any further than that. I hope you get the answer you are looking for soon, all the best!
 

Attachments

  • 2021-05-03 (1).png
    2021-05-03 (1).png
    6.4 KB · Views: 2
Last edited:

JamesNES

New member
I made a more simple version, which just has two warps per screen, one in the top half and on in the bottom half (or right and left), if you want me to write up how I did that I can. It's not hard or anything, don't need to be a 6502 wizard. Bucket Mouse's way is better if you want to have a ton of warps on screen, I haven't tried that though.

His link about using a tile for multiple things would be a good read for you too, though mostly unrelated to this.
 

terminalsyzygy

New member
Thanks both of you for the help. Yeah, I figured out earlier how to make new scripts and tiles so I could probably give the multi tile thing another go. In the meantime, I'd be curious to see JamesNES's solution. My main concern was having players be able to go back to the room they came from anyway.
 

JamesNES

New member
edit: looked at this again and realised I didn't set tempA to #$01 before everything

Alright, this is how I did it for two warps on one screen. First set up screen bytes:


On the screen you're warping from, user screen byte 0 will be the screen number you're warping to. Screen bytes have to be put in in decimal, so you need to convert the screen number to decimal first. The values are backwards too, so screen 14,3 (x=14, y=3) needs to be hex 3E, so 62 goes into the screen byte box. (Screen bytes are stored on screen settings screen where you put in your normal warp coordinates).

Then, again on the screen you're warping from, you need to put the secondary warp in coordinates in user screen byte 1. Same deal with converting to hex, and backwards.

Then this is the new warp tile script:

Code:
    CPX player1_object
    BNE +notPlayerForWarpTile
   
    ;;First, see if this screen has more than one warp by checking whether the first screenbyte isn't zero
    LDA #$01
    STA tempA
    LDA userScreenByte0
    BNE +determineWarp
            JMP +doWarp
        +determineWarp
       
        ;;this is set up to have one warp in the top half of the screen and one in the bottom.
        ;;the secondary warp will be the one in the top half, warp in the bottom half will just use the normal screen warp settings
        ;;check the player's Y value to determine which warp to use
       
        LDA Object_y_hi,x
        CLC
        CMP #$80    ;;roughly halfway down the screen, accounting for a HUD. Can change this to any value
        BCS +doWarp    ;;if carry is set, they're in the bottom half so just do a the normal warp from screen settings
   
            LDA userScreenByte0    ;;our secondary screen to warp to
            STA warpToScreen
           
            LDA userScreenByte1    ;;the warp in coordinates for the secondary warp screen
            AND #%00001111    ;;get the warp-in X
            ASL                ;;shifts it to the left as the coordinates are in metatiles
            ASL
            ASL
            ASL
            STA newX    ;;this is where the engine stores the player's X value on the new screen
            LDA userScreenByte1
            AND #%11110000    ;;get the warp-in Y
            STA newY    ;;this is where the engine stores the player's Y value on the new screen
                   
            LDA #$00    ;;makes it screen transition type 0, which means the engine won't overwrite newX/Y when it loads the new screen's data
            STA tempA
   
    +doWarp
    WarpToScreen warpToMap, warpToScreen, tempA
        ;; 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.
+notPlayerForWarpTile:

The only really fiddly part that might be confusing is converting the coordinates to decimal. For example, this warps you to screen 2,1, and puts you four tiles from the top, four from the left:

1620087162569.png
 
Last edited:
Top Bottom