Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Map battle back

Save-Point

Full Version: Map battle back
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been looking for a system that does this but I can't seem to find one, so here goes.

Ok, I'm using MGC's FPLE system and I was wondering if it would be possible to use the current display as a battle background. So say I was wlking around and got to this point.
[Image: fplescreen.th.jpg]
Then I got into a battle. I'd like it to look something like this. (just using FF8 as an example here, happy with anything that looks similar.)
[Image: battlesystem.th.jpg]

Also of note, I'm using Selwyn's Passability Mini Map Script So it would be nice if that is hidden from the corner before battle initiates then turns back on afterwards, so it's not sitting in the corner of the screen during battle. Alternatively, just cover it up with the HP display window. :P
I'm also using DerVVulman's Eladia's Battle Equipment Menu But according to the script it doesent really interfere with any battle systems, it just adds the equipment change option. Just an FYI in case of compatibility errors.

Of course If anyone can get this idea to work with an existing, similar looking battle system that would be grand. Save yourelf the effort by all means. :D

Anyway, I'm spent. If anything's unclear just let me know.
I just tested the following script with the default battle system, without the minimap script and the other one, in order to have the FPLE screen as battle background :

Code:
#====================================================================
# FPLE map as battleback
# Author : MGC
# compatible with FPLE v1.1, paste it below FPLE
#====================================================================
#==============================================================================
# ** Game_Temp
#==============================================================================
class Game_Temp
  #--------------------------------------------------------------------------
  # * Aliased methods (F12 compatibility)
  #--------------------------------------------------------------------------
  if !@already_aliased_battleback
    alias initialize_fple_battleback_game_temp initialize
    @already_aliased_battleback = true
  end
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #     fple_battleback (bitmap)      : picture of the FPLE map to use as battleback
  #     fple_battleback_zoom (float)  : FPLE zoom, depending on resolution
  #--------------------------------------------------------------------------
  attr_accessor :fple_battleback
  attr_accessor :fple_battleback_zoom
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    initialize_fple_battleback_game_temp
    self.fple_battleback = nil
    self.fple_battleback_zoom = 1.0
  end
end

#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make sprite set
    if $game_system.fple
      @spriteset = FPLE_Spriteset_Map.new
    else
      @spriteset = Spriteset_Map.new
    end
    # Make message window
    @message_window = Window_Message.new
    # Transition run
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of sprite set
    if $game_system.fple && $scene.is_a?(Scene_Battle)
      $game_temp.fple_battleback = @spriteset.fple_render.sprite_screen.bitmap
      $game_temp.fple_battleback_zoom = @spriteset.fple_render.sprite_screen.zoom_x
    end
    @spriteset.dispose
    # Dispose of message window
    @message_window.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
  end
end

#==============================================================================
# ** Spriteset_Battle
#==============================================================================
class Spriteset_Battle
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update actor sprite contents (corresponds with actor switching)
    @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 battleback file name is different from current one
    if @battleback_name != $game_temp.battleback_name
      @battleback_name = $game_temp.battleback_name
      if @battleback_sprite.bitmap != nil
        @battleback_sprite.bitmap.dispose
      end
      if $game_system.fple
        @battleback_sprite.bitmap = $game_temp.fple_battleback
        @battleback_sprite.zoom_x = $game_temp.fple_battleback_zoom
        @battleback_sprite.zoom_y = $game_temp.fple_battleback_zoom
      else
        @battleback_sprite.bitmap = RPG::Cache.battleback(@battleback_name)
      end
      @battleback_sprite.src_rect.set(0, 0, 640, 320)
    end
    # Update battler sprites
    for sprite in @enemy_sprites + @actor_sprites
      sprite.update
    end
    # Update weather graphic
    @weather.type = $game_screen.weather_type
    @weather.max = $game_screen.weather_max
    @weather.update
    # Update picture sprites
    for sprite in @picture_sprites
      sprite.update
    end
    # Update timer sprite
    @timer_sprite.update
    # Set screen color tone and shake position
    @viewport1.tone = $game_screen.tone
    @viewport1.ox = $game_screen.shake
    # Set screen flash color
    @viewport4.color = $game_screen.flash_color
    # Update viewports
    @viewport1.update
    @viewport2.update
    @viewport4.update
  end
end

Is the compatibility OK ?
There seems to be a compatibility error with the minimap script I'm using
[Image: errorfo.jpg]

Line 38 reads @mini_map.update, works totally fine before I try to use yor script. Also works fine after I remove your script. The error occurs as soon as the game begins regardless of weather the minimap is turned on or not. (Tried it on a regular map also)

The code section from the minimap script if it's any help vv
Code:
#--------------------------------------------------------------------------
  # ? update
  #--------------------------------------------------------------------------
  def update
    @mini_map.update
    if $game_system.map_interpreter.running?
      @mini_map.visible = false
    elsif not $game_system.map_interpreter.running? and @mini_map.on?
      @mini_map.visible = true
    end
    update_passminimap
  end

Also tested without the minimap script and it works perfectly using the default battle system! If you know a way to fix this then the script will be perfect as far as I can see. (Might I suggest adding it to the system you currently have?)
I don't have the problem if I put the scripts in this order :
- FPLE
- the script I posted just above
- Passability Mini Map

you should try with this configuration.

I noticed something that is not very cool : because the minimap shows the ceiling, it doesn't show the walls and so it's not very helpful.
To solve this, you can replace the line 251 in the minimap script :
Code:
for level in [1, 2]
by :
Code:
for level in [1]

Quote:(Might I suggest adding it to the system you currently have?)

-> That could be a good idea.
Ah, I got around that wall display by only placing floor and ceiling tiles where they are needed, not just all over the map.

Anyways, I placed the minimap script under the battle script like you said and now it works! Cheers for that, it's a big help! :D :D <-- You got two smileys for that one.