Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: Fenriswolf on June 05, 2012, 08:45:21 am

Title: Gold window location
Post by: Fenriswolf on June 05, 2012, 08:45:21 am
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
Title: Re: Gold window location
Post by: nathmatt on June 05, 2012, 12:08:45 pm
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
Title: Re: Gold window location
Post by: Fenriswolf on June 05, 2012, 12:17:54 pm
Sorry, I should have mentioned this in the first post, but I'm using XP.

Edit doesn't work.
Title: Re: Gold window location
Post by: nathmatt on June 05, 2012, 12:33:45 pm
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
Title: Re: Gold window location
Post by: Fenriswolf on June 05, 2012, 12:45:33 pm
Perfect, thank you.