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.

[Request] Modern Shop (RESOLVED)

Hello, RMXP.org!

Introduction:
  Well, I just started making a modern project and I got my resources. When I got to making a shop, I realized it would be cool to have a shop like the real world.(Explanation in Request.) I, being a completely pitiful noob at scripting, cannot make even your simplest HUDs. So, since my modern shop can't be created by me, I am requesting one.

Request:
  Here goes: You know how we have a shopping cart and go around the store picking up items in real life? Then we bring it to a cashier and we pay him? Well, that might be really cool for a modern-day RPG. Since this is my request, I have the opportunity to request it as I like.

A. The Item Taking
  When you go up to a shelf, table, etc., I want it to say something like, "Would you like to take or place?" then, choices, "Take, Place,"

  If they say take, it could say,"How many [Item]s would you like to take?" and then it would be like a normal shop, press up to make it higher and down to make it lower. (A courtesy to Mr. Mo for the Window and Scene Wizard) Example:
http://i229.photobucket.com/albums/ee138/speedolphins/Shop%20Request/001-ItemTaking.jpg[/img]

  Sorry, not shown in the picture but I would like that to:
-be semi-transparent.
-map seen in the backround.
-Show total gold it would cost.(Example: if one apple, 50G, if two, 100G)
  If they say place, just put the same thing as take except make it say place and stuff, and the number they choose will reduce what they have in the shopping cart. If it is more than they have, just remove all.

  If the window could get bigger/smaller in order to fit the words in (depending on item) the window, that would be wonderful. If this is would be hard, it's okay. Just make the window big if you're taking this!  :thumb:

  I'd imagine that to be called like this:
Call Script:
Code:
item[1].new
The [1] would be the item ID. I know that wouldn't be a code, but that's how it would be easy.

B. The Shopping Cart
  I think this will be the hardest part of all. When you're in a shop, and you don't have anything, you have your normal menu. But, if you're in a shop and you picked up something, then it takes you to the shopping cart if you pressed X.(Esc on keyboard). Straight to the shopping cart. No menu. But let's say you put something back, you'll be back to your regular menu.

  No screenies. Just the regular Scene_Item but a shopping cart.  :grin:

C. The Cashier
  When you walk up to the cashier, a window could pop up, showing all the items(and how many on the left),their total price(for how many gotten), and their icons, then at the bottom say, "Total amount of items: 18," and next to it, "Total Price: 1034G.)  Picture:
http://i229.photobucket.com/albums/ee138/speedolphins/Shop%20Request/002-Cashier.jpg[/img]

    Sorry, not shown in the picture but I would like that to:
-be semi-transparent.
-map seen in the backround.
-if more items than the window can fit, at scroll thingy.
-OK button and Cancel Button side-by-side at the bottom.
Ending:
I am sorry if this has already been requested. I am terribly, horribly, and sorrily (is that a word?) sorry if it has been made  :shock:!
Credits:
Mr. Mo for Window and Scene Wizard.
Apple for Being in both of my examples.
Anyone who is willing to take this HUGE request. Credit will be put in game.

  Well, that's the end of my request. If anyone can make it, THANK YOU and sorry. Thank you for making the script. Sorry, I cannot sprite, script, or anything very well in return for you.

Bye!  :smile:

Holy Cow my hands kinda hurt,
~speedolphins
 
Mmmm, very nice request topic you here.  And interesting script as well.

I might give this a shot tomorrow if no one has taken it yet, depends on how much time I have.

I just have one question for you.

When you say this ....
"B. The Shopping Cart
  I think this will be the hardest part of all. When you're in a shop, and you don't have anything, you have your normal menu. But, if you're in a shop and you picked up something, then it takes you to the shopping cart. Straight to the shopping cart. No menu. But let's say you put something back, you'll be back to your regular menu."

Do you mean that when you are in the shop and you have items in your shopping cart, a window appears showing what is on it? Or that when you press the "B" button (X, Esc) instead of opening the menu you want the shopping cart to open?
 
Finito!

Ok, here's the script

