질문과 답변

Extra Form

#===============================================================================
#
# Cozziekuns Simple Sort Inventory
# Last Date Updated: 09/06/10
#
# Like in Tales of Phantasia, this inventory allows you to sort your items in
# the categories: All, Items, Weapons and Armours.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 06/01/10 - Created Script.
# o 06/01/10 - Updated with Modern Algebra's recommendations.
# o 06/01/10 - Once again updated with Modern Algebra's recommendations.
# o 08/27/10 - Updated with Scrolling support. Thanks kawagiri for the idea, and
#              Modern Algebra for some help.
# o 09/06/10 - Updated with some bugfixing. Thanks Fizzly for finding that out.
#===============================================================================
# What's to come?
# -----------------------------------------------------------------------------
# o Nothing! Suggest something.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# Change the modules to your liking. The "hard" parts have instructions of their
# own.
#===============================================================================

$imported = {} if $imported == nil
$imported["CozSimplSortInvent"] = true

module COZZIEKUNS
  module SSI
    CATEGORY_TEXT = "Category:"
   
#===============================================================================
# Extra Item Categories (Inspired by Modern Algebra)
# ------------------------------------------------------------------------------
# How should I go about explaining something like this? Well, basically, each
# item in the hash represents a certain category. For example, the first hash we
# see here is:
#
# 0 => [144, "All", false]## The syntax of this is:
#
# Category ID => [Icon Number, Text, Prime]
#
# Probably the most important part, the category ID is the number you want to
# put into the notebox that the item contains. For example, if you wanted to
# make the item "World Map" into a key item, simply add the text:
#
# item_category[4]
#
# into the notebox. Note that numbers 0, 1, 2, and 3 are special. They're prime
# categories. Sound special right? Not really, this just means you have to have
# them in the inventory for this script to work. I could've gotten rid of them,
# but that would've just given more work on your part (and mine), so bear with
# them, please. Icon Numbers and Text are pretty self explanatory.
#
# Last, but not least, is the "Prime" function (inspired by Kyraiki). Setting
# this to "true" means that anything in the prime category will not show up in
#the item, weapon or armour categories. You can set if you want it to show up
# in all.
#===============================================================================
      MOD_ALG_ITEM_CATEGORIES = {

          0 => [144, "All", false],
          1 => [64, "Items", false],
          2 => [26, "Weapons", false],
          3 => [40, "Armours", false],
          4 => [80, "Key Items", true], 
          5 => [90, "Filler", false],
          6 => [92, "Scrolling", false],
          7 => [32, "Scrolling", false],
        }
                    
        MOD_ALG_ITEM_CATEGORY_WIDTH = 220 # How wide you want your text window.
        KYRIAKI_ALL_CATEOGRY_PRIME = false # If you want prime key items to show up in the all window.
        MAX_NUMBER = (544 - MOD_ALG_ITEM_CATEGORY_WIDTH) / 54 # The maximum number of icons that will fit.
      end
    end
   
#==============================================================================
# ** RPG::BaseItem
#------------------------------------------------------------------------------
#  The superclass of all states.
#==============================================================================

class RPG::BaseItem
    #--------------------------------------------------------------------------
    # * Cozziekuns Category Index
    #--------------------------------------------------------------------------
    def coz_modalg_category_index
      @coz_modalg_category_index = 0
      if self.note[/item_category[(d+)]/i] != nil
        @coz_modalg_category_index = $1.to_i
      end
      return @coz_modalg_category_index
    end
  end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
#  This window displays a list of inventory items for the item screen, etc.
#==============================================================================

class Window_Item < Window_Selectable 
   #--------------------------------------------------------------------------
   # * Refresh
   #--------------------------------------------------------------------------
   alias coz_modalg_ssi_refresh refresh
   def refresh(sort_index = 0)
     @sort_index = sort_index   coz_modalg_ssi_refresh
   end
   #--------------------------------------------------------------------------
   # * Whether or not to include in item list
   #     item : item
   #--------------------------------------------------------------------------
   alias coz_modalg_ssi_include? include?
   def include?(item)
     val = coz_modalg_ssi_include?(item)
     return false if !val
     return case @sort_index
     when 0
       unless COZZIEKUNS::SSI::KYRIAKI_ALL_CATEOGRY_PRIME
         if COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES[item.coz_modalg_category_index][2]
           return false
         else
           return true
         end
       else
         return true
       end
       when 1
         if COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES[item.coz_modalg_category_index][2]
           return false
         else
           return item.is_a?(RPG::Item)
         end
         when 2
           if COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES[item.coz_modalg_category_index][2]
             return false
           else
             return item.is_a?(RPG::Weapon)
           end
           when 3
             if COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES[item.coz_modalg_category_index][2]
               return false
             else
               return item.is_a?(RPG::Armor)
             end
             when 4..999
               return item.coz_modalg_category_index == @sort_index
             end
           end
         end
        
