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.

Transfer Player Music Fix

SG Transfer Player Music Fix
Version: 2

Introduction

Another bug fix script. RMXP starts the map music, if one is set to it, whenever a transfer player event is used. This can be extremely annoying if you're having a special event happen with it's own music/volume

This script stops a music change from happening if you're transferring to the same map you're currently on.

Script

Code:
#=============================================================================
# ** SG Transfer Player Music Fix
#=============================================================================
# sandgolem 
# Version 2
# 13.07.06
#=============================================================================
#
# To use this script, copy it and insert it in a new section above "Main",
# but under the default scripts and the SDK if you're using it.
#
#=============================================================================

begin
  SDK.log('SG Transfer Player Music Fix', 'sandgolem', 2, '13.07.06')
  if SDK.state('SG Transfer Player Music Fix') != true
    @sg_transmusicfix_disabled = true
  end
  rescue
end

if !@sg_transmusicfix_disabled
#--------------------------------------------------------------------------

class Game_Map
  alias sandgolem_transmusicfix_gamemap_autoplay autoplay
  def autoplay
    if $sg_autoplay_temp != $game_temp.player_new_map_id
      sandgolem_transmusicfix_gamemap_autoplay
    end
    $sg_autoplay_temp = nil
  end
end

class Scene_Map
  alias sandgolem_transmusicfix_scenemap_transfer transfer_player
  def transfer_player
    $sg_autoplay_temp = $game_map.map_id
    sandgolem_transmusicfix_scenemap_transfer
  end
end

#--------------------------------------------------------------------------
end

Instructions

Above main, below the other default scripts.

Compatability

Aliases Scene_Map transfer_player & Game_Map autoplay

Credits and Thanks

Enterbrain for giving me another bug to fix
Landarma for the bug report

Author's Notes

If you find this useful or know any other bugs that should be fixed, let me know :)
 
This script works, however, even you transferred to different map, it disables starting map BGM.(when map A has BGM A and map B has BGM B, it should play BGM B when you enter map B, but with this script, it plays BGM A instead of BGM B)
 

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