Code:
#============================================================================
# ** Modern Shop
#----------------------------------------------------------------------------
# vpcdmd
# 1.0
# 2/12/2008
#---
# ~ Originally requested by                 : speedolphins
#============================================================================

#--------------------------------------------------------------------------
# ** Scene_Modern_Shop
#--------------------------------------------------------------------------

class Scene_Modern_Shop
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(item)
    @item = item
  end
  #--------------------------------------------------------------------------
  # * Main
  #--------------------------------------------------------------------------
  def main
    @sprite_set = Spriteset_Map.new
    @help_window = Window_Help2.new
    @help_window.opacity = 200
    @command_window = Window_Command.new(160, ['take','place'])
    @command_window.y = 64
    @command_window.opacity = 200
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    @number_window.y = 64
    @number_window.opacity = 200
    @shopping_window = Window_ShoppingCart.new
    @shopping_window.active = false
    @shopping_window.visible = false
    @objects = [@sprite_set, @help_window, @command_window, @number_window, @shopping_window]
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      @objects.each {|x| x.update}
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @objects.each {|object| object.dispose}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if @command_window.active
      update_command
      return
    end
    if @number_window.active
      update_number
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    @help_window.set_text('Would you like to take or place '+@item.name+'?', 1)
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0  # buy
        case @item
        when RPG::Item
          number = $game_party.temp_item_number(@item.id)
        when RPG::Weapon
          number = $game_party.temp_weapon_number(@item.id)
        when RPG::Armor
          number = $game_party.temp_armor_number(@item.id)
        end
        if number == 99
          $game_system.se_play($data_system.buzzer_se)
          @help_window.set_text('There\'s no room for  '+@item.name+'s.', 1)
          return
        end
        $game_system.se_play($data_system.decision_se)
        max = @item.price == 0 ? 99 : $game_party.gold / @item.price
        max = [max, 99 - number].min
        @command_window.active = false
        @command_window.visible = false
        @number_window.set(@item, max, @item.price)
        @number_window.active = true
        @number_window.visible = true
      when 1  # sell
        case @item
        when RPG::Item
          number = $game_party.temp_item_number(@item.id)
        when RPG::Weapon
          number = $game_party.temp_weapon_number(@item.id)
        when RPG::Armor
          number = $game_party.temp_armor_number(@item.id)
        end
        if number == 0
          $game_system.se_play($data_system.buzzer_se)
        else
          max = number
          $game_system.se_play($data_system.decision_se)
          @command_window.active = false
          @command_window.visible = false
          @number_window.set(@item, max, @item.price / 2)
          @number_window.active = true
          @number_window.visible = true
        end
      end
      return      
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when quantity input window is active)
  #--------------------------------------------------------------------------
  def update_number
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @number_window.active = false
      @number_window.visible = false
      @command_window.active = true
      @command_window.visible = true
    end
    if @item.price > $game_party.gold
      @help_window.set_text('You can\'t afford '+@item.name+'s.', 1)
    else
      @help_window.set_text('How many '+@item.name+'s.', 1)
    end
    if Input.trigger?(Input::C)
      if @item.price > $game_party.gold
        $game_system.se_play($data_system.buzzer_se)
      else
        $game_system.se_play($data_system.shop_se)
        @number_window.active = false
        @number_window.visible = false
        case @command_window.index
        when 0  # buy
          case @item
          when RPG::Item
            $game_party.gain_temp_item(@item.id, @number_window.number)
            @shopping_window.refresh
          when RPG::Weapon
            $game_party.gain_temp_weapon(@item.id, @number_window.number)
            @shopping_window.refresh
          when RPG::Armor
            $game_party.gain_temp_armor(@item.id, @number_window.number)
            @shopping_window.refresh
          end
          @command_window.active = true
          @command_window.visible = true
        when 1  # sell
          case @item
          when RPG::Item
            $game_party.gain_temp_item(@item.id, (@number_window.number * -1))
            @shopping_window.refresh
          when RPG::Weapon
            $game_party.lose_weapon(@item.id, (@number_window.number * -1))
            @shopping_window.refresh
          when RPG::Armor
            $game_party.lose_armor(@item.id, (@number_window.number * -1))
            @shopping_window.refresh
          end
          @command_window.active = true
          @command_window.visible = true
        end
      end
      return
    end
  end