#==============================================================================
# ** Window_ItemCategory
#------------------------------------------------------------------------------
#  This window displays what type of item is being displayed.
#==============================================================================
class Window_ItemCategory < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y, width)
    super(x, y, width, WLH + 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(sort_index = 0)
    @sort_index = sort_index
    @item_categories = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES
    @item_categories_width = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORY_WIDTH
    @category_string = COZZIEKUNS::SSI::CATEGORY_TEXT
    self.contents.clear    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, @item_categories_width - 40, WLH, @category_string, 0)
    self.contents.font.color = normal_color
    for i in 0...@item_categories.size
      if @sort_index == i
        self.contents.draw_text(4, 0, @item_categories_width - 40, WLH, @item_categories[i][1], 2)
      end
    end
    endend
#==============================================================================
# ** Window_ItemSort
#------------------------------------------------------------------------------
#  This window displays what type of item is being displayed.
#==============================================================================

class Window_ItemSort < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     x : window X coordinate
  #     y : window Y coordinate
  #--------------------------------------------------------------------------
  def initialize(x, y, width)
    super(x, y, width, WLH + 32)
    @ox = 0
    if COZZIEKUNS::SSI::MAX_NUMBER < COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES.size
      self.contents = Bitmap.new(self.width - 32 + ((COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES.size - COZZIEKUNS::SSI::MAX_NUMBER) * 54), self.height - 32)
    end
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh(sort_index = 0)
    @sort_index = sort_index
    @item_categories = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES
    @item_categories_width = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORY_WIDTH
    self.contents.clear
    for i in 0...@item_categories.size
      @icon_x = 0 + (i * ((544 - @item_categories_width) / @item_categories.size))
      if @item_categories.size < COZZIEKUNS::SSI::MAX_NUMBER
        draw_item(i)
      else
        draw_items(i)
      end
      if @sort_index == i
        if @item_categories.size < COZZIEKUNS::SSI::MAX_NUMBER
          draw_icon(@item_categories[i][0], @icon_x, 0, true)
        else
          draw_icon(@item_categories[i][0], i * 54, 0, true)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #
  index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    icons_x = (544 - @item_categories_width) / @item_categories.size
    draw_icon(@item_categories[index][0], index * icons_x, 0, false)
  end
  #--------------------------------------------------------------------------
  # * Draw Items
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_items(index)
    draw_icon(@item_categories[index][0], index * 54, 0, false)
  end
end

#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
#  This class performs the item screen processing.
#==============================================================================
class Scene_Item < Scene_Base
  #-------------------------------------------------------------------------- 
  # * Start processing
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @viewport = Viewport.new(0, 0, 544, 416)
    @help_window = Window_Help.new
    @help_window.viewport = @viewport
    @item_window = Window_Item.new(0, 112, 544, 304)
    @item_window.viewport = @viewport
    @item_window.help_window = @help_window
    @item_window.active = false
    @category_width = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORY_WIDTH
    @category_window = Window_ItemCategory.new(544 - @category_width, 56, @category_width)
    @sort_window = Window_ItemSort.new(0, 56, 544 - @category_width)    @target_window = Window_MenuStatus.new(0, 0)
    @sort_index = 0
    @item_categories = COZZIEKUNS::SSI::MOD_ALG_ITEM_CATEGORIES
    hide_target_window 
  end
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias coz_ssi_terminate terminate
  def terminate
    super
    coz_ssi_terminate
    @sort_window.dispose
    @category_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Update Frame
  #--------------------------------------------------------------------------
  alias coz_ssi_update update
  def update
    super
    coz_ssi_update
    @sort_window.update
    @category_window.update
  end
  #--------------------------------------------------------------------------
  # * Update Item Selection
  #--------------------------------------------------------------------------
  def update_item_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::C)
      @item = @item_window.item
      if @item != nil
        $game_party.last_item_id = @item.id
      end
      if $game_party.item_can_use?(@item)
        Sound.play_decision
        determine_item
      else
        Sound.play_buzzer
      end
    elsif Input.trigger?(Input::Y)
      @sort_index += 1
      @sort_index %= @item_categories.size
      if @sort_index != 0
        if @item_categories.size > COZZIEKUNS::SSI::MAX_NUMBER and @sort_index > COZZIEKUNS::SSI::MAX_NUMBER - 1
          @sort_window.ox += 54
        end
      else
        @sort_window.ox = 0
      end
      @category_window.refresh(@sort_index)
      @sort_window.refresh(@sort_index)
      @item_window.refresh(@sort_index)
      @item_window.index = 0
      Sound.play_cursor
    elsif Input.trigger?(Input::A)
      @sort_index -= 1
      @sort_index %= @item_categories.size
      if @sort_index + 1 == @item_categories.size
        @sort_window.ox += 54 * (@item_categories.size - COZZIEKUNS::SSI::MAX_NUMBER)
      else
        if @item_categories.size > COZZIEKUNS::SSI::MAX_NUMBER and @sort_index > COZZIEKUNS::SSI::MAX_NUMBER - 2
          @sort_window.ox -= 54
        end
      end
      @category_window.refresh(@sort_index)
      @sort_window.refresh(@sort_index)
      @item_window.refresh(@sort_index)
      @item_window.index = 0
      Sound.play_cursor   
    end
  end
