Pomogła: 1 raz Dołączyła: 26 Wrz 2009 Posty: 88 Skąd: Stumilowy Las
Wysłany: Pią 09 Paź, 2009 13:17
Podział przedmiotów w menu
Cześć
Tym razem do listy skryptów VX dodam kolejny. Powoduje on podział przedmiotów na; zwykłe, bronie, pancerze i itemki specjalne.
Jeśli chcemy żeby item był specjalny to w Note danego przedmiotu dajemy informację
Specjalne.
Print screen:
Spoiler:
Skrypt wklejamy nad main.
Spoiler:
Kod:
module Ozzma
#==============================================================================
# Podział przedmiotów w menu modyfied by Ozzma
#==============================================================================
module Przedmioty
#------------------------------------------------------------------------
# Po wejściu w przedmioty naciśnij Shift, żeby wybrać grupę.
# Przy przedmiocie, który chcemy uczynić specjalny, dopisujemy w
# notatkach (Note) w bazie danych (Database) słowo - Specjalne
#------------------------------------------------------------------------
def items
result = []
for i in @items.keys.sort
item = $data_items[i]
unless item.note.include?("Specjalne")
result.push($data_items[i]) if @items[i] > 0
end
end
for i in @weapons.keys.sort
result.push($data_weapons[i]) if @weapons[i] > 0
end
for i in @armors.keys.sort
result.push($data_armors[i]) if @armors[i] > 0
end
for i in @items.keys.sort
item = $data_items[i]
if @items[i] > 0 and item.note.include?("Specjalne")
result.push($data_items[i])
end
end
return result
end
end
return false unless item.note.include?(Key_Note)
end
if $game_temp.in_battle
return false unless item.is_a?(RPG::Item)
end
return true
end
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
unless item.note.include?("Specjalne")
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
class Scene_Item < Scene_Base
include Ozzma::Przedmioty
alias puppet_item_enhance_start start
alias puppet_item_enhance_terminate terminate
alias puppet_item_enhance_return_scene return_scene
alias puppet_item_enhance_update update
def terminate
puppet_item_enhance_terminate
@filter_window.dispose
end
def return_scene
set_filter(0)
puppet_item_enhance_return_scene
end
def update
puppet_item_enhance_update
@filter_window.update
update_input_filter
update_help_window
end
def update_input_filter
if @item_window.active
if Input.trigger?(Input::A)
Sound.play_decision
@item_window.active = false
@filter_window.active = true
@item_window.index = 0
end
elsif @filter_window.active
if Input.trigger?(Input::B)
Sound.play_cancel
@filter_window.active = false
@item_window.active = true
elsif Input.trigger?(Input::C)
case @filter_window.index
when 0; set_filter(0)
when 1; set_filter(1)
when 2; set_filter(2)
when 3; set_filter(3)
when 4; set_filter(4)
end
end
end
end
def update_help_window
if @filter_window.active
case @filter_window.index
when 0; @help_window.set_text(All_Desc, 1)
when 1; @help_window.set_text(Item_Desc, 1)
when 2; @help_window.set_text(Weapon_Desc, 1)
when 3; @help_window.set_text(Armor_Desc, 1)
when 4; @help_window.set_text(Key_Desc, 1)
end
end
end
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Sob 13 Lut, 2010 16:07
Aha. To teraz rozumiem. Sprawdź czy działa. Podmień na poniższy skrypt:
Spoiler:
Kod:
module Ozzma
#==============================================================================
# Podział przedmiotów w menu modyfied by Ozzma
#==============================================================================
module Przedmioty
#------------------------------------------------------------------------
# Po wejściu w przedmioty naciśnij Shift, żeby wybrać grupę.
# Przy przedmiocie, który chcemy uczynić specjalny, dopisujemy w
# notatkach (Note) w bazie danych (Database) słowo - Specjalne
#------------------------------------------------------------------------
All_Desc = "Pokaż wszystko"
Item_Desc = "Pokaż zwykłe przedmioty"
Weapon_Desc = "Pokaż broń"
Armor_Desc = "Pokaż pancerz"
Key_Desc = "Pokaż przedmioty specjalne"
end
end
class Game_Party < Game_Unit
def items
result = []
for i in @items.keys.sort
item = $data_items[i]
unless item.note.include?("Specjalne")
result.push($data_items[i]) if @items[i] > 0
end
end
for i in @weapons.keys.sort
result.push($data_weapons[i]) if @weapons[i] > 0
end
for i in @armors.keys.sort
result.push($data_armors[i]) if @armors[i] > 0
end
for i in @items.keys.sort
item = $data_items[i]
if @items[i] > 0 and item.note.include?("Specjalne")
result.push($data_items[i])
end
end
return result
end
end
return false unless item.note.include?(Key_Note)
end
if $game_temp.in_battle
return false unless item.is_a?(RPG::Item)
end
return true
end
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
number = $game_party.item_number(item)
enabled = enable?(item)
rect.width -= 4
draw_item_name(item, rect.x, rect.y, enabled)
unless item.note.include?("Specjalne")
self.contents.draw_text(rect, sprintf(":%2d", number), 2)
end
end
end
end
class Scene_Item < Scene_Base
include Ozzma::Przedmioty
alias puppet_item_enhance_start start
alias puppet_item_enhance_terminate terminate
alias puppet_item_enhance_return_scene return_scene
alias puppet_item_enhance_update update
def terminate
puppet_item_enhance_terminate
@filter_window.dispose
@info_window.dispose
end
def return_scene
set_filter(0)
puppet_item_enhance_return_scene
end
def update
puppet_item_enhance_update
@filter_window.update
@info_window.update
update_input_filter
update_help_window
end
def update_input_filter
if @item_window.active
if Input.trigger?(Input::A)
Sound.play_decision
@item_window.active = false
@filter_window.active = true
@item_window.index = 0
end
elsif @filter_window.active
if Input.trigger?(Input::B)
Sound.play_cancel
@filter_window.active = false
@item_window.active = true
elsif Input.trigger?(Input::C)
case @filter_window.index
when 0; set_filter(0)
when 1; set_filter(1)
when 2; set_filter(2)
when 3; set_filter(3)
when 4; set_filter(4)
end
end
end
end
def update_help_window
if @filter_window.active
case @filter_window.index
when 0; @help_window.set_text(All_Desc, 1)
when 1; @help_window.set_text(Item_Desc, 1)
when 2; @help_window.set_text(Weapon_Desc, 1)
when 3; @help_window.set_text(Armor_Desc, 1)
when 4; @help_window.set_text(Key_Desc, 1)
end
end
end
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Wto 27 Kwi, 2010 17:39
Ale w jakim skrypcie wyskakuje Tobie błąd, bo przyglądając się temu z tego tematu, nie ma w linijce 201 żadnego odwołania do argumentów klasy. Podaj dokładną treść komunikatu, albo wklej screenshota.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum