Kain Nobel
Member
Player : No Map Transfer Fix
Version: 2.0
By: Kain Nobel
Introduction
This is a little 'security script' that you can put in your project. Basically, what it does is if you call a Transfer Player command with an event, but the map can't be found, it'll show/print a message telling the player.
Features
Screenshots
Take a screenshot of a Show Message event... there's your screenshot!
Script
Instructions
Place above 'main' and below 'SDK' and 'MACL' (if using). This script does NOT require SDK, so in order to remove it just delete the SDK.log, SDK.enabled? test and the last end in the script.
Compatibility
Haven't tested the script in VX yet, feel free to tell me your results.
Author's Notes
If you happen to have the MInterpreter (featured in MACL 2.3), this script will display the message using the "Show Text" event command, else it'll just print the message like normal.
Credits and Thanks
SephirothSpawn for the MInterpreter
Terms and Conditions
Free to use in 'commercial' and 'non-commercial' projects, please credit me if you used this script amongst the development of your project!
Version: 2.0
By: Kain Nobel
Introduction
This is a little 'security script' that you can put in your project. Basically, what it does is if you call a Transfer Player command with an event, but the map can't be found, it'll show/print a message telling the player.
"Cannot access Map [id] because it is missing...
please try a different map or notify the author of
the project that one of his maps is missing."
please try a different map or notify the author of
the project that one of his maps is missing."
Features
- Shows message notifying of missing map
- Doesn't crash your game because of your silly mistake :P
Screenshots
Take a screenshot of a Show Message event... there's your screenshot!
Script
Code:
#===============================================================================
# ** Player : No Map Transfer Fix
#===============================================================================
Â
#-------------------------------------------------------------------------------
# * SDK Log
#-------------------------------------------------------------------------------
SDK.log('Player.NoMapTransferFix', 'Kain Nobel ©', 3.5, '2009.06.17')
#-------------------------------------------------------------------------------
# * SDK Enabled Test : BEGIN
#-------------------------------------------------------------------------------
if SDK.enabled?('Player.NoMapTransferFix')
Â
#===============================================================================
# ** Game_Map
#===============================================================================
Â
class Game_Map
 #-----------------------------------------------------------------------------
 # * Name    : Exists?
 #  Info    : Tests to see if Map exists
 #  Author   : Kain Nobel
 #  Call Info : Map ID is the Map in question
 #-----------------------------------------------------------------------------
 def exists?(map_id)
  FileTest.exist?(sprintf("Data/Map%03d.rxdata", map_id))
 end
end
Â
#===============================================================================
# ** Interpreter
#===============================================================================
Â
class Interpreter
 #-----------------------------------------------------------------------------
 # * No Transfer Message ([?] is 'Map' id)
 #-----------------------------------------------------------------------------
 No_Transfer_Fix  = "Cannot access [?] because it is missing...\n  please try "
 No_Transfer_Fix += "a different map or notify the author of\n  the project th"
 No_Transfer_Fix += "at one of his maps is missing."
 #-----------------------------------------------------------------------------
 # * Alias Listing
 #-----------------------------------------------------------------------------
 alias_method :nomaptransferfix_interpreter_command201, :command_201
 #-----------------------------------------------------------------------------
 # * Command 201 : Transfer Player
 #-----------------------------------------------------------------------------
 def command_201
  if $game_map.exists?(@parameters[1])
   nomaptransferfix_interpreter_command201
  else
   message = No_Transfer_Fix.is_a?(String) ? No_Transfer_Fix : ''
   message.gsub!("[?]", "Map"+sprintf("%03d", @parameters[1]))
   unless message.nil? || message == ""
    if Object.const_defined?(:MInterpreter) ; MInterpreter.show_text(message)
    else                   ; print(message)
    end
   end
   $game_player.turn_180
   $game_player.move_forward
  end
 end
end
Â
#-------------------------------------------------------------------------------
# * SDK Enabled Test : END
#-------------------------------------------------------------------------------
end
Instructions
Place above 'main' and below 'SDK' and 'MACL' (if using). This script does NOT require SDK, so in order to remove it just delete the SDK.log, SDK.enabled? test and the last end in the script.
Compatibility
Interpreter.command_201
Haven't tested the script in VX yet, feel free to tell me your results.
Author's Notes
If you happen to have the MInterpreter (featured in MACL 2.3), this script will display the message using the "Show Text" event command, else it'll just print the message like normal.
Credits and Thanks
SephirothSpawn for the MInterpreter
Terms and Conditions
Free to use in 'commercial' and 'non-commercial' projects, please credit me if you used this script amongst the development of your project!