end
#------------------------------------------------------------------------------
# ** Scene_ShoppingCart
#------------------------------------------------------------------------------

class Scene_ShoppingCart
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(access = 0)
    @access = access
  end
  #--------------------------------------------------------------------------
  # * Main
  #--------------------------------------------------------------------------
  def main
    @sprite_set = Spriteset_Map.new
    @shopping_cart = Window_ShoppingCart.new
    @shopping_cart.active = true
    @shopping_cart.index = 0
    @shopping_cart.opacity = 200
    @command_window = Window_HorizCommand.new(['Ok', 'Cancel'], 320)
    @command_window.x = 320
    @command_window.y = 288
    @command_window.opacity = 200
    @total_ammount = @shopping_cart.get_total_ammount
    @total_price = @shopping_cart.get_total_price
    @shoptotal_window = Window_ShopTotal.new(@total_ammount, @total_price)
    @shoptotal_window.opacity = 200
    if @access == 1
      @command_window.visible = false
      @command_window.active = false
    end
    @objects = [@sprite_set, @shopping_cart, @command_window, @shoptotal_window]
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      @objects.each {|x| x.update}
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @objects.each {|object| object.dispose}
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if @command_window.active
      if Input.trigger?(Input::C)
        case @command_window.index
        when 0
          if @total_price > $game_party.gold
            $game_system.se_play($data_system.buzzer_se)
          else
            $game_system.se_play($data_system.shop_se)
            $game_party.lose_gold(@total_price)
            @shopping_cart.add_items
            @shopping_cart.refresh
            $scene = Scene_Map.new
          end
        when 1
          $scene = Scene_Map.new
        end
      end
    end
  end
end
#--------------------------------------------------------------------------
# ** Game_Party
#--------------------------------------------------------------------------

class Game_Party
  alias vpcdmd_initialize initialize
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    vpcdmd_initialize
    @temp_items = {}
    @temp_weapons = {}
    @temp_armors = {}
  end
  #--------------------------------------------------------------------------
  # * Get Number of Items Possessed
  #--------------------------------------------------------------------------
  def temp_item_number(item_id)
    return @temp_items.include?(item_id) ? @temp_items[item_id] : 0
  end
  #--------------------------------------------------------------------------
  # * Get Number of Weapons Possessed
  #--------------------------------------------------------------------------
  def temp_weapon_number(weapon_id)
    return @temp_weapons.include?(weapon_id) ? @temp_weapons[weapon_id] : 0
  end
  #--------------------------------------------------------------------------
  # * Get Amount of Armor Possessed
  #--------------------------------------------------------------------------
  def temp_armor_number(armor_id)
    return @temp_armors.include?(armor_id) ? @temp_armors[armor_id] : 0
  end
  #--------------------------------------------------------------------------
  # * Gain Items (or lose)
  #--------------------------------------------------------------------------
  def gain_temp_item(item_id, n)
    if item_id > 0
      @temp_items[item_id] = [[temp_item_number(item_id) + n, 0].max, 99].min
    end
  end
  #--------------------------------------------------------------------------
  # * Gain Weapons (or lose)
  #--------------------------------------------------------------------------
  def gain_temp_weapon(weapon_id, n)
    if weapon_id > 0
      @temp_weapons[weapon_id] = [[temp_weapon_number(weapon_id) + n, 0].max, 99].min
    end
  end
  #--------------------------------------------------------------------------
  # * Gain Armor (or lose)
  #--------------------------------------------------------------------------
  def gain_temp_armor(armor_id, n)
    if armor_id > 0
      @temp_armors[armor_id] = [[temp_armor_number(armor_id) + n, 0].max, 99].min
    end
  end
end
#------------------------------------------------------------------------------
# ** Scene_Map
#------------------------------------------------------------------------------

