Have More Than One Set of GameObjectTiles in Your Game

baardbi

Well-known member
No it’s definitely not the same as the animated tiles.
We’re not CHR RAM bank switching here… it’s a ROM classic bank switch and CHR loading… it should totally work with mapper 2.
(Can’t test it now myself, but I will be happy to confirm you tomorrow if needed).
OK. Looks like I answered too quickly. I'll do some more checks next time.
 

5kids2feed

Well-known member
No it’s definitely not the same as the animated tiles.
We’re not CHR RAM bank switching here… it’s a ROM classic bank switch and CHR loading… it should totally work with mapper 2.
(Can’t test it now myself, but I will be happy to confirm you tomorrow if needed).

Can confirm! Works with mapper 2! Tested it out a few minutes ago.
 

tbizzle

Well-known member
Any way to load in more BckChr's bmp files with this method? It would make so much room for cut scene's! BckChr18, BckChr19, BckChr20, so on.......
 

baardbi

Well-known member
Any way to load in more BckChr's bmp files with this method? It would make so much room for cut scene's! BckChr18, BckChr19, BckChr20, so on.......
Not really. It's a little tricky to add more BckChr files because that stuff is hardcoded into the user interface.
 

tbizzle

Well-known member
@baardbi Is there a way to use ScreenFlags instead of UserScreenBytes? I have one set of UserScreenBytes that I'd like to dedicate to a multi warping script I have. I have about 4 ScreenFlags left to work with and only am going to use 1 or 2 extra Game Object Files in my game. So it would be much more ideal to use 2 or 3 screen flags instead of binding up 256 user screen bytes for 2 or 3 game object files. Thanks in advance! And Merry Xmas!
 

baardbi

Well-known member
@baardbi Is there a way to use ScreenFlags instead of UserScreenBytes? I have one set of UserScreenBytes that I'd like to dedicate to a multi warping script I have. I have about 4 ScreenFlags left to work with and only am going to use 1 or 2 extra Game Object Files in my game. So it would be much more ideal to use 2 or 3 screen flags instead of binding up 256 user screen bytes for 2 or 3 game object files. Thanks in advance! And Merry Xmas!
Merry Xmas. Well. I guess you could do that, but then you would have to do some modification to the code. You would have to check if a certain screen flag is checked and then load a set number (of the game object tileset for that screen flag). It should be doable, but I have never done it myself. If I remember correctly the number of the tileset is in the extrascreenload code, so I recommend start looking at the code in there.

You check screen flag bits this way:

;;;; Example
LDA ScreenFlags00
AND #%00000100
BEQ flagNotChecked
;;; Set tileset number
flagNotChecked:
 

tbizzle

Well-known member
***EDIT- False alarm, sorry. Just a slight oversight on my part....................

I can't seem to get this to work with the macro "DrawSprite"? Is there some kind of compatibility issue going on here that anyone is aware of?
 

JayJayHux

Active member
This might be completely off topic but im still trying to figure out how to reduce or remove wrong sprite sheet loading. Its the only known bug my game is experiencing and alot of games dont have that issue so im hoping this might help with that? Sorry if im grasping at straws here.
 
Was this made for 4.5.9?

I keep trying to get this to work, but if I set the screen info userscreenbyte gameobjects tile to "1" the change doesn't take effect until after I have warped out from that section of screens. So I have to set the screens that are before the warp into the screen I want to use the new gameobjecttiles for to "1".

I've also tried to assign it to a tile, with a JSR that points to the loaded subroutine that is bank switched to 18. But when I go over the tile, the screen flashes but nothing changes.
 

baardbi

Well-known member
Was this made for 4.5.9?

I keep trying to get this to work, but if I set the screen info userscreenbyte gameobjects tile to "1" the change doesn't take effect until after I have warped out from that section of screens. So I have to set the screens that are before the warp into the screen I want to use the new gameobjecttiles for to "1".

I've also tried to assign it to a tile, with a JSR that points to the loaded subroutine that is bank switched to 18. But when I go over the tile, the screen flashes but nothing changes.
Yes. This was made for 4.5.9.

