RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
XP - Variable & Switch Debug HUD

0 Members and 1 Guest are viewing this topic.

****
Rep:
Level 83
This script was created by Modern Algebra, I merely converted it to XP. His original script can be found here.

Code: [Select]
#==============================================================================
#    Variable & Switch Debug HUD
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: April 15, 2010
#------------------------------------------------------------------------------
#    Converted to XP
#    by Mr Wiggles
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script is an extra feature that only works in Test Play. Basically,
#   whenever a switch, self switch, or variable are modified, this script will
#   display the modification just made and the result in the bottom left corner
#   of the screen. This is useful for debugging complicated event systems as it
#   allows you to track what is happening every frame.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script above Main and below Materials in the Script Editor (F11)
#
#    It will work simply by plugging it in, and you can toggle it on and off
#   at any time simply by pressing F8 (or whatever you replace it with below).
#   Note: This will operate only when test playing! So don't worry. You can
#   also toggle it on and off through a call script command:
#     $game_system.vsd_switch = true/false
#       where true turns the HUD on and false turns it off.
#
#    You can also configure lots of stuf with this script: see line 31
#==============================================================================
#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#  EDITABLE REGION
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
# VSD_SHOW_FRAMES - This is how many frames each modification shows up for.
VSD_SHOW_FRAMES = 180
# VSD_EXCLUDED_SCENES - If you want to exclude any scenes from showing this for
#  whatever reason, just put the name of the scene in the array, without quotes
VSD_EXCLUDED_SCENES = []
# VSD_EXCLUDED_VARIABLES - if this array contains any variable ID, then any
#  modifications of that variable will not be shown. This is useful if you have
#  variables that are updated frequently.
VSD_EXCLUDED_VARIABLES = []
# VSD_EXCLUDED_SWITCHES - if this array contains any switch ID, then any
#  modifications of that switch will not be shown. This is useful if you have
#  switches that are updated frequently.
VSD_EXCLUDED_SWITCHES = []
# VSD_EXCLUDED_SELFSWITCHES - if this array contains any self switch key, then
#  any modifications of that switch will not be shown. A self-switch key is:
#  [map_id, event_id, label] (label is "A", "B", "C", "D")
VSD_EXCLUDED_SELFSWITCHES = []
# VSD_TOGGLE_BUTTON - this is the button you press to turn the HUD on or off
VSD_TOGGLE_BUTTON = Input::F8
# VSD_DEFAULT_ON - this is whether the HUD is on by default or off
VSD_DEFAULT_ON = true
# VSD_SWITCH_COLOR - this is the color of the text showing switches. It must be
# an RGBA array [red, green, blue, alpha]
VSD_SWITCH_COLOR = Color.new(255, 80, 80, 255)
# VSD_VARIABLE_COLOR - this is the color of the text showing variables. It must be
# an RGBA array [red, green, blue, alpha]
VSD_VARIABLE_COLOR = Color.new(80, 80, 255, 255)
# VSD_SELFSWITCH_COLOR - this is the color of the text showing selfswitches. It must be
# an RGBA array [red, green, blue, alpha]
VSD_SELFSWITCH_COLOR = Color.new(80, 255, 80, 255)
# VSD_BACKCOLOR - this is the color of the background to all the texts. It must be
# an RGBA array [red, green, blue, alpha]
VSD_BACKCOLOR = Color.new(0, 0, 0, 60)
#||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#  END EDITABLE REGION
#//////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ** Game_System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new instance variable - vsd_switch
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_accessor :vsd_switch
  attr_accessor :debug_hud
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modrna_vsdtoggle_init_8cs3 initialize
  def initialize(*args)
    @debug_hud = nil
    @vsd_switch = VSD_DEFAULT_ON
    modrna_vsdtoggle_init_8cs3(*args) # Run Original Method
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias debug_hud_update update
  def update
    debug_hud_update
    @debug_hud = Debug_HUD.new if @debug_hud == nil
    @debug_hud.update
  end
end

#==============================================================================
# ** Scene_Save
#==============================================================================
class Scene_Save < Scene_File
  alias dispose_debug_hud initialize
  def initialize
    dispose_debug_hud
    $game_system.debug_hud = nil
  end
end

