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.

erase shop price tag? [RESCUED]

hello!
before question, isn't there any shop list-arrangement-script?


-------------------------------


(if isn't)
http://cfs12.blog.daum.net/image/25/blo ... 739801.jpg[/img]



in shop scene, all the goods have each price tag but i want erase price tag at "-------" item. but i don't know how to make it.


if i make "9999999"-price  item like, this :
http://cfs11.blog.daum.net/image/36/blo ... 744510.jpg[/img]

please help me to erase the price tag on "------" item.

(and, as possible add the script change color to these item)


like this :
http://cfs12.blog.daum.net/image/5/blog ... 745807.jpg[/img]


p.s
if there is script for shop list-arrange, please tell me where the script is.
 

ikos

Member

I'm not entirely sure what the hell you're asking for, mate.
Are you asking for the ----------- to have no price?
Why exactly? Is it meant to be a seperator between items?
Please elaborate, I would be happy to help.

~Ikos out.
 
i'm sorry my shallow english and lengthy description.

in summary,
if I input a price "$9999999" into a i-tem, erase the price tag only that i-tem as above screenshot in shop scene.
(and i named i-tem to "--------" which i priced "$9999999".)

i'm curious that my description can makes you understand. ^^;
 
Well, if you only want to remove the price if the item costs 9999999 then just put this script in a new section above main:

Code:
class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    draw_item_name(item, rect.x, rect.y, enabled)
    rect.width -= 4
    unless item.price == 9999999
    self.contents.draw_text(rect, item.price, 2)
    end
  end
end

And change the number in line 14 to the price you wish to have that remove the price tag. :thumb:

Over and out - Gando
 

ikos

Member

Gando":3hpxi8k5 said:
Well, if you only want to remove the price if the item costs 9999999 then just put this script in a new section above main:

Code:
class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    draw_item_name(item, rect.x, rect.y, enabled)
    rect.width -= 4
    unless item.price == 9999999
    self.contents.draw_text(rect, item.price, 2)
    end
  end
end

And change the number in line 14 to the price you wish to have that remove the price tag. :thumb:

Over and out - Gando

Neat-o, I actually found a use for this too. :thumb:
 
So you wish to change the color of the item that costs $9999999?
Well, if that is the case, i wrote something real quick for you that is a little easier to customize.
Here is the script:
Code:
#==============================================================================
# ** Instructions
#------------------------------------------------------------------------------
#
# Item_Price - Here you put the price you wish to have that removes the price tag
#
# Item_Color - Here you chose the color you wish to have for the "special" item
#                   that has the same cost as in "Item_Price".
#
#==============================================================================

 Item_Price = 999999
 Item_Color = Color.new(55, 105, 255, 0)

class Window_Base < Window
  #--------------------------------------------------------------------------
  # * Draw Item Name
  #     item    : Item (skill, weapon, armor are also possible)
  #     x       : draw spot x-coordinate
  #     y       : draw spot y-coordinate
  #     enabled : Enabled flag. When false, draw semi-transparently.
  #--------------------------------------------------------------------------
  def draw_item_name_two(item, x, y, color, enabled = true)
    if item != nil
      draw_icon(item.icon_index, x, y, enabled)
      self.contents.font.color = color
      self.contents.font.color.alpha = 255
      self.contents.draw_text(x + 24, y, 172, WLH, item.name)
    end
  end
end

class Window_ShopBuy < Window_Selectable
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    number = $game_party.item_number(item)
    enabled = (item.price <= $game_party.gold and number < 99)
    rect = item_rect(index)
    self.contents.clear_rect(rect)
    if item.price == Item_Price
      draw_item_name_two(item, rect.x, rect.y, Item_Color, enabled)
    else
      draw_item_name(item, rect.x, rect.y, enabled)
    end
    rect.width -= 4
    unless item.price == Item_Price
    self.contents.draw_text(rect, item.price, 2)
    end
  end
end

The instructions are at the top of the script, but if you have any further questions don't hesitate to ask! :thumb:

Over and out - Gando
 

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