As I wrote in the tutorial, this setup will not let you change graphics on the fly. It can definitely be done, but that's a modification of this tutorial. If you read the comments on Page 1, you'll see a discussion about that.

I'll try to help, but I can't promise anything. I need to spend the next week finishing my byteoff game. If you share the code, I'll take a look at it.
 
Yes. This was made for 4.5.9.

As I wrote in the tutorial, this setup will not let you change graphics on the fly. It can definitely be done, but that's a modification of this tutorial. If you read the comments on Page 1, you'll see a discussion about that.

I'll try to help, but I can't promise anything. I need to spend the next week finishing my byteoff game. If you share the code, I'll take a look at it.

Thank you, yes I have read over this thread a dozen times probably. I understand the 'on the fly' was a modification and I read that discussion. That is why I wrote the last sentence that I tried to assign it to a tile, like Lord Klump said they did on the first page.

I'm sorry to bother. No need to try to help, I'll just move on to something else and come back to this after I've taken a break from it for a while, that seems to be how I usually solve my issues with this stuff. Good luck with your byteoff game!
 

baardbi

Well-known member
Thank you, yes I have read over this thread a dozen times probably. I understand the 'on the fly' was a modification and I read that discussion. That is why I wrote the last sentence that I tried to assign it to a tile, like Lord Klump said they did on the first page.

I'm sorry to bother. No need to try to help, I'll just move on to something else and come back to this after I've taken a break from it for a while, that seems to be how I usually solve my issues with this stuff. Good luck with your byteoff game!
Sorry. I assumed you were working on a byteoff game too and needed help fast. After the byteoff deadline (March 31st) I'll have more time to dedicate to the forum.
 

TheRetroBro

Active member
This will allow you to have several sets of game object tiles in your game. This is useful if you want the player graphics to change on certain screens. However this method will not let you change them on the fly (during gameplay). They need to be loaded on a screen by screen basis. What game object tileset will be loaded is based on what you set up in userScreenByte0. This tutorial will only add one new tileset.

View attachment 7644 View attachment 7645

Before you begin make sure you have set up user screen bytes:

1. In the GraphicAssets folder of your game copy GameObjectTiles.bmp and paste it in the same folder. Rename the new file to GameObjectTiles1.bmp. What you do next will depend on what you want to achieve. If you for example want the player to get an armor during a cutscene and start the next level with the player object wearing the armor, then you need to make sure that the tilesets are set up identically. If you want the player to have different colors you can just set up the new screen with a different palette.

GameObjectTiles.bmp
View attachment 7647

GameObjectTiles1.bmp
View attachment 7648

2. Before you test the game you need to export the CHR graphics for GameObjectTiles1.bmp manually. You do this in the Pixel Editor. Go to Pixel Editor (at the top menu) and then Export CHR.
View attachment 7649
Save the file here: NESmaker_4_5_x\GameEngineData\Graphics\Sprites
Save the file as CHR_GameObjectTiles1.chr
PS! You need to do this every time you make a change to this file.

3. Go to Project Settings - Project Labels. Find Screen Bytes in the list on the left. Change UserScreenByte00 to GameObject Tileset.

4. While you're still in Project Settings, go to the Script Settings tab at the top. Under Banks you will find Bank15. Select it and click Edit. Modify the Bank15.asm file to include your new CHR file. Just add two new lines like this (add the text in yellow):

Save the file and close it.

5. Go back to Project Settings - Script Settings, select Bank16 and click Edit. Go down to line 417. It should look like this:

Change it to this (add the text in yellow):

Save the file and close it. Close Project Settings as well.

6. Go to your Subroutines folder. You can find it here: NESmaker_4_5_x\GameEngineData\Routines\BASE_4_5\Game\Subroutines
Open the file called doLoadScreen.asm and go to line 384. It should like this:

Change it to this:

Save the file and close it.

7. Now you can decide what tileset to use for each screen. By default userScreenByte0 is set to 0, so it will load the default tileset. If you change userScreenByte0 to 1 the screen will load the new tileset instead.
View attachment 7650

That's it.
great tutorial! I needed a second Snow boarder on my downhill snowboarding game so this is perfect!
 
Top Bottom