VXAce VX Ace tile battle background

Good day,

Is it possible to script an override of the hardcoded link from tiles to what battleback image is used?
Or is there somewhere, where I can find what tile id is linked to what battle background file?

Short of me reading through the hundred or so scripts on battlebacks, what other methods are there to control what image is used based on the tile. Some scripts will overwrite with region id, but I don't remember if there is one that does it by tile id.
Sorry if I misunderstood, but in this context, what would Tile ID be? I assume it's not the same thing as Terrain ID.
Would it be something like an array, where the first Autotile would be 0 and the first tile would be 16?
what would Tile ID be? I assume it's not the same thing as Terrain ID.
yes the number of the tile in the sequence of tile positions on the tileset.
0-511 for autotiles (I think) 512-2048 for B-E tabs
the A2 ground is hardcoded (as I understand it) to link directly to a specific battle back file(s).
Since Battlebacks consist of two images, I imagine it could be a combination of possibilities, probably lines 135 and 158 of Spriteset_Battle.

All Battleback checks are performed using the normal_battleback1_name and normal_battleback2_name tags.

In the midst of all this, it would be possible to override this to check the tile ID. I'm not sure how it works, but I suspect the method used would be the same as layered_tiles in Game_Map:
$game_map.tile_id($game_player.x, $game_player.y, 0)

Edit:
There's one detail I'd forgotten: The autotiles from A1, A2, A4 and half of the A3 have various values due to the different possibilities for assembling them, while the tiles from A5 start at ID 1536 and end at 1663
Hello,

The battleback choice is handled in Spriteset_Battle:
You can check methods battleback1_name and battleback2_name as well as called methods.

As for the hardcoded names, they are here:
Ruby:
class Spriteset_Battle
  def terrain_battleback1_name(type)
    case type
    when 24,25        # Wasteland
      "Wasteland"
    when 26,27        # Dirt field
      "DirtField"
    when 32,33        # Desert
      "Desert"
    when 34           # Rocks
      "Lava1"
    when 35           # Rocks (lava)
      "Lava2"
    when 40,41        # Snowfield
      "Snowfield"
    when 42           # Clouds
      "Clouds"
    when 4,5          # Poisonous swamp
      "PoisonSwamp"
    end
  end
  #--------------------------------------------------------------------------
  # * Get Filename of Battle Background (Wall) Corresponding to Terrain
  #--------------------------------------------------------------------------
  def terrain_battleback2_name(type)
    case type
    when 20,21        # Forest
      "Forest1"
    when 22,30,38     # Low hill
      "Cliff"
    when 24,25,26,27  # Wasteland, dirt field
      "Wasteland"
    when 32,33        # Desert
      "Desert"
    when 34,35        #  Rocks
      "Lava"
    when 40,41        # Snowfield
      "Snowfield"
    when 42           # Clouds
      "Clouds"
    when 4,5          # Poisonous swamp
      "PoisonSwamp"
    end
  end
  #--------------------------------------------------------------------------
  # * Get Filename of Default Battle Background (Floor)
  #--------------------------------------------------------------------------
  def default_battleback1_name
    "Grassland"
  end
  #--------------------------------------------------------------------------
  # * Get Filename of Default Battle Background (Wall)
  #--------------------------------------------------------------------------
  def default_battleback2_name
    "Grassland"
  end
  #--------------------------------------------------------------------------
  # * Get Filename of Battle Background (Floor) When on Ship
  #--------------------------------------------------------------------------
  def ship_battleback1_name
    "Ship"
  end
  #--------------------------------------------------------------------------
  # * Get Filename of Battle Background (Wall) When on Ship
  #--------------------------------------------------------------------------
  def ship_battleback2_name
    "Ship"
  end
end
The type refers to the autotile_type of the highest autotile layer (0 or 1). And I guess this value will be the index of the tile in your tileset A (here the autotiles are counted once).

Edit: Actually the autotile_type will return -1 if there is no autotile on the given layer, so it handles the id of autotiles up to 127, ie from A1 to A4.
And as Dev_With_Coffee said, if the tile_id is between 1536 and end at 1663, then it is in A5.
Thanks. All the years I've been using VX Ace I never saw this.
I assumed it was coded somewhere that was not accessible to us.
This opens possibilities as soon as I understand Autotiles better.
I noticed that the first Autotiles for water have the same IDs:
1768177147550.png


1768177355754.png
I noticed that the first Autotiles for water have the same IDs:
I'm fairly sure that's because you are looking at the first layer (layer 0), if you look at layer 1, you will find the id of the autotiles 1,2,3.
As for the battle back, it will first check layer 1 before layer 0.
All of this is because ace mapping is actually 3 layers like XP, but they decided that the second layer was reserved to only a few tiles from A.

Original thread: https://forums.rpgmakerweb.com/threads/vx-ace-tile-battle-background.181886/