end

 

 

 

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

 

위에 스크립트요. 외국 http://rmrk.net/index.php/topic,38851.0.html이 싸이트에서 복사해 온거에요!

 

간단하게 아이템을 정렬해 주는 스크립트인데요. 194번(?)이 계속 오류나는데 어떻게 해야되죠?

 

혹시 시간이 되는 분들은 사용해 보시고 해결방법을 가리켜 주시면 감사하겠습니다!ㅜㅜ

 

그냥 복사해서 쓰시지마시고 제발 답변좀 해주세요~

 

 


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12446
이벤트 작성 RMMV 스위치를 내리고 다시 켰을때, 이벤트의 커스텀 경로를 초기화 하고 싶습니다. 1 file 겐마 2020.09.29 148
이벤트 작성 RMMV 화면 흔들림이 계속되는 상황에서 이동할 수 있도록 만들고 싶습니다. 2 file 소설인 2020.10.13 185
이벤트 작성 RMVXA 캐릭터가 끌려가는 연출, 제자리 점프하는 연출 어떻게 하나요? 4 코볼트코 2020.10.13 547
이벤트 작성 RMVXA 대화 랜덤문장을 나오게 하기 3 file 코볼트코 2020.10.17 218
이벤트 작성 RMVXA 그냥 스위치와 셀프 스위치, 뭐가 다른가요? 3 코볼트코 2020.10.19 475
이벤트 작성 RMVXA 플레이어가 있는 위치에 죽는 이벤트를 등장하게 했을때 다른데 밟고 오지 않으면 죽지가 않아요 4 file 유리컵 2021.07.15 55
이벤트 작성 RMVXA 리셋되는 이벤트를 만들고 싶습니다. 환경사랑 2021.02.12 91
이벤트 작성 RMVXA 파티원들을 특정타일에서 제 캐릭터 좌우로 수평위치시키고 싶어요. 8 윈터. 2020.11.01 225
이벤트 작성 RMMV 장소이동 변수 사용법에 대해 알려주세요 4 file Bigorca 2020.11.08 419
이벤트 작성 기타 옷장에 숨는 이벤트 어떻게해요? 5 RPG메이커초보 2020.11.16 226
이벤트 작성 RMMV 수영 이벤트 도착시 승리 이벤트를 만들고 싶어요 1 file hurakan 2020.11.26 198
이벤트 작성 RMXP 이동속도 관련 1 TH.Wert 2020.12.05 164
이벤트 작성 RMXP 알만툴 xp 질문입니다. 2 사바마 2020.12.10 85
이벤트 작성 RMXP 조건분기 아이템 2 사바마 2020.12.13 188
이벤트 작성 RMMV 플레이어에게로 이동 버그 어떻게 해결하나요? 1 hurakan 2021.08.02 35
이벤트 작성 RMMV 마우스 좌표 그림 띄우기. 4 file 대네온 2020.12.18 304
이벤트 작성 RMMV 화면내에서 기술 이펙트 효과 나타내게 어떻게 하나요? 3 file 코볼트코 2021.02.07 181
이벤트 작성 RMMV 변수에 따른 이득을 어떻게 바꾸나요? 1 hurakan 2021.01.22 88
이벤트 작성 RMVXA 원거리 액알 질문이요 1 그냥사람777 2021.01.31 88
이벤트 작성 RMVXA 전투시 캐릭터가 죽었을때 자동으로 파티에서도 사라지게 할수 있나요? 2 겜만들고싶다앙 2021.02.10 93
Board Pagination Prev 1 ... 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 ... 83 Next
/ 83