Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: SaE
Sob 15 Wrz, 2012 18:26
skrypt na tworzenie
Autor Wiadomość
batista1230 




Preferowany:
RPG Maker XP

Dołączył: 15 Wrz 2011
Posty: 76
  Wysłany: Wto 07 Sie, 2012 17:53
skrypt na tworzenie
mam skrypt na tworzenie przedmiotów i blizz abs
ale nie mogę używać tworzenia ponieważ trzeba użyć przycisku'Z'
więc prosiłbym kogoś kto zna się na skryptach czy mógł by zmienić klawisz do ukączenia tworzenia

skrypt-http://www.ultimateam.pl/viewtopic.php?t=2334
________________________
SzamanŻycia
 
 
Tomson1120 




Preferowany:
RPG Maker XP

Pomógł: 1 raz
Dołączył: 06 Sie 2010
Posty: 84
Skąd: Kraków
Wysłany: Wto 07 Sie, 2012 19:10
Nie wiem na jaki chcesz i zmieniłem na R w sumie zobacz czy działa bo nie wiem :roll:

Kod:
#====================================================
# ** System Tworzenia Przedmiotów
# wersja: 1.00
# autor: arev (rmxp.pl)
# wydany: 28-12-2009
#=========================================================
# Instalacja i kompatybilność:
#
# Skopiuj ten skrypt i wklej w nowej zakładce nad 'Main' w swoim projekcie.
# Niniejszy skrypt jest kompatybilny z podstawowym systemem RMXP..
# Skrypt nie nadpisuje żadnych metod ani klas, więc powinien również
# współpracować z innymi skryptami.
#
#
#
# Używanie:
#
# Pod tym wstępem znajdziesz tablicę RECIPES.
# Nowe przepisy dodaje się kolejnymi tablicami jak na przykładzie:
# ['i12', 'i78', 'w3', 'a45', 'a45', 'z', 'i-99']
# i oznacza przedmioty, w - bronie, a - zbroje.
# Zgodnie z przykładowym przepisem - by zrobić przedmiot o ID 99 potrzeba
# jednego przedmiotu o ID 12, jednego przedmiotu o ID 78, jednej broni o ID 3,
# dwóch zbroi o ID 45. Maksymalna ilość składników to 6.
# Jeśli chcesz dodać receptę z mniejszej ilość składników, po prostu uzupełnij
# pozostałe pola znakami 'z' (w cudzysłowiu).
# Ostatni element tablicy to rezultat całej recepty. Pierwszy znak działa jak
# poprzednio, następnie konieczny jest myślnik, a dalej ID przedmiotu,
# który tworzymy.
#
# Aby wejść do ekranu tworzenia przedmiotów wywołaj skrypt:
# $scene = Scene_Craft.new
#
# Kolejność składników podczas tworzenia przedmiotu nie ma znaczenia,
# skrypt sam zajmuje się ich sortowaniem.
#
#
#
# Licencja:
#
# Możesz dowolnie używać tego skryptu w swoin niekomercyjnych projektach.
# Możesz rozpowszechniać ten skrypt (bez pobierania opłat), o ile dołączysz
# informację nt. oryginalnego autora.
# Jeśli chcesz wykorzystać skrypt do celów komercyjnych skontaktuj się ze mną
# za pośrednictwem systemu wiadomości forum www.rmxp.pl lub www.hbgames.org/forums.
#=========================================================

RECIPES = [
["i1", "i1", "i2", "z", "z", "z", "i-3"],
["i3", "i3", "i3", "i3", "i1", "i2", "i-5"],
["i34", "i34" , "i34", "i37","z", "z", "i-20"]
]
#------------------------------------------------------------------------------
class Window_Craft_Components < Window_Selectable

attr_accessor :data

def initialize
super(0, 64, 320, 224)
self.contents = Bitmap.new(width - 32, height - 32)
self.index = 0
self.active = true
@data = [nil, nil, nil, nil, nil, nil]
@item_max = 6
refresh
end

def item
return @data[self.index]
end

def refresh
self.contents.clear
for i in 0..5
x = 0
y = i * 32
if @data[i] != nil
item = @data[i]
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(4 + x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 160, 32, item.name, 0)
else
self.contents.font.color = disabled_color
self.contents.draw_text(4 + x, y, 160, 32, "Puste", 0)
end
end
end

def update_cursor_rect
self.cursor_rect.set(0, self.index * 32, 288, 32)
end

def nullify
@data = [nil, nil, nil, nil, nil, nil]
end

def transmutation
temp = []
for i in 0..5
if @data[i] == nil
temp << "0"
else
case @data[i]
when RPG::Item
temp << "i" + @data[i].id
when RPG::Weapon
temp << "w" + @data[i].id
when RPG::Armor
temp << "a" + @data[i].id
end
end
end
temp = temp.sort
return temp
end

end
#------------------------------------------------------------------------------
class Window_Craft_Result < Window_Base

attr_accessor :item

def initialize
super(320,64,320,224)
self.contents = Bitmap.new(width - 32, height - 32)
@item = nil
@item_code = ""
refresh
end

