Old Map Data for GTBS
#1
Old Map Data for GTBS
VX ACE ONLY EDITION

by Kyonides

Introduction

There was once a forumer that wanted to keep the data used in the normal map before entering the tactical battle map when they were precisely one and the same. Well, this plug & play scriptlet seeks to accomplish this very same feat.

It heavily depends on the original GTBS script so you need to paste this patch BELOW the main GTBS one.

The Script

Code:
# * Old Map Data for GTBS * #
#  Plug & Play Script
#  Scripter : Kyonides Arkanthes
#  v0.3.0 - 2024-08-19

class Game_Map
  alias :kyon_gtbs_mod_gm_map_setup_events :setup_events
  def setup_events
    if @tactical_battle_end
      setup_old_events
    else
      kyon_gtbs_mod_gm_map_setup_events
    end
  end

  def setup_old_events
    @events = @old_events.dup
    @common_events = @old_common_events.dup
    @old_events = @old_common_events = @tactical_battle_end = nil
    refresh_tile_events
  end

  def save_map_data
    @old_bgm_pos = @map.bgm.pos unless @map.bgm.name.empty?
    @old_bgs_pos = @map.bgs.pos unless @map.bgs.name.empty?
    @old_events = @events.dup
    @old_common_events = @common_events.dup
  end

  def autoplay
    bgm_pos = @old_bgm_pos || 0
    bgs_pos = @old_bgs_pos || 0
    @old_bgm_pos = @old_bgs_pos = nil
    @map.bgm.play(bgm_pos) if @map.autoplay_bgm
    @map.bgs.play(bgs_pos) if @map.autoplay_bgs
  end
  attr_accessor :tactical_battle_end
end

class Scene_Battle_TBS
  def start
    super
    $game_map.save_map_data
    prepare_GTBS
  end

  def exit_battle
    return_to_map, mx, my, mdir = GTBS::battle_exit_info(@map_id)
    return_to_map = @map_id if !return_to_map || return_to_map == 0
    $game_map.tactical_battle_end = return_to_map == @map_id
    $game_map.setup(return_to_map)
    $game_player.moveto(mx, my) if mx != nil
    $game_player.set_direction(mdir) if mdir != nil
    $game_party.clear_summons
    $game_party.clear_neutrals
    $game_troop.clear_summons
    @map_id = nil
    SceneManager.return
    $game_map.autoplay
    $game_player.refresh
    $game_player.center($game_player.x, $game_player.y)
    Graphics.freeze
    Graphics.fadeout(30)
  end
end

Terms & Conditions

Free as in Beer beer.
Due credit is mandatory.
Mention this forum in your game credits.
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Saving Temporary Actors Data kyonides 0 115 09-03-2024, 05:59 AM
Last Post: kyonides
   LILY'S MEGA DATA! DerVVulfman 0 112 08-29-2017, 03:16 AM
Last Post: DerVVulfman
   DoubleX RMVXA Dynamic Data DoubleX 2 6,427 11-12-2015, 01:54 AM
Last Post: DoubleX
   DerVVulfman's Game Data Sneak DerVVulfman 0 115 04-04-2013, 03:50 AM
Last Post: DerVVulfman
   The Self Data Suite! PK8 1 10,636 05-19-2012, 10:11 AM
Last Post: PK8



Users browsing this thread: 1 Guest(s)