#==============================================================================
# ** Game_Switches
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - []=
#==============================================================================
class Game_Switches
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Switch
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modbr_vsd_setswitch_4tc2 []=
  def []= (switch_id, *args)
    prev_value = self[switch_id]
    modbr_vsd_setswitch_4tc2 (switch_id, *args)
    if !VSD_EXCLUDED_SWITCHES.include? (switch_id)
      $game_system.debug_hud = Debug_HUD.new if $game_system.debug_hud == nil
      $game_system.debug_hud.vsd_show_operation(true, switch_id, prev_value)
    end
  end
end

#==============================================================================
# ** Game_SelfSwitches
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - []=
#==============================================================================

class Game_SelfSwitches
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Switch
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mrnal_vsd_stslfswt_6uj2 []=
  def []= (key, *args)
    prev_value = self[key]
    mrnal_vsd_stslfswt_6uj2 (key, *args)
    if !VSD_EXCLUDED_SELFSWITCHES.include? (key)
      $game_system.debug_hud = Debug_HUD.new if $game_system.debug_hud == nil
      $game_system.debug_hud.vsd_show_operation (true, key, prev_value)
    end
  end
end

#==============================================================================
# ** Game_Event
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new method - vds_event_name
#==============================================================================

class Game_Event
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Event Name
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def vds_event_name
    return @event ? @event.name : ""
  end
end

#==============================================================================
# ** Game Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - command_122 (Variable)
#==============================================================================
class Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Control Variable
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def command_122
  # Initialize value
  value = 0
  # Log Old Values
  prev_values = {}
  for id in @parameters[0]..@parameters[1]
    prev_values[id] = $game_variables[id]
  end
  # Branch with operand
  case @parameters[3]
  when 0  # invariable
    value = @parameters[4]
  when 1  # variable
    value = $game_variables[@parameters[4]]
  when 2  # random number
    value = @parameters[4] + rand(@parameters[5] - @parameters[4] + 1)
  when 3  # item
    value = $game_party.item_number(@parameters[4])
  when 4  # actor
    actor = $game_actors[@parameters[4]]
    if actor != nil
      case @parameters[5]
      when 0  # level
        value = actor.level
      when 1  # EXP
        value = actor.exp
      when 2  # HP
        value = actor.hp
      when 3  # SP
        value = actor.sp
      when 4  # MaxHP
        value = actor.maxhp
      when 5  # MaxSP
        value = actor.maxsp
      when 6  # strength
        value = actor.str
      when 7  # dexterity
        value = actor.dex
      when 8  # agility
        value = actor.agi
      when 9  # intelligence
        value = actor.int
      when 10  # attack power
        value = actor.atk
      when 11  # physical defense
        value = actor.pdef
      when 12  # magic defense
        value = actor.mdef
      when 13  # evasion
        value = actor.eva
      end
    end
  when 5  # enemy
    enemy = $game_troop.enemies[@parameters[4]]
    if enemy != nil
      case @parameters[5]
      when 0  # HP
        value = enemy.hp
      when 1  # SP
        value = enemy.sp
      when 2  # MaxHP
        value = enemy.maxhp
      when 3  # MaxSP
        value = enemy.maxsp
      when 4  # strength
        value = enemy.str
      when 5  # dexterity
        value = enemy.dex
      when 6  # agility
        value = enemy.agi
      when 7  # intelligence
        value = enemy.int
      when 8  # attack power
        value = enemy.atk
      when 9  # physical defense
        value = enemy.pdef
      when 10  # magic defense
        value = enemy.mdef
      when 11  # evasion correction
        value = enemy.eva
      end
    end
  when 6  # character
    character = get_character(@parameters[4])
    if character != nil
      case @parameters[5]
      when 0  # x-coordinate
        value = character.x
      when 1  # y-coordinate
        value = character.y
      when 2  # direction
        value = character.direction
      when 3  # screen x-coordinate
        value = character.screen_x
      when 4  # screen y-coordinate
        value = character.screen_y
      when 5  # terrain tag
        value = character.terrain_tag
      end
    end
  when 7  # other
    case @parameters[4]
    when 0  # map ID
      value = $game_map.map_id
    when 1  # number of party members
      value = $game_party.actors.size
    when 2  # gold
      value = $game_party.gold
    when 3  # steps
      value = $game_party.steps
    when 4  # play time
      value = Graphics.frame_count / Graphics.frame_rate
    when 5  # timer
      value = $game_system.timer / Graphics.frame_rate
    when 6  # save count
      value = $game_system.save_count
    end
  end
  # Loop for group control
  for i in @parameters[0] .. @parameters[1]
    # Branch with control
    case @parameters[2]
    when 0  # substitute
      $game_variables[i] = value
    when 1  # add
      $game_variables[i] += value
    when 2  # subtract
      $game_variables[i] -= value
    when 3  # multiply
      $game_variables[i] *= value
    when 4  # divide
      if value != 0
        $game_variables[i] /= value
      end
    when 5  # remainder
      if value != 0
        $game_variables[i] %= value
      end
    end
    # Maximum limit check
    if $game_variables[i] > 99999999
      $game_variables[i] = 99999999
    end
    # Minimum limit check
    if $game_variables[i] < -99999999
      $game_variables[i] = -99999999
    end
  end
  # Return Changes
  for id in @parameters[0]..@parameters[1]
    $game_system.debug_hud = Debug_HUD.new if $game_system.debug_hud == nil
    $game_system.debug_hud.vsd_show_operation(false, id, prev_values[id], @event_id, @parameters[2, @parameters.size - 2]) if !VSD_EXCLUDED_VARIABLES.include?(i)
  end
  # Refresh map
  $game_map.need_refresh = true
  # Continue
  return true