class Scene_Map
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    $game_temp.menu_calling = false
    if $game_temp.menu_beep
      $game_system.se_play($data_system.decision_se)
      $game_temp.menu_beep = false
    end
    $game_player.straighten
    if $game_system.in_shop == 1
      $scene = Scene_ShoppingCart.new(1)
    else
      $scene = Scene_Menu.new
    end
  end
end
#--------------------------------------------------------------------------
# ** Game_System
#--------------------------------------------------------------------------

class Game_System
  attr_accessor :in_shop
  alias vpcdmd_initialize initialize
  #--------------------------------------------------------------------------
  # * Initialization
  #--------------------------------------------------------------------------
  def initialize
    vpcdmd_initialize
    @in_shop = 0
  end
  #--------------------------------------------------------------------------
  # * In_Shop
  #--------------------------------------------------------------------------
  def in_shop
    return @in_shop
  end
end
#------------------------------------------------------------------------------
# ** Window_Help
#------------------------------------------------------------------------------

class Window_Help2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 320, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  #--------------------------------------------------------------------------
  # * Set Text
  def set_text(text, align = 0)
    if text != @text or align != @align
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
      @text = text
      @align = align
      @actor = nil
    end
    self.visible = true
  end
end
#------------------------------------------------------------------------------
# ** Window_ShoppingCart
#------------------------------------------------------------------------------

class Window_ShoppingCart < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(320, 0, 320, 160)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 1...$data_items.size
      if $game_party.temp_item_number(i) > 0
        @data.push($data_items[i])
      end
    end
    for i in 1...$data_weapons.size
      if $game_party.temp_weapon_number(i) > 0
        @data.push($data_weapons[i])
      end
    end
    for i in 1...$data_armors.size
      if $game_party.temp_armor_number(i) > 0
        @data.push($data_armors[i])
      end
    end
    @item_max = @data.size
    if @item_max > 0
      $game_system.in_shop = 1
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    else
      $game_system.in_shop = 0
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    case item
    when RPG::Item
      number = $game_party.temp_item_number(item.id)
    when RPG::Weapon
      number = $game_party.temp_weapon_number(item.id)
    when RPG::Armor
      number = $game_party.temp_armor_number(item.id)
    end
    if item.is_a?(RPG::Item)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.draw_text(x + 170, y, 16, 32, "x", 1)
    self.contents.draw_text(x + 180, y, 24, 32, number.to_s, 2)
    self.contents.draw_text(x + 206, y, 54, 32, (item.price*number).to_s, 2)
    self.contents.draw_text(x + 250, y, 32, 32, $data_system.words.gold, 2)
  end
  #--------------------------------------------------------------------------
  # * Get_Total_Ammount
  #--------------------------------------------------------------------------
  def get_total_ammount
    total = 0
    if @item_max > 0
      for i in 0...@item_max
        item = @data[i]
        case item
        when RPG::Item
          total += $game_party.temp_item_number(item.id)
        when RPG::Weapon
          total += $game_party.temp_weapon_number(weapon_id)
        when RPG::Armor
          total += $game_party.temp_armor_number(armor_id)
        end
      end
    end
    return total
  end
  #--------------------------------------------------------------------------
  # * Get_Total_Price
  #--------------------------------------------------------------------------
  def get_total_price
    total = 0
    if @item_max > 0
      for i in 0...@item_max
        item = @data[i]
        case item
        when RPG::Item
          total += item.price * $game_party.temp_item_number(item.id)
        when RPG::Weapon
          total += item.price * $game_party.temp_weapon_number(weapon_id)
        when RPG::Armor
          total += item.price * $game_party.temp_armor_number(armor_id)
        end
      end
    end
    return total
  end
  #--------------------------------------------------------------------------
  # * Add_Items
  #--------------------------------------------------------------------------
  def add_items
    if @item_max > 0
      for i in 0...@item_max
        item = @data[i]
        case item
        when RPG::Item
          $game_party.gain_item(item.id, $game_party.temp_item_number(item.id))
        when RPG::Weapon
          $game_party.gain_weapon(item.id, $game_party.temp_weapon_number(weapon_id))
        when RPG::Armor
          $game_party.gain_armor(item.id,$game_party.temp_armor_number(armor_id))
        end
      end
    end
    empty_list
  end
  #--------------------------------------------------------------------------
  # * Empty_List
  #--------------------------------------------------------------------------
  def empty_list
    if @item_max > 0
      for i in 0...@item_max
        item = @data[i]
        case item
        when RPG::Item
          $game_party.gain_temp_item(item.id, $game_party.temp_item_number(item.id)*-1)
        when RPG::Weapon
          $game_party.gain_temp_weapon(item.id, $game_party.temp_weapon_number(weapon_id)*-1)
        when RPG::Armor
          $game_party.gain_temp_armor(item.id,$game_party.temp_armor_number(armor_id)*-1)
        end
      end
    end
  end