def refresh
self.contents.clear
if @item == nil
self.contents.font.color = normal_color
self.contents.draw_text(4,0,288,32, "Wybierz składniki.", 0)
else
bitmap = RPG::Cache.icon(@item.icon_name)
self.contents.font.color = text_color(3)
self.contents.draw_text(4,0,288,32, "Grauluje!", 0)
self.contents.blt(4, 65, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(32, 65, 288, 32, @item.name, 0)
self.contents.font.color = disabled_color
self.contents.draw_text(4,128,288,32, "Aby utworzyć przedmiot naciśnij 'Z'", 0)
self.contents.draw_text(4,160,288,32, "proces tworzenia!", 0)
end
end

def make_item(text="")
@item_code = text
if @item_code.include?("-")
temp = @item_code.split("-")
@item = (temp[0] == "i" ? $data_items : "w" ? $data_weapons : $data_armors)[temp[1].to_i]
refresh
end
end

def nullify
@item = nil
refresh
end

end
#------------------------------------------------------------------------------
class Window_Craft_Item < Window_Selectable

def initialize
super(0, 288, 640, 192)
@column_max = 2
refresh
self.active = false
self.index = -1
end

def item
return @data[self.index]
end

def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
unless $game_temp.in_battle
for i in 1...$data_weapons.size
if $game_party.weapon_number(i) > 0
@data.push($data_weapons[i])
end
end
for i in 1...$data_armors.size
if $game_party.armor_number(i) > 0
@data.push($data_armors[i])
end
end
end
@data.push(nil)
@item_max = @data.size
self.contents = Bitmap.new(width - 32, row_max * 32)
for i in 0...@item_max-1
draw_item(i)
end
end

def draw_item(index)
item = @data[index]
x = 4 + index % @column_max * 320
y = index / @column_max * 32
case item
when RPG::Item
number = $game_party.item_number(item.id)
when RPG::Weapon
number = $game_party.weapon_number(item.id)
when RPG::Armor
number = $game_party.armor_number(item.id)
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
self.contents.font.color = normal_color
self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
end

def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = index % @column_max * 320
y = index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, 288, 32)
end

end
#------------------------------------------------------------------------------
class Scene_Craft

def main
@components = Window_Craft_Components.new
@result = Window_Craft_Result.new
@item_window = Window_Craft_Item.new
@help_window = Window_Help.new
@help_window.set_text("Tworzenie Przedmiotów", 1)
Graphics.transition
loop do
Input.update
Graphics.update
update
if $scene != self
break
end
end
Graphics.freeze
@components.dispose
@result.dispose
@item_window.dispose
@help_window.dispose
end

def update
@item_window.update
@components.update
if @components.active
update_comp
return
end
if @item_window.active
update_item
return
end
end

def update_comp
if Input.trigger?(Input::A)
rock_baby
return
end
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
@components.active = false
@item_window.active = true
@item_window.index = 0
end
if Input.trigger?(Input::B)
for i in 0..5
item = @components.data[i]
if item != nil
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
end
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
end
end

def update_item
if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
component = @components.data[@components.index]
if component != nil
case component
when RPG::Item
$game_party.gain_item(component.id, 1)
when RPG::Weapon
$game_party.gain_weapon(component.id, 1)
when RPG::Armor
$game_party.gain_armor(component.id, 1)
end
end
item = @item_window.item
@components.data[@components.index] = item
case item
when RPG::Item
$game_party.lose_item(item.id, 1)
when RPG::Weapon
$game_party.lose_weapon(item.id, 1)
when RPG::Armor
$game_party.lose_armor(item.id, 1)
end
@item_window.refresh
@components.refresh
check_recipes

@item_window.active = false
@item_window.index = -1
@components.active = true
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@item_window.active = false
@item_window.index = -1
@components.active = true
end
end

def check_recipes
things_in_the_pot = []
for i in 0..5
case @components.data[i]
when nil
things_in_the_pot << "R"
when RPG::Item
things_in_the_pot << "i#{@components.data[i].id}"
when RPG::Weapon
things_in_the_pot << "w#{@components.data[i].id}"
when RPG::Armor
things_in_the_pot << "a#{@components.data[i].id}"
end
end

things_in_the_pot = things_in_the_pot.sort
for j in 0...RECIPES.size
temp = RECIPES[j].dup
temp[6] = nil
if things_in_the_pot.size == 6
things_in_the_pot << nil
else
things_in_the_pot[6] = nil
end
if things_in_the_pot == temp
@result.make_item(RECIPES[j][6])
return
else
@result.nullify
end
end
end

def rock_baby
case @result.item
when nil
$game_system.se_play($data_system.buzzer_se)
when RPG::Item
$game_party.gain_item(@result.item.id, 1)
finalize_crafting
when RPG::Weapon
$game_party.gain_weapon(@result.item.id, 1)
finalize_crafting
when RPG::Armor
$game_party.gain_armor(@result.item.id, 1)
finalize_crafting
end
end

def finalize_crafting
$game_system.se_play($data_system.save_se)
@components.nullify
@components.refresh
@item_window.refresh
@result.nullify
end

end
________________________

 
 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
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
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene