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
Pomógł: 53 razy Dołączył: 30 Gru 2009 Posty: 515 Skąd: Ruda ĹlÄ ska
Wysłany: Sob 13 Lut, 2010 15:50
A nie daĹo by siÄ tak Ĺźeby w gĂłrnym oknie wyĹwietlaĹ siÄ ten tekst co jest , a w dolnym Ĺźe SHIFT - zmiana zakĹadki ENTER/SPACJA - uĹźycie przedmiotu
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