end
#------------------------------------------------------------------------------
# ** Window Horizontal Command
#------------------------------------------------------------------------------

class Window_HorizCommand < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(commands, width = 640, height = 64)
    super(0, 0, width, height)
    self.contents = Bitmap.new(width - 32, height - 32)
    @commands = commands
    @item_max = @commands.size
    @column_max = @commands.size
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = width / @item_max * index
    off = width / @item_max - 32
    self.contents.draw_text(x, 0, off, 32, @commands[index], 1)
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end
#------------------------------------------------------------------------------
# ** Window Shop Total
#------------------------------------------------------------------------------

class Window_ShopTotal < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(total_ammount, total_price)
    @total_ammount = total_ammount
    @total_price = total_price
    super(320, 160, 320, 128)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, 160, 32, "Total Ammount")
    self.contents.draw_text(160, 0, 160, 32, @total_ammount.to_s)
    self.contents.draw_text(4, 32, 160, 32, "Total Price")
    self.contents.draw_text(160, 32, 160, 32, @total_price.to_s)
    self.contents.draw_text(4, 32, 280, 32, $data_system.words.gold, 2)
    self.contents.draw_text(4, 64, 160, 32, "Gold Available")
    self.contents.draw_text(160, 64, 160, 32, $game_party.gold.to_s)
    self.contents.draw_text(4, 32, 280, 32, $data_system.words.gold, 2)
  end
end

Paste that in a new section above main.

Now, how to use it.

A. The Item Taking

When you create your shop, you'll need to create a new event for every item.
For the graphic, you might want to use a modified icon graphic.

For example, let's use the apple as an example. The icon for the apple is 24*24, you'll need to modified it to make it four times that: 96*96 and put that modified picture in your "Characters" folder.  That way it can be used as a picture for the event.

http://img520.imageshack.us/img520/6223 ... s10eg3.png[/img]

Now, in the command window add the folowing script (last option on page three)

Code:
item = $data_items[i]
$scene = Scene_Modern_Shop.new(item)

And change i to the id of the item you want.  In the case of the apple, it'll be 32

For weapons you'll need to use
Code:
item = $data_weapons[i]
$scene = Scene_Modern_Shop.new(item)

... and armors
Code:
item = $data_armors[i]
$scene = Scene_Modern_Shop.new(item)

B. The Shopping Cart

It's coded in, if the shopping cart contains something it will open instead of the regular menu.

C. The Cashier

For the cashier, you'll need again an event.

In this event, you need to once more create a script command.

Code:
$scene = Scene_ShoppingCart.new

And that's all!
I hope you like it, I definetly had fun making this one. :D

If there's anything you would like me to change/add tell me and I'll see what I can do.
 
:shock:
That was faster than I thought! I thought that script would take...a week? Well, I'm no scripter, so I probably overestimated the difficulty of scripting :tongue:.
vpcdmd":3eytrli1 said:
And that's all!
I hope you like it, I definetly had fun making this one. :D

If there's anything you would like me to change/add tell me and I'll see what I can do.

Well...I tested it out and I do I like it. It's like, exactly how I imagined it except for one thing.

In your script, it comes out like this when I call the item taking/placing.
http://i229.photobucket.com/albums/ee138/speedolphins/Shop%20Request/Window.jpg[/img]

There are two things:
No. 1) The words inside the higher box is small/crammed together. Answer might be solved if No. 2 is done.
No. 2) You might be able to fix No. 1 by making the window bigger, like in my request.

