collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: + [ On-Screen Shop ] +  (Gelesen 3157 mal)

woratana

  • Gast
+ [ On-Screen Shop ] +
« am: Mai 15, 2008, 05:15:15 »
On-Screen Shop
Version 1.0
by Woratana
Release Date: 14/05/2008


Introduction
It's not really new interface :P
Mostly just move windows and change the size.

But I think it's look not too bad though. So I'd like to share.

Enjoy~! :)


Screenshots



Script
Place it above main
[div class=\'codetop\']CODE[div class=\'codemain\' style=\'height:200px;white-space:pre;overflow:auto\']#=======================================================================
# ? [VX] ? On-Screen Shop ? ?
#-------------------------------------------------------------------
# ? by Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Released on: 14/05/2008
# ? Version: 1.0
#=======================================================================

class Scene_Shop < Scene_Base
  
  USE_SPRITESET = true
  # Do you want to use real map as background? (tile will animate)
  
  #--------------------------------------------------------------------------
  # * Start processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_str_oshop start
  def start
    wora_sceshop_str_oshop
    @spriteset = Spriteset_Map.new if USE_SPRITESET
    @gold_window.x = Graphics.width - @gold_window.width - 24
    @gold_window.y = Graphics.height - @gold_window.height - 24
    @buy_window.x = @sell_window.x = 0
    @number_window.x = 0
    @dummy_window.y = @help_window.height
    @buy_window.y = @sell_window.y = @help_window.height
    @number_window.y = @status_window.y = @help_window.height
    @buy_window.height = @sell_window.height = 200
    @number_window.height = @status_window.height = 200
    @dummy_window.y = Graphics.height
    @status_window.create_contents
    @help_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias wora_sceshop_ter_oshop terminate
  def terminate
    wora_sceshop_ter_oshop
    @spriteset.dispose if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  alias wora_sceshop_upd_oshop update
  def update
    wora_sceshop_upd_oshop
    if @command_window.active
      @help_window.visible = false
    elsif @buy_window.active
      @help_window.visible = @buy_window.visible
    elsif @sell_window.active
      @help_window.visible = @sell_window.visible
    end
    @spriteset.update if USE_SPRITESET
  end
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::ShopBuy
    s2 = Vocab::ShopSell
    s3 = Vocab::ShopCancel
    @command_window = Window_Command.new(120, [s1, s2, s3])
    @command_window.y = Graphics.height - @command_window.height - 24
    @command_window.x = 24
    if $game_temp.shop_purchase_only
      @command_window.draw_item(1, false)
    end
  end
end

class Window_ShopNumber < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    y = 64
    self.contents.clear
    draw_item_name(@item, 0, y)
    self.contents.font.color = normal_color
    self.contents.draw_text(212, y, 20, WLH, "×")
    self.contents.draw_text(248, y, 20, WLH, @number, 2)
    self.cursor_rect.set(244, y, 28, WLH)
    draw_currency_value(@price * @number, 4, y + WLH * 2, 264)
  end
end

class Window_ShopStatus < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @item != nil
      number = $game_party.item_number(@item)
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 200, WLH, Vocab::Possession)
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, 200, WLH, number, 2)
      for actor in $game_party.members
        x = 4
        y = WLH * (2 + actor.index)
        draw_actor_parameter_change(actor, x, y)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Actor's Current Equipment and Parameters
  #--------------------------------------------------------------------------
  def draw_actor_parameter_change(actor, x, y)
    return if @item.is_a?(RPG::Item)
    enabled = actor.equippable?(@item)
    self.contents.font.color = normal_color
    self.contents.font.color.alpha = enabled ? 255 : 128
    self.contents.draw_text(x, y, 200, WLH, actor.name)
    if @item.is_a?(RPG::Weapon)
      item1 = weaker_weapon(actor)
    elsif actor.two_swords_style and @item.kind == 0
      item1 = nil
    else
      item1 = actor.equips[1 + @item.kind]
    end
    if enabled
      if @item.is_a?(RPG::Weapon)
        atk1 = item1 == nil ? 0 : item1.atk
        atk2 = @item == nil ? 0 : @item.atk
        change = atk2 - atk1
      else
        def1 = item1 == nil ? 0 : item1.def
        def2 = @item == nil ? 0 : @item.def
        change = def2 - def1
      end
      if change > 0 # If increase status
        
      elsif change < 0 # If decrease status
        self.contents.font.color.alpha = 128
      else # if not change status
        self.contents.font.color.alpha = 128
      end
      self.contents.draw_text(x, y, 200, WLH, sprintf("%+d", change), 2)
    end
  end
