Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Map for Battleback

I'm looking for fairly simple, something that shows the current map for a battleback instead of a picture. However, this isn't enough, as it seems silly for the battleback to have the actors, aswell as the battle screen. So, I want this scrip to make it so the map is the battleback, except for the player and events with a comment like "noshow" (For NPC that you fight, for example)


Thanks to anyone who can do this :), I'm sure I'm not the only one who could use this though.


NOTE
Tell me if it's incompatible with any scripts, because I use Animated Battlers.
 
Um I am using a use are map as batle back ground. Not sure exactly if it is what you are wanting. And I didn't create it, it's a CA script...

http://i81.photobucket.com/albums/j233/lord_mythus/battlewithrubes-1.png[/IMG]

#==============================================================================

# â–  Spriteset_Battle
#------------------------------------------------------------------------------
# This class contains the set of sprites used in the Scene_Battle class, such
# as the enemies, actors, battle background, and any pictures being displayed
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# ● initialize
#--------------------------------------------------------------------------
def initialize
@viewport1 = Viewport.new(0, 0, 640, 480)
@viewport2 = Viewport.new(0, 0, 640, 480)
@viewport3 = Viewport.new(0, 0, 640, 480)
@viewport4 = Viewport.new(0, 0, 640, 480)
@viewport2.z = 101
@viewport3.z = 200
@viewport4.z = 5000
@battleback_sprite = Tilemap.new(@viewport1)
@battleback_sprite.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names
@battleback_sprite.autotiles = RPG::Cache.autotile(autotile_name)
end
@battleback_sprite.map_data = $game_map.data
@battleback_sprite.ox = $game_map.display_x / 4
@battleback_sprite.oy = $game_map.display_y / 4
@enemy_sprites = []
for enemy in $game_troop.enemies.reverse
@enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
end
@actor_sprites = []
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@actor_sprites.push(Sprite_Battler.new(@viewport2))
@weather = RPG::Weather.new(@viewport1)
@picture_sprites = []
for i in 51..100
@picture_sprites.push(Sprite_Picture.new(@viewport3,
$game_screen.pictures))
end
@timer_sprite = Sprite_Timer.new
update
end
#--------------------------------------------------------------------------
# ● Dispose the battle spriteset
#--------------------------------------------------------------------------
def dispose
@battleback_sprite.tileset.dispose
for i in 0..6
@battleback_sprite.autotiles.dispose
end
@battleback_sprite.dispose
for sprite in @enemy_sprites + @actor_sprites
sprite.dispose
end
@weather.dispose
for sprite in @picture_sprites
sprite.dispose
end
@timer_sprite.dispose
@viewport1.dispose
@viewport2.dispose
@viewport3.dispose
@viewport4.dispose
end
#--------------------------------------------------------------------------
# ● Update the battleset sprite
#--------------------------------------------------------------------------
def update
@battleback_sprite.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]
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


I found this on Creation Asylum. However that person found it on rmxp.net. They didn't know who credited it, and the author is not listed in the script.

Thread where I found the script...
http://www.creationasylum.net/index.php?showtopic=13897


Hope that helps.
 
What kind of error? I have been using it and haven't found an error, so I am curious if I didn't copy everything right or not.

I haven't tried anything like that yet, however, I do know that it causes the other battle events to disappear. IE, you run into things to fight them, if there are other things to fight on the map screen, they do not show up on the battle screen. Also the map screen that shows is the exact area of the ma your hero is, at, which is pretty neat.

Oh I should mention that it needs to be placed right under your battle system.
 
I don't know, but I decided just to make my own battlebacks using RTP graphics. Because, if this script doesn't show the event graphics, things like treasure chests or events that make up part of the enviorment will just dissapear.
 
Something did get missed... the line has @viewport 3, when it should be @viewport3... one condition, not two.

Here it is again, corrected and formatted. Still don't know the author:
Code:
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class contains the set of sprites used in the Scene_Battle class, such
# as the enemies, actors, battle background, and any pictures being displayed
#==============================================================================

class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * initialize
  #--------------------------------------------------------------------------
  def initialize
    @viewport1 = Viewport.new(0, 0, 640, 480)
    @viewport2 = Viewport.new(0, 0, 640, 480)
    @viewport3 = Viewport.new(0, 0, 640, 480)
    @viewport4 = Viewport.new(0, 0, 640, 480)
    @viewport2.z = 101
    @viewport3.z = 200
    @viewport4.z = 5000
    @battleback_sprite = Tilemap.new(@viewport1)
    @battleback_sprite.tileset = RPG::Cache.tileset($game_map.tileset_name)
    for i in 0..6
      autotile_name = $game_map.autotile_names[i]
      @battleback_sprite.autotiles[i] = RPG::Cache.autotile(autotile_name)
    end
    @battleback_sprite.map_data = $game_map.data
    @battleback_sprite.ox = $game_map.display_x / 4
    @battleback_sprite.oy = $game_map.display_y / 4
    @enemy_sprites = []
    for enemy in $game_troop.enemies.reverse
      @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
    end
    @actor_sprites = []
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @actor_sprites.push(Sprite_Battler.new(@viewport2))
    @weather = RPG::Weather.new(@viewport1)
    @picture_sprites = []
    for i in 51..100
      @picture_sprites.push(Sprite_Picture.new(@viewport3,
        $game_screen.pictures[i]))
    end
    @timer_sprite = Sprite_Timer.new
    update
  end
  #--------------------------------------------------------------------------
  # * Dispose the battle spriteset
  #--------------------------------------------------------------------------
  def dispose
    @battleback_sprite.tileset.dispose
    for i in 0..6
      @battleback_sprite.autotiles[i].dispose
    end
    @battleback_sprite.dispose
    for sprite in @enemy_sprites + @actor_sprites
      sprite.dispose
    end
    @weather.dispose
    for sprite in @picture_sprites
      sprite.dispose
    end
    @timer_sprite.dispose
    @viewport1.dispose
    @viewport2.dispose
    @viewport3.dispose
    @viewport4.dispose
  end
  #--------------------------------------------------------------------------
  # * Update the battleset sprite
  #--------------------------------------------------------------------------
  def update
    @battleback_sprite.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]
    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
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top