http://i229.photobucket.com/albums/ee138/speedolphins/Shop%20Request/001-ItemTaking.jpg[/img]
Terribly sorry, but it could look nice and clean that way, and the words won't cram together. Also, if you take this, center it. Again, semi-transparent, please.

Thanks, vpcdmd.

~speedolphins
 
Haha, no problem.  I kinda had an idea of what you had in mind since I had played games with a shop like this before.  And it was such an intereting system I worked hour after hour until I had it finished :D

Oh, and about your problem, that's easily fixed (though I should have tested it with bigger items the first time. xD)

You are right, to prevent the text from doing that you'll need to make the window bigger.

Find this line (368)
Code:
super(0, 0, 320, 64)

and change it to
Code:
super(0, 0, 490, 64)

I tested it with Seed of Inteligence (the longest item I could find) and it doesn't cram the text like that.

Cheers :D

Edit:
There's something I need to ask you. xD

Right now, when you go to the cashier, you see the items in your shopping cart, in one windows and the "total ammount" and "total price" in a different one.
Now, in the picture that you left for your request, you had them all in the same window, however when I tried to put all of that in there I encountered a lot of problems, and couldn't find a way around it.  Now, that I gave my mind a little rest, I thought of a way to make it look like that.  So, my question is ... would you like me to have all that information in the same window (the current placement of the text will be the same) or is the current setup alright?
 
Well, it appears that people are interested in this system. xD (I don't blame them, I like it quite a lot.)

I myself don't mind if other people use it.

Speedolphins, is it alright if I also post this on the Submitted Scripts section?
 
Very sorry for not posting awhile, kinda busy.

vpcdmd":3v18q8kt said:
Haha, no problem.  I kinda had an idea of what you had in mind since I had played games with a shop like this before.  And it was such an intereting system I worked hour after hour until I had it finished :D

Oh, and about your problem, that's easily fixed (though I should have tested it with bigger items the first time. xD)

You are right, to prevent the text from doing that you'll need to make the window bigger.

Find this line (368)
Code:
super(0, 0, 320, 64)

and change it to
Code:
super(0, 0, 490, 64)

I tested it with Seed of Inteligence (the longest item I could find) and it doesn't cram the text like that.

Cheers :D

Edit:
There's something I need to ask you. xD

Right now, when you go to the cashier, you see the items in your shopping cart, in one windows and the "total ammount" and "total price" in a different one.
Now, in the picture that you left for your request, you had them all in the same window, however when I tried to put all of that in there I encountered a lot of problems, and couldn't find a way around it.  Now, that I gave my mind a little rest, I thought of a way to make it look like that.  So, my question is ... would you like me to have all that information in the same window (the current placement of the text will be the same) or is the current setup alright?

Whichever one is easier  :thumb:.

bojjenclon":3v18q8kt said:
Wow... This is amazing! You should post this in submitted scripts!

Well, vpcdmd, I guess you did a fairly good job, then.

jbrist":3v18q8kt said:
Speedolphins and vpcdmd, would it be okay, if with credit to both of you, I added this script to my game ? If not it's okay, I can live with the normal shop.

:shock:
You don't have to credit me! vpcdmd made the script. Well, I guess you can put it into your game, if you have vpcdmd's permission.

vpcdmd":3v18q8kt said:
Well, it appears that people are interested in this system. xD (I don't blame them, I like it quite a lot.)

I myself don't mind if other people use it.

Speedolphins, is it alright if I also post this on the Submitted Scripts section?

Yes, you can. It's yours anyway  :lol:.

Thanks, vpcdmd.
Umm, none of my requests were ever finished before, so I'm fairly new to this, but:
Do I add [RESOLVED] to the topic's title?
 
Hahaha, well then. :D

And yes, it'll be better if you add [RESOLVED] to it, that way people won't read the topic to see if something needs to be done, plus mods know they can close it then to avoid someone from necroposting this in a year or so. xD

Edit:
Btw, I found a small bug on the script, it's fixed on the version posted on the Submitted Scripts version.
 

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