end
end

#==============================================================================
# ** Sprite_ShowOperations
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This sprite shows the variable & switch operations onscreen during play test
#==============================================================================
class Sprite_ShowOperation < Sprite
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(viewport, operation, *args)
    super (viewport)
    self.bitmap = Bitmap.new (680, 24)
    if operation
      if args[0].is_a? (Integer)
        draw_switch_operation (*args)
      else
        draw_selfswitch_operation (*args)
      end
    else
      draw_variable_operation (*args)
    end
    @frame_count = VSD_SHOW_FRAMES
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Dispose
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def dispose (*args)
    super (*args)
    self.bitmap.dispose
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update
    @frame_count -= 1
    return if self.disposed?
    if @frame_count == 0
      self.dispose
    elsif @frame_count < 25
      self.opacity -= 10
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Switch Operation
  #    switch_id : ID of switch operated on
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_switch_operation (switch_id, prev_value)
    return if switch_id > $data_system.switches.size
    prev_value_s = prev_value ? "ON" : "OFF"
    label = sprintf ("S%04d: #{$data_system.switches[switch_id]} (#{prev_value_s})", switch_id)
    value = $game_switches[switch_id] ? "ON" : "OFF"
    text = "#{label} = #{value}"
    tw = self.bitmap.text_size(text).width + 40
    self.bitmap.fill_rect (680 - tw, 0, tw, 24, VSD_BACKCOLOR)
    self.bitmap.font.color = VSD_SWITCH_COLOR
    self.bitmap.draw_text (-40, 0, self.bitmap.width, 24, text, 2)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw SelfSwitch Operation
  #    switch_id : ID of switch operated on
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_selfswitch_operation (key, prev_value)
    prev_value_s = prev_value ? "ON" : "OFF"
    label = sprintf ("SS:#{key[2]} of Event %03d (#{prev_value_s})", key[1])
    value = $game_self_switches[key] ? "ON" : "OFF"
    text = "#{label} = #{value}"
    tw = self.bitmap.text_size (text).width + 40
    self.bitmap.fill_rect (680 - tw, 0, tw, 24, VSD_BACKCOLOR)
    self.bitmap.font.color = VSD_SELFSWITCH_COLOR
    self.bitmap.draw_text (-40, 0, self.bitmap.width, 24, text, 2)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Variable Operation
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_variable_operation(var_id, prev_value, event_id = 0, params = [])
    return if var_id > $data_system.variables.size
    label = sprintf ("V%04d: #{$data_system.variables[var_id]} (#{prev_value})", var_id)
    result = $game_variables[var_id].to_s
    # Determine operation string
    op_s = case params[0]
    when 0 then " = "
    when 1 then " + "
    when 2 then " - "
    when 3 then " * "
    when 4 then " / "
    when 5 then " % "
    end
    value_s = "0"
    # Determine operand
    case params[1]
    when 0 # invariable
      if params[0] == 0
        op_s = ""
        value_s = ""
      else
        value_s = "#{params[2]}"
      end
    when 1 # Variable
      value_s = sprintf ("V%04d: #{$data_system.variables[params[2]]} (#{$game_variables[params[2]]})", params[2])
    when 2 # Random
      value_s = "Random No. #{params[2]} - #{params[3]}"
    when 3 # Items Held
      value_s = "Amount of #{$data_items[params[2]].name}(s) held (#{$game_party.item_number($data_items[params[2]])})"
    when 4 # Actor
      actor = $game_actors[params[2]]
      if actor != nil
        value_s = "#{actor.name}'"
        value_s += "s" unless actor.name[-1, 1] == "s"
        stat_s = case params[3]
        when 0  then "Level (#{actor.level})"
        when 1  then "EXP (#{actor.exp})"
        when 2  then "HP (#{actor.hp})"
        when 3  then "SP (#{actor.sp})"
        when 4  then "Max HP (#{actor.maxhp})"
        when 5  then "Max SP (#{actor.maxsp})"
        when 6  then "Strength (#{actor.str})"
        when 7  then "Dexterity (#{actor.dex})"
        when 8  then "Agility (#{actor.agi})" 
        when 9  then "Intelligence (#{actor.int})" 
        when 10 then "Attack (#{actor.atk})"
        when 11 then "Physical Defense (#{actor.pdef})"
        when 12 then "Magic Defense (#{actor.mdef})"
        when 13 then "Evasion (#{actor.eva})"
        end
        value_s += " #{stat_s}"
      end
    when 5 # Enemy
      return if $game_troop == nil
      enemy = $game_troop.enemies[params[2]]
      if enemy != nil
        value_s = "#{enemy.name}'"
        value_s += "s" unless enemy.name[-1, 1] == "s"
        stat_s = case params[3]
        when 0  then "HP (#{enemy.hp})"
        when 1  then "SP (#{enemy.sp})"
        when 2  then "Max HP (#{enemy.maxhp})"
        when 3  then "Max SP (#{enemy.maxsp})"
        when 4  then "Strength (#{enemy.str})"
        when 5  then "Dexterity (#{enemy.dex})"
        when 6  then "Agility (#{enemy.agi})"
        when 7  then "Intelligence (#{enemy.int})"
        when 8  then "Attack (#{enemy.atk})"
        when 9  then "Physical Defense (#{enemy.pdef})"
        when 10 then "Magic Defense (#{enemy.mdef})"
        when 11 then "Evasion (#{enemy.eva})"
        end
        value_s += " #{stat_s}"
      end
    when 6 # Character
      case params[2]
      when -1
        character = $game_player # Player
        value_s = "Player's"
      when 0
        character = $game_map.events ? $game_map.events[event_id] : nil
      else
        character = $game_map.events ? $game_map.events[params[2]] : nil
      end
      if character != nil
        if value_s != "Player's"
          value_s = "#{character.vds_event_name}'"
          value_s += "s" unless character.vds_event_name[-1, 1] == "s"
        end
        stat_s = case params[3]
        when 0 then "X Coordinate (#{character.x})"
        when 1 then "Y Coordinate (#{character.y})"
        when 2 then "Direction (#{character.direction})"
        when 3 then "Screen X (#{character.screen_x})"
        when 4 then "Screen Y (#{character.screen_y})"
        when 5 then "Terrain Tag (#{character.terrain_tag})"
        end
        value_s += " #{stat_s}"
      end
    when 7 # Other
      value_s = case params[2]
      when 0 then "Map ID (#{$game_map.map_id})"
      when 1 then "Party Size (#{$game_party.actors.size})"
      when 2 then "Party's Gold (#{$game_party.gold})"
      when 3 then "Steps Taken (#{$game_party.steps})"
      when 4 then "Play Time (#{Graphics.frame_count / Graphics.frame_rate})"
      when 5 then "Timer (#{$game_system.timer / Graphics.frame_rate})"
      when 6 then "Save Count (#{$game_system.save_count})"
      end
    end
    text = "#{label}#{op_s}#{value_s} = #{result}"
    tw = self.bitmap.text_size(text).width + 40
    self.bitmap.fill_rect (680 - tw, 0, tw, 24, VSD_BACKCOLOR)
    self.bitmap.font.color = VSD_VARIABLE_COLOR
    self.bitmap.draw_text (-40, 0, self.bitmap.width, 24, text, 2)
  end
