thomas78 Habitant d'Acassia
Nombre de messages : 51 Age : 27 Date d'inscription : 29/07/2010
| Sujet: I need a script .. Jeu 23 Déc - 14:41 | |
| Salut à tous,et Varkan aussi. Si tu pouvais me passer le script du tri d'objets je crois que tu vois s'que j'veux dire ? Où les autres si vous l'avez sa serai simpa Merci ! | |
|
Varkan Seigneur d'Acassia
Nombre de messages : 1453 Age : 35 Date d'inscription : 15/10/2006
| Sujet: Re: I need a script .. Jeu 23 Déc - 15:50 | |
| Avec les différentes catégories là ? | |
|
thomas78 Habitant d'Acassia
Nombre de messages : 51 Age : 27 Date d'inscription : 29/07/2010
| Sujet: Re: I need a script .. Jeu 23 Déc - 16:27 | |
| Oui voilà,si tu pourrais m'le passer ce serait super ! J'attends le script avant de continuer mon projet. | |
|
Varkan Seigneur d'Acassia
Nombre de messages : 1453 Age : 35 Date d'inscription : 15/10/2006
| Sujet: Re: I need a script .. Jeu 23 Déc - 21:39 | |
| | |
|
thomas78 Habitant d'Acassia
Nombre de messages : 51 Age : 27 Date d'inscription : 29/07/2010
| Sujet: Re: I need a script .. Jeu 23 Déc - 23:11 | |
| Merci,j'attend avec impatience ^^ Juste le script hein.. xD | |
|
Varkan Seigneur d'Acassia
Nombre de messages : 1453 Age : 35 Date d'inscription : 15/10/2006
| Sujet: Re: I need a script .. Ven 24 Déc - 18:15 | |
| Voilà le script modifié par moi pour mon jeu : - Spoiler:
- Code:
-
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #_/ ◆ アイテム分類 - KGC_CategorizeItem ◆ VX ◆ #_/ ◇ Last update : 2008/01/12 ◇ #_/---------------------------------------------------------------------------- #_/ アイテムや武器、防具を種類別に分類する機能を作成します。 #_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ $data_system = load_data("Data/System.rvdata") if $data_system == nil #============================================================================== # ★ カスタマイズ項目 - Customize ★ #============================================================================== module KGC module CategorizeItem # ◆ 自動振り分けを行う ENABLE_AUTO_CATEGORIZE = true # ◆ 複数のカテゴリには配置しない # true にすると、いずれか1つのカテゴリにしか振り分けなくなります。 # (「全種」は例外) NOT_ALLOW_DUPLICATE = false # ◆ カテゴリ識別名 # メモ欄でカテゴリを識別するための名称を並べてください。 # 以下の名称は、メモ欄に記述する必要はありません。 # "全種", "貴重品", "武器", "防具", "盾", "頭防具", "身体防具", "装飾品" CATEGORY_IDENTIFIER = [ "Consommable", #"Food", "Armes", "Boucliers", "Tête", "Corps", "Accessoires", #"Shoulder", #"Feet", "Ressources", #"Suits", "Quêtes", "All", # ← 最後の項目だけは , を付けても付けなくてもOK ] # ◆ アイテムのデフォルトカテゴリ # どのカテゴリにも当てはまらないアイテムの割り当て先です。 ITEM_DEFAULT_CATEGORY = "All" # ◆ リストに表示する名称 # アイテム画面で分類ウィンドウに表示する名称です。 # 「カテゴリ識別名」と同じ順に並べてください。 CATEGORY_NAME = [ "Consommable", #"Food", "Armes", "Boucliers", "Tête", "Corps", "Accessoires", #"Shoulder", #"Feet", "Ressources", #"Suits", "Quêtes", "Tout", ] # ◆ 分類の説明文 # 「カテゴリ識別名」と同じ順に並べてください。 CATEGORY_DESCRIPTION = [ "Les objets consommable", #"Food (Only in menu)", "Armes", "Boucliers", "Casques", "Armures", "Accessoires", #"Equipement for your Shoulders.", #"Equipement for your Feet.", "Les ressources pour le craft", #"Character suits", "Les objets de quête", "Tout les objets", ] # ◆ 分類ウィンドウの座標 [x, y] CATEGORY_WINDOW_POSITION = [264, 128] # ◆ 分類ウィンドウの列数 CATEGORY_WINDOW_COLUMNS = 2 # ◆ 分類ウィンドウの列幅 CATEGORY_WINDOW_COL_WIDTH = 96 # ◆ 分類ウィンドウの列間の空白 CATEGORY_WINDOW_COL_SPACE = 32 end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ $imported = {} if $imported == nil $imported["CategorizeItem"] = true module KGC::CategorizeItem # アイテムのデフォルトカテゴリ index ITEM_DEFAULT_CATEGORY_INDEX = CATEGORY_IDENTIFIER.index(ITEM_DEFAULT_CATEGORY) # 予約カテゴリ index RESERVED_CATEGORY_INDEX = { "Items" => CATEGORY_IDENTIFIER.index("Items"), "Food" => CATEGORY_IDENTIFIER.index("Food"), "Weapon" => CATEGORY_IDENTIFIER.index("Weapon"), "Shield" => CATEGORY_IDENTIFIER.index("Shield"), "Head Guard" => CATEGORY_IDENTIFIER.index("Head Guard"), "Body Guard" => CATEGORY_IDENTIFIER.index("Body Guard"), "Accessory" => CATEGORY_IDENTIFIER.index("Accessory"), "All" => CATEGORY_IDENTIFIER.index("All") } # 正規表現を定義 module Regexp # ベースアイテム module BaseItem # カテゴリ CATEGORY = /^<(?:CATEGORY|分類|カテゴリー?)[ ]*(.*)>/i end end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ RPG::BaseItem #============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # ○ アイテム分類のキャッシュ生成 #-------------------------------------------------------------------------- def create_categorize_item_cache if @__item_category == nil || !KGC::CategorizeItem::ENABLE_AUTO_CATEGORIZE @__item_category = [] else @__item_category.compact! end self.note.split(/[\r\n]+/).each { |line| if line =~ KGC::CategorizeItem::Regexp::BaseItem::CATEGORY # カテゴリ c = KGC::CategorizeItem::CATEGORY_IDENTIFIER.index($1) @__item_category << c if c != nil end } if @__item_category.empty? @__item_category << KGC::CategorizeItem::ITEM_DEFAULT_CATEGORY_INDEX elsif KGC::CategorizeItem::NOT_ALLOW_DUPLICATE # 最後に指定したカテゴリに配置 @__item_category = [@__item_category.pop] end end #-------------------------------------------------------------------------- # ○ アイテムのカテゴリ #-------------------------------------------------------------------------- def item_category create_categorize_item_cache if @__item_category == nil return @__item_category end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ RPG::UsableItem #============================================================================== class RPG::UsableItem < RPG::BaseItem #-------------------------------------------------------------------------- # ○ アイテム分類のキャッシュ生成 #-------------------------------------------------------------------------- def create_categorize_item_cache @__item_category = [] if self.price == 0 @__item_category << KGC::CategorizeItem::RESERVED_CATEGORY_INDEX["Food"] end super end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ RPG::Weapon #============================================================================== class RPG::Weapon < RPG::BaseItem #-------------------------------------------------------------------------- # ○ アイテム分類のキャッシュ生成 #-------------------------------------------------------------------------- def create_categorize_item_cache @__item_category = [] @__item_category << KGC::CategorizeItem::RESERVED_CATEGORY_INDEX["Weapon"] super end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
#============================================================================== # ■ RPG::Armor #============================================================================== class RPG::Armor < RPG::BaseItem #-------------------------------------------------------------------------- # ○ アイテム分類のキャッシュ生成 #-------------------------------------------------------------------------- def create_categorize_item_cache @__item_category = [] @__item_category << KGC::CategorizeItem::RESERVED_CATEGORY_INDEX["Armor"] type = nil case self.kind when 0 type = "Shield" when 1 type = "Head Guard" when 2 type = "Body Guard" when 3 type = "Accessory" end if type != nil @__item_category << KGC::CategorizeItem::RESERVED_CATEGORY_INDEX[type] end super end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Window_Item #============================================================================== class Window_Item < Window_Selectable #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_reader :category # カテゴリ #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 # width : ウィンドウの幅 # height : ウィンドウの高さ #-------------------------------------------------------------------------- alias initialize_KGC_CategorizeItem initialize def initialize(x, y, width, height) @category = 0 initialize_KGC_CategorizeItem(x, y, width, height) end #-------------------------------------------------------------------------- # ○ カテゴリ設定 #-------------------------------------------------------------------------- def category=(value) @category = value refresh end #-------------------------------------------------------------------------- # ● アイテムをリストに含めるかどうか # item : アイテム #-------------------------------------------------------------------------- alias include_KGC_CategorizeItem? include? def include?(item) return false if item == nil # 「全種」なら無条件で含める if @category == KGC::CategorizeItem::RESERVED_CATEGORY_INDEX["All"] return true end result = include_KGC_CategorizeItem?(item) unless result # 使用可能なら追加候補とする if $imported["UsableEquipment"] && $game_party.item_can_use?(item) result = true end end # 戦闘外ならカテゴリ一致判定 unless $game_temp.in_battle result &= (item.item_category.include?(@category)) end return result end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # □ Window_ItemCategory #------------------------------------------------------------------------------ # アイテム画面でカテゴリ選択を行うウィンドウです。 #============================================================================== class Window_ItemCategory < Window_Command #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize cols = KGC::CategorizeItem::CATEGORY_WINDOW_COLUMNS width = KGC::CategorizeItem::CATEGORY_WINDOW_COL_WIDTH * cols + 32 width += (cols - 1) * KGC::CategorizeItem::CATEGORY_WINDOW_COL_SPACE commands = KGC::CategorizeItem::CATEGORY_NAME super(width, commands, cols, 0, KGC::CategorizeItem::CATEGORY_WINDOW_COL_SPACE) self.x = KGC::CategorizeItem::CATEGORY_WINDOW_POSITION[0] self.y = KGC::CategorizeItem::CATEGORY_WINDOW_POSITION[1] self.z = 1000 self.index = 0 end #-------------------------------------------------------------------------- # ● ヘルプテキスト更新 #-------------------------------------------------------------------------- def update_help @help_window.set_text(KGC::CategorizeItem::CATEGORY_DESCRIPTION[self.index]) end end #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★ #============================================================================== # ■ Scene_Item #============================================================================== class Scene_Item < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- alias start_KGC_CategorizeItem start def start start_KGC_CategorizeItem @category_window = Window_ItemCategory.new @category_window.help_window = @help_window show_category_window end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- alias terminate_KGC_CategorizeItem terminate def terminate terminate_KGC_CategorizeItem @category_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias update_KGC_CategorizeItem update def update @category_window.update update_KGC_CategorizeItem if @category_window.active update_category_selection end end #-------------------------------------------------------------------------- # ○ カテゴリ選択の更新 #-------------------------------------------------------------------------- def update_category_selection unless @category_activated @category_activated = true return end # 選択カテゴリー変更 if @last_category_index != @category_window.index @item_window.category = @category_window.index @item_window.refresh @last_category_index = @category_window.index end if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::C) Sound.play_decision hide_category_window end end #-------------------------------------------------------------------------- # ● アイテム選択の更新 #-------------------------------------------------------------------------- alias update_item_selection_KGC_CategorizeItem update_item_selection def update_item_selection if Input.trigger?(Input::B) Sound.play_cancel show_category_window return end update_item_selection_KGC_CategorizeItem end #-------------------------------------------------------------------------- # ○ カテゴリウィンドウの表示 #-------------------------------------------------------------------------- def show_category_window @category_window.open @category_window.active = true @item_window.active = false end #-------------------------------------------------------------------------- # ○ カテゴリウィンドウの非表示 #-------------------------------------------------------------------------- def hide_category_window @category_activated = false @category_window.close @category_window.active = false @item_window.active = true # アイテムウィンドウのインデックスを調整 if @item_window.index >= @item_window.item_max @item_window.index = [@item_window.item_max - 1, 0].max end end end
| |
|
thomas78 Habitant d'Acassia
Nombre de messages : 51 Age : 27 Date d'inscription : 29/07/2010
| Sujet: Re: I need a script .. Dim 26 Déc - 0:04 | |
| Oww merci | |
|
Contenu sponsorisé
| Sujet: Re: I need a script .. | |
| |
|