Rozdawanie pkt. co poziom. - Revlis - 04-03-15 21:44
Witam. Szukałem zawzięcie dobrego skryptu który pozwalałby graczowi rozdawać pkt. statystyk co poziom. Znalazłem skrypt który pasuje mi wręcz idealnie, ale niestety nie potrafię sprawić, by okno rozdawania pkt. wyskakiwało w opcji wywołania zdarzenia [nie chcę, aby wyskakiwało zaraz po zdobyciu poziomu ani aby było dostępne w menu, a raczej aby pkt. można było rozdawać za pomocą specjalnego zdarzenia (Coś na wzór ogniska w grze Dark Souls) po spełnieniu określonych warunków].
Skrypt:
http://www.ultimateam.pl/viewtopic.php?t=2068
Być może taka opcja już istnieje, ale kompletnie nie znam się na skryptach. Liczę na pomoc ;-)
RE: Rozdawanie pkt. co poziom. - Kryzz333 - 04-03-15 21:51
Spróbuj wywołać komendą ten skrypt:
$scene = Scene_RequiemUpgrade.new(0, true)
RE: Rozdawanie pkt. co poziom. - Ayene - 04-03-15 21:58
Spróbuj tej modyfikacji:
Kod:
#==============================================================================
# Requiem Upgrade
# Autor: Requiem
# Modyfikacja by Ayene
#==============================================================================
# $scene = Scene_RequiemUpgrade.new
Points_Gained = 5 # liczba punktów co poziom
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :points
#--------------------------------------------------------------------------
# * Object Initialization (aliased method)
#--------------------------------------------------------------------------
alias requiem_upgwnd_initialize initialize
def initialize(actor_id)
requiem_upgwnd_initialize(actor_id)
@points = 0
end
#--------------------------------------------------------------------------
# * Level Up (aliased method)
#--------------------------------------------------------------------------
alias requiem_upgwnd_lvlup level_up
def level_up
requiem_upgwnd_lvlup
@points += Points_Gained
end
end
#==============================================================================
# ** Requiem_UpgradeWindow
#==============================================================================
class Requiem_UpgradeWindow < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(0,65,320,320)
@actor = actor
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
self.contents.clear
draw_actor_face(@actor,0,0,92)
draw_actor_name(@actor,160,0)
self.contents.font.color = normal_color
self.contents.draw_text(224,28,64,WLH,@actor.level)
self.contents.draw_text(224,26*2,64,WLH,@actor.points)
self.contents.draw_text(128,24*5,96,WLH,@actor.maxhp)
self.contents.draw_text(128,24*6,96,WLH,@actor.maxmp)
self.contents.draw_text(128,24*7,96,WLH,@actor.atk)
self.contents.draw_text(128,24*8,96,WLH,@actor.def)
self.contents.draw_text(128,24*9,96,WLH,@actor.spi)
self.contents.draw_text(128,24*10,96,WLH,@actor.agi)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.font.color = system_color
self.contents.draw_text(128,28,128,WLH,Vocab::level+":")
self.contents.draw_text(128,26*2,128,WLH,"Punkty:")
self.contents.draw_text(0,24*5,128,WLH,Vocab::hp_a+":")
self.contents.draw_text(0,24*6,128,WLH,Vocab::mp_a+":")
self.contents.draw_text(0,24*7,128,WLH,Vocab::atk+":")
self.contents.draw_text(0,24*8,128,WLH,Vocab::def+":")
self.contents.draw_text(0,24*9,128,WLH,Vocab::spi+":")
self.contents.draw_text(0,24*10,128,WLH,Vocab::agi+":")
end
end
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize (y = 0, width = 544)
super(0, y, width, WLH + 32)
end
end
#==============================================================================
# ** Scene_RequiemUpgrade
#==============================================================================
class Scene_RequiemUpgrade < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor_index=0)
create_menu_background
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
@requiem_upgwindow.x = (544 - @requiem_upgwindow.width) / 2
@requiem_upgcmdwnd = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
@requiem_upgcmdwnd.index = 0
@requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
@requiem_upgcmdwnd.y = @requiem_upgwindow.y + 120
@requiem_upgcmdwnd.opacity = 0
@help_window = Window_Help.new (10, 320)
@help_window.x = (544 - @requiem_upgwindow.width) / 2
@help_window.set_text("L/R - Zmiana bohatera",1)
end
#--------------------------------------------------------------------------
# * Switch to Next Actor Screen
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_RequiemUpgrade.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Switch to Previous Actor Screen
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_RequiemUpgrade.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@requiem_upgwindow.update
@requiem_upgcmdwnd.update
@help_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
if @actor.points > 0
Sound.play_decision
else
Sound.play_buzzer
return
end
case @requiem_upgcmdwnd.index
when 0
@actor.points -= 1
@actor.maxhp += 10
when 1
@actor.points -= 1
@actor.maxmp += 10
when 2
@actor.points -= 1
@actor.atk += 1
when 3
@actor.points -= 1
@actor.def += 1
when 4
@actor.points -= 1
@actor.spi += 1
when 5
@actor.points -= 1
@actor.agi += 1
end
end
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@requiem_upgwindow.dispose
@requiem_upgcmdwnd.dispose
@help_window.dispose
end
end
Używając polecenia 'Script', wywołaj:
Kod:
$scene = Scene_RequiemUpgrade.new
RE: Rozdawanie pkt. co poziom. - Revlis - 04-03-15 22:07
Dziękuję za szybką odpowiedź :)
Wszystko gra tak jak należy, ale mam jeszcze jedną małą prośbę.
Przy zdobyciu poziomu przez członka drużyny nie pojawia się już ikonka + Blizzarda.
Bardzo zależałoby mi na czymś, co przypominałoby o możliwych do wydania pkt. statystyk.
Czy można zrobić tak, aby w nowej wersji skryptu ikonka wciąż pojawiała się po zdobyciu poziomu?
RE: Rozdawanie pkt. co poziom. - Ayene - 04-03-15 22:12
Mhm, zastąp wcześniejszy skrypt poniższym:
Kod:
#==============================================================================
# Requiem Upgrade
# Autor: Requiem
# Modyfikacja by Ayene
# Modyfikacja z ikoną awansu pobrana od Blizzarda
#==============================================================================
# $scene = Scene_RequiemUpgrade.new
Points_Gained = 5 # liczba punktów co poziom
#==============================================================================
# ** Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :points
#--------------------------------------------------------------------------
# * Object Initialization (aliased method)
#--------------------------------------------------------------------------
alias requiem_upgwnd_initialize initialize
def initialize(actor_id)
requiem_upgwnd_initialize(actor_id)
@points = 0
end
#--------------------------------------------------------------------------
# * Level Up (aliased method)
#--------------------------------------------------------------------------
alias requiem_upgwnd_lvlup level_up
def level_up
requiem_upgwnd_lvlup
@points += Points_Gained
end
end
#==============================================================================
# ** Requiem_UpgradeWindow
#==============================================================================
class Requiem_UpgradeWindow < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(0,65,320,320)
@actor = actor
update
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
self.contents.clear
draw_actor_face(@actor,0,0,92)
draw_actor_name(@actor,160,0)
self.contents.font.color = normal_color
self.contents.draw_text(224,28,64,WLH,@actor.level)
self.contents.draw_text(224,26*2,64,WLH,@actor.points)
self.contents.draw_text(128,24*5,96,WLH,@actor.maxhp)
self.contents.draw_text(128,24*6,96,WLH,@actor.maxmp)
self.contents.draw_text(128,24*7,96,WLH,@actor.atk)
self.contents.draw_text(128,24*8,96,WLH,@actor.def)
self.contents.draw_text(128,24*9,96,WLH,@actor.spi)
self.contents.draw_text(128,24*10,96,WLH,@actor.agi)
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.font.color = system_color
self.contents.draw_text(128,28,128,WLH,Vocab::level+":")
self.contents.draw_text(128,26*2,128,WLH,"Punkty:")
self.contents.draw_text(0,24*5,128,WLH,Vocab::hp_a+":")
self.contents.draw_text(0,24*6,128,WLH,Vocab::mp_a+":")
self.contents.draw_text(0,24*7,128,WLH,Vocab::atk+":")
self.contents.draw_text(0,24*8,128,WLH,Vocab::def+":")
self.contents.draw_text(0,24*9,128,WLH,Vocab::spi+":")
self.contents.draw_text(0,24*10,128,WLH,Vocab::agi+":")
end
end
#==============================================================================
# ** Window_Help
#==============================================================================
class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize (y = 0, width = 544)
super(0, y, width, WLH + 32)
end
end
#==============================================================================
# ** Scene_Map
#==============================================================================
class Scene_Map < Scene_Base
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
alias terminate_sds_later terminate
def terminate
terminate_sds_later
@notify.dispose unless @notify.nil?
end
#--------------------------------------------------------------------------
# * Update Frame
#--------------------------------------------------------------------------
alias upd_sds_later update
def update
upd_sds_later
check_icon
end
#--------------------------------------------------------------------------
# * Check Icon
#--------------------------------------------------------------------------
def check_icon
if $game_party.members.any? {|actor| actor.points > 0}
if @notify == nil
@notify = Sprite.new
else
@notify.bitmap = Bitmap.new(24, 24)
@notify.bitmap.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255))
@notify.bitmap.fill_rect(22, 1, 2, 23, Color.new(0, 0, 0))
@notify.bitmap.fill_rect(1, 22, 23, 2, Color.new(0, 0, 0))
@notify.bitmap.set_pixel(23, 0, Color.new(0, 0, 0))
@notify.bitmap.set_pixel(0, 23, Color.new(0, 0, 0))
@notify.bitmap.fill_rect(2, 2, 20, 20, Color.new(0, 0, 224))
@notify.bitmap.fill_rect(4, 10, 16, 4, Color.new(255, 255, 255))
@notify.bitmap.fill_rect(10, 4, 4, 16, Color.new(255, 255, 255))
@notify.opacity = 200
end
@notify.x, @notify.y = 510, 380
@notify.z = 5000
end
@notify.update unless @notify.nil?
end
end
#==============================================================================
# ** Scene_RequiemUpgrade
#==============================================================================
class Scene_RequiemUpgrade < Scene_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor_index=0)
create_menu_background
@actor_index = actor_index
end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
@actor = $game_party.members[@actor_index]
@requiem_upgwindow = Requiem_UpgradeWindow.new(@actor)
@requiem_upgwindow.x = (544 - @requiem_upgwindow.width) / 2
@requiem_upgcmdwnd = Window_Command.new(64,[" +"," +"," +"," +"," +"," +"])
@requiem_upgcmdwnd.index = 0
@requiem_upgcmdwnd.x = @requiem_upgwindow.x + 192
@requiem_upgcmdwnd.y = @requiem_upgwindow.y + 120
@requiem_upgcmdwnd.opacity = 0
@help_window = Window_Help.new (10, 320)
@help_window.x = (544 - @requiem_upgwindow.width) / 2
@help_window.set_text("L/R - Zmiana bohatera",1)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@requiem_upgwindow.dispose
@requiem_upgcmdwnd.dispose
@help_window.dispose
end
#--------------------------------------------------------------------------
# * Switch to Next Actor Screen
#--------------------------------------------------------------------------
def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_RequiemUpgrade.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Switch to Previous Actor Screen
#--------------------------------------------------------------------------
def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_RequiemUpgrade.new(@actor_index)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
update_menu_background
@requiem_upgwindow.update
@requiem_upgcmdwnd.update
@help_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
elsif Input.trigger?(Input::C)
if @actor.points > 0
Sound.play_decision
else
Sound.play_buzzer
return
end
case @requiem_upgcmdwnd.index
when 0
@actor.points -= 1
@actor.maxhp += 10
when 1
@actor.points -= 1
@actor.maxmp += 10
when 2
@actor.points -= 1
@actor.atk += 1
when 3
@actor.points -= 1
@actor.def += 1
when 4
@actor.points -= 1
@actor.spi += 1
when 5
@actor.points -= 1
@actor.agi += 1
end
end
end
end
RE: Rozdawanie pkt. co poziom. - Revlis - 04-03-15 22:16
Serdecznie dziękuję, jesteś wielka :)
Nowa wersja działa jak należy.
Temat do zamknięcia.
|