end

#==============================================================================
# ** Debug_HUD
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - start, initialize, update
#    new method - vsd_show_operation
#==============================================================================
class Debug_HUD
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Start Processing
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(*args)
    @vsd_shown_operations = []
    @vsd_viewport = Viewport.new (0, 0, 640, 480)
    @vsd_viewport.z = 1000
   #@vsd_viewport.oy = 128 if self.is_a? (Scene_Battle)
    @vsd_scroll = 0
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Terminate
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def terminate(*args)
    @vsd_shown_operations.each { |sprite| sprite.dispose unless sprite.disposed? }
    @vsd_shown_operations.clear
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update(*args)
    if $DEBUG
      if Input.trigger? (VSD_TOGGLE_BUTTON) # Toggle feature
        $game_system.vsd_switch = !$game_system.vsd_switch
        if !$game_vsd_switch
          @vsd_shown_operations.each { |sprite| sprite.dispose }
          @vsd_shown_operations.clear
        end
      end
      delete_array = []
      for i in 0...@vsd_shown_operations.size
        @vsd_shown_operations[i].update
        delete_array.push (i) if @vsd_shown_operations[i].disposed?
      end
      delete_array.reverse.each { |i| @vsd_shown_operations.delete_at (i) }
      # Move viewport if showing message
      if self.is_a? (Scene_Map)
        @vsd_viewport.oy = $game_message.visible && $game_message.position == 2 ? 128 : 0
      end
      if @vsd_scroll > 0
        @vsd_scroll -= 3
        @vsd_shown_operations.each { |sprite| sprite.y -= 3 }
      end
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Show Operation
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def vsd_show_operation(*args)
    return if !$DEBUG || !$game_system.vsd_switch || VSD_EXCLUDED_SCENES.include? (self.class)
    sprite = Sprite_ShowOperation.new(@vsd_viewport, *args)
    sprite.y = @vsd_shown_operations.empty? ? 480 : @vsd_shown_operations[0].y + 24
    @vsd_scroll += 24
    @vsd_shown_operations.unshift(sprite)
  end