end


Instruction
It's plug and play script.

So just put it in game and enjoy~  happy.gif\" style=\"vertical-align:middle\" emoid=\"^_^\" border=\"0\" alt=\"happy.gif\" /]


Author's Notes
Free for use in your project if credit is included.

+ [ On-Screen Shop ] +

Offline Kyoshiro

  • Global Mod
  • RPGVX-Forengott
  • ****
  • Beiträge: 1623
  • Stand up and fight!
    • Mein Blog
+ [ On-Screen Shop ] +
« Antwort #1 am: Mai 15, 2008, 08:44:14 »
I like this script, it's different from the regular shop an that's good. I think many people will use this script.
Perhaps i use it too in my project.
Are there any problems with compability?

Kyo

+ [ On-Screen Shop ] +

woratana

  • Gast
+ [ On-Screen Shop ] +
« Antwort #2 am: Mai 15, 2008, 08:51:42 »
It may, if you're using other Scene_Shop script >_>'

+ [ On-Screen Shop ] +

Offline mICHi

  • Eventmeister
  • ***
  • Beiträge: 390
  • the cake is a lie.
    • http://www.last.fm/user/mICHigo/
+ [ On-Screen Shop ] +
« Antwort #3 am: Mai 15, 2008, 09:25:18 »
Nice, i like this one : )
Thanks for the script ^^


+ [ On-Screen Shop ] +

Dainreth

  • Gast
+ [ On-Screen Shop ] +
« Antwort #4 am: Mai 15, 2008, 11:40:37 »
I use my own shop system but I think this one is a good alternative for the normal one. Good work wora!

+ [ On-Screen Shop ] +

Caith

  • Gast
+ [ On-Screen Shop ] +
« Antwort #5 am: Mai 15, 2008, 23:53:02 »
hehe^^
it looks nearly like the shopping system of Knights of Xentar^^

===

gute Arbeit mach weiter so^^

+ [ On-Screen Shop ] +

ERZENGEL

  • Gast
+ [ On-Screen Shop ] +
« Antwort #6 am: Mai 16, 2008, 00:15:43 »
Like all others above me have already wrote it looks very nice but I realized that an event when Stepping Animation is activated is slower animated. I don't know why. Maybe another execution of the update-method of the instance of Spriteset_Map is needed?
« Letzte Änderung: Mai 16, 2008, 00:40:15 von ERZENGEL »

+ [ On-Screen Shop ] +

chaosBlender

  • Gast
+ [ On-Screen Shop ] +
« Antwort #7 am: Mai 16, 2008, 00:34:05 »
Hey, looks really great. Too bad, I've got no use for it in the game I'm working on atm, but maybe I'm gonna use it in a future project.

Keep up the good work! *thumbsup*

+ [ On-Screen Shop ] +

woratana

  • Gast
+ [ On-Screen Shop ] +
« Antwort #8 am: Mai 16, 2008, 07:15:54 »
@Erzengel
Not sure either >_>~

Though, I think big map may not good to call Spriteset_Map. :P

+ [ On-Screen Shop ] +

ERZENGEL

  • Gast
+ [ On-Screen Shop ] +
« Antwort #9 am: Mai 16, 2008, 10:40:52 »
Oh I'm an idiot.. I mean that animated autotiles (like the waterfall) were animated slower than on map. The map is 48x48 big and I don't think that's a huge size. Maybe any other persons realized that same but if not you can call crazy ._.
« Letzte Änderung: Mai 16, 2008, 10:41:52 von ERZENGEL »

+ [ On-Screen Shop ] +

woratana

  • Gast
+ [ On-Screen Shop ] +
« Antwort #10 am: Mai 17, 2008, 00:04:20 »
That's my fault. I misunderstood. >_>~

Anyway, if someone got this bug. They may want to turn of Spriteset_Map. :)

 


 Bild des Monats

rooftop party

Views: 3583
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal