Save-Point
Azor_BackTag - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+---- Forum: RPGMaker XP (RGSS) Engine (https://www.save-point.org/forum-116.html)
+---- Thread: Azor_BackTag (/thread-3163.html)



Azor_BackTag - AzorMachine - 12-27-2010

Azor_BackTag
Version: 1.5
Creator: AzorMachine


Description
With this script, if the battle starts when the player is above a tile with a Terrain Tag diferent than 0, the battle background will be modified. Perfect for World Maps. If someone have suggestions, or critiques, please post here :)

Instructions
Just paste it above Main and configure the module AzMa.
The array BACK manages the backgrounds the Terrain Tags will assume, and the array MAPAS manages the maps that will have the script active.

Script
Code:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# ■ Azor_BackTag
# Version 1.5
# 2009-01-08 (January)
#
#---------------------------------------------------------------
#  If the battle starts when the player is above
#  a tile with a Terrain Tag diferent than 0,
#  the battle background will be modified to the
#  ones in the Module AzMa.
#
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
# CONFIGURATION
#--------------------------\

module AzMa

BACK = ["002-Woods01", # Terrain Tag 1
        "002-Woods01", # Terrain Tag 2
        "002-Woods01", # Terrain Tag 3
        "002-Woods01", # Terrain Tag 4
        "002-Woods01", # Terrain Tag 5
        "002-Woods01", # Terrain Tag 6
        "002-Woods01"] # Terrain Tag 7
        
MAPAS = [1] #ID of the maps that will have the script active

end

# CONFIGURATION'S END
#--------------------------\
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
# Esta classe processa a tela de Mapa
#==============================================================================

class Scene_Map
  
  alias terrain_back_update update
  alias terrain_back_initialize initialize
  
  def initialize
    $t_back = 0  
    terrain_back_initialize
  end
  
  def update
   character = $game_player
   case character.direction
   when 2
     lx = character.x
     ly = character.y
   when 4
     lx = character.x
     ly = character.y
   when 6
     lx = character.x
     ly = character.y
   when 8
     lx = character.x
     ly = character.y
   end
   $t_back = $game_map.terrain_tag(lx,ly)
   terrain_back_update
end

end

#==============================================================================
# ■ Spriteset_Map
#------------------------------------------------------------------------------
# Esta classe engloba todos os sprites da tela, Tilesets, Heróis, etc
# Esta classe está inserida na classe Scene_Map.
#==============================================================================

class Spriteset_Battle
  
  def update  
   @actor_sprites[0].battler = $game_party.actors[0]
   @actor_sprites[1].battler = $game_party.actors[1]
   @actor_sprites[2].battler = $game_party.actors[2]
   @actor_sprites[3].battler = $game_party.actors[3]
  if $t_back != 0
    if AzMa::BACK[$t_back - 1] != ""
     for i in 0... AzMa::MAPAS.size
      if AzMa::MAPAS[i] == $game_map.map_id
       @battleback_name = AzMa::BACK[$t_back - 1]
      end
     end
     else
      @battleback_name = $game_temp.battleback_name
    end
  else
    @battleback_name = $game_temp.battleback_name
  end
   @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
   @battleback_sprite.src_rect.set(0, 0, 640, 320)
  for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    for sprite in @picture_sprites
      sprite.update
    end
    @timer_sprite.update
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    @viewport4.color = $game_screen.flash_color
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
  
end



RE: [RMXP] Azor_BackTag - RosyPosy - 12-27-2010

Ah useful.I will use this,I have a long demo that needs this.for a world map.