end

I' not as good as MA so if you find any errors I will try to fix them.  Just post it bellow.
« Last Edit: April 16, 2010, 04:05:09 PM by Mr_Wiggles »
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Cool :) You should use code tags though. Also, you need to alter the draw_variable_operation method to make it correspond to the XP Control Variable command

Also, you should take a look at the command_122 method of Interpreter - a lot of the things you can set to variables are slightly different in XP from VX. For instance, SP is used in XP where MP is used in VX, and so errors will be created unless you change that stuff around.

And there are some features that were in XP that were removed from VX. For instance, you can get a character's terrain tag, which isn't available in VX.

****
Rep:
Level 83
Ok so since i may have over looked those im going to re-look over it.

[edit] - ok thanks for that tip on the stuff i over looked. I updated my original post.

[edit2] - great, there is some error that i don't know how to fix in Scene_File.

http://screensnapr.com/u/nh8w8m.png

Any ideas?



FIXED: updated my first post with newest version.
« Last Edit: April 16, 2010, 04:02:48 PM by Mr_Wiggles »
Spoiler for:
METALFRESH is a paint contractor that specializes in refinishing metal and vinyl siding. We paint metal buildings as well as siding on homes.

We also

    Refinish decks
    Do custom interior painting
    Strip wallpaper
    Refinish cedar siding
    Metal front doors and sidelights
    Metal garage and service doors
    Grained fiberglass doors

    If your structure is *RUSTED *FADED *CHALKING *IN NEED OF COLOR CHANGE, we can fix it with a guarentee!

northern Illinois and southern Wisconsin.

http://metalfreshcoatings.com


**
Rep:
Level 81
?????????????
:ps1:
;D ;D ;D PRETTY GOOD... ;D ;D ;D
;D ;D ;D THIS SCRIPT IS GREAT... ;D ;D ;D
;D ;D ;D YOU KNOW... ;D ;D ;D
:ps1:
遠い銀河からのスーパー戦士。
本は、セバスチャンです。
これは強力で、手に負えない。
彼の物理レベルのスキルは驚嘆です。[/b]