Gold window location

Started by Fenriswolf, June 05, 2012, 08:45:21 am

Previous topic - Next topic

Fenriswolf

I'm using this script to show the amount of gold added/lost.

But I wish for the gold window to be in the top-right corner of the screen.

It seems like a fairly simple edit for anyone with basic scripting knowledge.

Could someone help me out?

Spoiler: ShowHide
# Change Gold Modification
# by kellessdee
#--------------------------

class Interpreter
  #--------------------------------------------------------------------------
  # * Change Gold
  #--------------------------------------------------------------------------
  def command_125
    # Get value to operate
    value = operate_value(@parameters[0], @parameters[1], @parameters[2])
    # Create Gold Window
    gold_held = Window_Gold.new
    gold_held.y = 416
    # Wait 30 frames
    30.times { Graphics.update }
    # Get values
    v = value < 0 ? -1 : 1
    # Loop through amount in change
    until value == 0
      $game_party.gain_gold(v)
      gold_held.refresh
      value -= v
      Graphics.update
      Input.update
      if Input.trigger?(Input::C) || Input.trigger?(Input::B)
        $game_party.gain_gold(value)
        gold_held.refresh
        break
      end
    end
    # Wait 30 frames
    30.times { Graphics.update }
    # Dispose gold window
    gold_held.dispose
    # Update Input to not cause any accidental triggers
    Input.update
    # Continue
    return true
  end
end

nathmatt

from the looks im guessing this is VX if so use this

Spoiler: ShowHide
# Change Gold Modification
# by kellessdee
#--------------------------

class Interpreter
  #--------------------------------------------------------------------------
  # * Change Gold
  #--------------------------------------------------------------------------
  def command_125
    # Get value to operate
    value = operate_value(@parameters[0], @parameters[1], @parameters[2])
    # Create Gold Window
    gold_held = Window_Gold.new
    gold_held.x = (544 - Window_Gold.width)
    gold_held.y = 0
    # Wait 30 frames
    30.times { Graphics.update }
    # Get values
    v = value < 0 ? -1 : 1
    # Loop through amount in change
    until value == 0
      $game_party.gain_gold(v)
      gold_held.refresh
      value -= v
      Graphics.update
      Input.update
      if Input.trigger?(Input::C) || Input.trigger?(Input::B)
        $game_party.gain_gold(value)
        gold_held.refresh
        break
      end
    end
    # Wait 30 frames
    30.times { Graphics.update }
    # Dispose gold window
    gold_held.dispose
    # Update Input to not cause any accidental triggers
    Input.update
    # Continue
    return true
  end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Fenriswolf

June 05, 2012, 12:17:54 pm #2 Last Edit: June 05, 2012, 12:25:53 pm by Fenriswolf
Sorry, I should have mentioned this in the first post, but I'm using XP.

Edit doesn't work.

nathmatt

k fixed had a blonde moment

Spoiler: ShowHide
# Change Gold Modification
# by kellessdee
#--------------------------

class Interpreter
  #--------------------------------------------------------------------------
  # * Change Gold
  #--------------------------------------------------------------------------
  def command_125
    # Get value to operate
    value = operate_value(@parameters[0], @parameters[1], @parameters[2])
    # Create Gold Window
    gold_held = Window_Gold.new
    gold_held.x = (640 - gold_held.width)
    gold_held.y = 0
    # Wait 30 frames
    30.times { Graphics.update }
    # Get values
    v = value < 0 ? -1 : 1
    # Loop through amount in change
    until value == 0
      $game_party.gain_gold(v)
      gold_held.refresh
      value -= v
      Graphics.update
      Input.update
      if Input.trigger?(Input::C) || Input.trigger?(Input::B)
        $game_party.gain_gold(value)
        gold_held.refresh
        break
      end
    end
    # Wait 30 frames
    30.times { Graphics.update }
    # Dispose gold window
    gold_held.dispose
    # Update Input to not cause any accidental triggers
    Input.update
    # Continue
    return true
  end
end
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Fenriswolf