I noticed some members were looking for this macro, so I will share it here.
This ChangeAllTiles macro replaces all tiles on the screen matching a specific collision type with another tile (both collision and graphics).

How to Implement It in your Project:
0/ Download the changeallTilesMacro.zip file and extract it somewhere. The two required files are inside the zip.
1/ Place the ChangeAllTiles.asm macro file in the "GameEngineData\Routines\BASE_4_5\System\Macros\" folder.
2/ Place the doChangeAllTiles.asm script file in the "GameEngineData\Routines\BASE_4_5\Game\Subroutines\" folder.
3/ In the "Project Settings > Script Settings", edit your "LoadAllSubroutines.asm" script, and add the following line:
Note: You can place this line among the other .include lines (around line 35 or 36 is a good spot).
Usage:
ChangeAllTiles <collisionToReplace>, <newGfxTile>, <newCollisionType>
collisionToReplace: The collision tile you want to replace.
newGfxTile: The graphic tile you want to use (this is the tile ID from the current background tileset). Note: If you don't want to change the graphics, use #$FF for this parameter.
newCollisionType: The collision type you want to replace the old one with.
Examples:
If you want to replace all the tiles with collision type #06 (locked doors) with warp tiles (#03) and display the open door graphic (#$10 from your background tileset), you would use:
Or if you want to remove tiles with collision type #12 and replace them with empty, walkable tiles (#$00), you would use
Or if you want to remove invisible walls (tiles #12) but keep the same graphics (i.e., just change the collision type), you would use:
Note: These examples are based on my project, and the collision types and graphics tiles in your project may (and likely will) be different.
Let me know if you encounter any issues or have further questions!
UPDATE: fixed a bug in the doChangeAllTiles.asm script. The graphics of the replacement tile were incorrectly drawn (it was drawn using only an 8x8 graphic that was repeated 4 times, instead of using the 16x16 tile).
This ChangeAllTiles macro replaces all tiles on the screen matching a specific collision type with another tile (both collision and graphics).

How to Implement It in your Project:
0/ Download the changeallTilesMacro.zip file and extract it somewhere. The two required files are inside the zip.
1/ Place the ChangeAllTiles.asm macro file in the "GameEngineData\Routines\BASE_4_5\System\Macros\" folder.
2/ Place the doChangeAllTiles.asm script file in the "GameEngineData\Routines\BASE_4_5\Game\Subroutines\" folder.
3/ In the "Project Settings > Script Settings", edit your "LoadAllSubroutines.asm" script, and add the following line:
Code:
.include ROOT\Game\Subroutines\doChangeAllTiles.asm
Usage:
ChangeAllTiles <collisionToReplace>, <newGfxTile>, <newCollisionType>
collisionToReplace: The collision tile you want to replace.
newGfxTile: The graphic tile you want to use (this is the tile ID from the current background tileset). Note: If you don't want to change the graphics, use #$FF for this parameter.
newCollisionType: The collision type you want to replace the old one with.
Examples:
If you want to replace all the tiles with collision type #06 (locked doors) with warp tiles (#03) and display the open door graphic (#$10 from your background tileset), you would use:
Code:
ChangeAllTiles #07, #$10, #03
Or if you want to remove tiles with collision type #12 and replace them with empty, walkable tiles (#$00), you would use
Code:
ChangeAllTiles #12, #$00, #00
Or if you want to remove invisible walls (tiles #12) but keep the same graphics (i.e., just change the collision type), you would use:
Code:
ChangeAllTiles #12, #$FF, #00
Note: These examples are based on my project, and the collision types and graphics tiles in your project may (and likely will) be different.
Let me know if you encounter any issues or have further questions!
UPDATE: fixed a bug in the doChangeAllTiles.asm script. The graphics of the replacement tile were incorrectly drawn (it was drawn using only an 8x8 graphic that was repeated 4 times, instead of using the 16x16 tile).
Attachments
Last edited: