Kolejny dzisiaj skrypt
Skrypt do RPG Makera XP daje nam możliwość większego wpływu na rozwój bohaterów.
Co ich poziom mamy do rozdysponowania określoną na początku liczbę punktów, za które możemy zwiększać ich statsy ^@^
Możemy zwiększać im cztery główne statsy; czyli siłę, inteligencję, zręczność i szybkość.
O punktach które możemy rozdać informuje nas ikonka poziomu pokazująca się na ekranie. Możemy ją ofkors wyłączyć
Skrypt wywołujemy kodem:
Kod:
$scene = Scene_Points.new
Aha, wklejamy go nad Main
A oto on:
Spoiler:
Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
STARTING_POINTS = 10 # ilość punktów startowych
POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
DISPLAY_ICON = true # wyświetl ikonę true/false
ICON_DATA = [612, 452, 192]
EVASION = 'Unik'
STR_LIMIT = 999 # max. siły
DEX_LIMIT = 999 # max. zręczności
AGI_LIMIT = 999 # max.szybkości
INT_LIMIT = 999 # max.inteligencji
WINDOW_MODE = true # true/false
AUTOMATIC_CALL = false # true/false
AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
end
#====================================================================
class Array
def sum
result = 0
self.each {|i| result += i if i.is_a?(Numeric)}
return result
end
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
attr_reader :points
alias setup_sds_later setup
def setup(actor_id)
@points = BlizzCFG::STARTING_POINTS
setup_sds_later(actor_id)
end
alias exp_sds_later exp=
def exp=(exp)
old_level = @level
exp_sds_later(exp)
add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
end
def add_stat_points(val)
@points += val if val > 0
end
def remove_stat_points(val)
@points = [@points-val, 0].max
end
alias draw_actor_parameter_sds_later draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
if type == 7
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
else
draw_actor_parameter_sds_later(actor, x, y, type)
end
end
end
#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
attr_accessor :actor
def initialize(actor)
super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
@actor = actor
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
elsif $defaultfonttype != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
end
refresh
end
def remove_points(num)
if @points > 0 && @att[index] > 0
@points = [@points - num, 0].max
@att[index] = [@att[index] - num, 0].max
return true
end
return false
end
def update
super
return unless self.active
if Input.press?(Input::R)
if Input.repeat?(Input::RIGHT)
if add_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.press?(Input::L)
if Input.repeat?(Input::RIGHT)
if add_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.repeat?(Input::RIGHT)
if add_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
def update_cursor_rect
if @index < 0 || !self.active
self.cursor_rect.empty
else
self.cursor_rect.set(32, (@index+1)*64, 64, 32)
end
end
end
#====================================================================
class Window_Sure < Window_Command
#====================================================================
attr_accessor :actor
def update
if @command_window.active
@command_window.update
update_main_command
elsif @sure_window != nil
@sure_window.update
update_sure
elsif @distro_window.active
@distro_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active, @distro_window.active = true, false
end
end
end
def update_main_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @distro_window.points != 0
@command_window.index, @command_window.active = 3, false
make_sure_window
else
$scene = @scene.new
end
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 0 then @command_window.active, @distro_window.active = false, true
when 1
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 2
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 3
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
$scene = @scene.new
end
end
end
end
def update_sure
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@sure_window.dispose
@sure_window, @command_window.active = nil, true
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 1
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 2
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 3
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
$scene = @scene.new
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
end
end
end
end
#====================================================================
class Scene_Battle
#====================================================================
alias main_sds_later main
def main
main_sds_later
if BlizzCFG::AUTOMATIC_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
end
#====================================================================
class Scene_Map
#====================================================================
alias main_sds_later main
def main
main_sds_later
@notify.dispose if @notify != nil
end
alias upd_sds_later update
def update
check_icon if BlizzCFG::DISPLAY_ICON
upd_sds_later
if BlizzCFG::AUTOMATIC_MAP_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
def check_icon
if $game_party.actors.any? {|actor| actor.points > 0}
if @notify == nil
@notify = RPG::Sprite.new
end
end
#====================================================================
# www.ultimateam.pl
#====================================================================
Spoko skrypt. Widzialem juz kiedys podobny ale nie mozna bylo ustawic maxa dla statystyk. Dzienks, przyda sie na pewno ale znowu bede musial zmienic mechanike gry. Trudno :)
Aloha!
W skrypcie wystąpił mały błąd, oto poprawna wersja:
Spoiler:
Kod:
#====================================================================
# Edited by Lartarin the Super Pig ^@^
#====================================================================
module BlizzCFG
#====================================================================
STARTING_POINTS = 10 # ilość punktów startowych
POINTS_PER_LEVEL = 5 # punkty do rozdania co poziom
DISPLAY_ICON = true # wyświetl ikonę true/false
ICON_DATA = [612, 452, 192]
EVASION = 'Unik'
STR_LIMIT = 999 # max. siły
DEX_LIMIT = 999 # max. zręczności
AGI_LIMIT = 999 # max.szybkości
INT_LIMIT = 999 # max.inteligencji
WINDOW_MODE = true # true/false
AUTOMATIC_CALL = true # true/false
AUTOMATIC_MAP_CALL = false # true/false
#====================================================================
ATTR_LIMITS = [STR_LIMIT, DEX_LIMIT, AGI_LIMIT, INT_LIMIT]
#====================================================================
end
#====================================================================
class Array
def sum
result = 0
self.each {|i| result += i if i.is_a?(Numeric)}
return result
end
end
#====================================================================
class Game_Actor < Game_Battler
#====================================================================
attr_reader :points
alias setup_sds_later setup
def setup(actor_id)
@points = BlizzCFG::STARTING_POINTS
setup_sds_later(actor_id)
end
alias exp_sds_later exp=
def exp=(exp)
old_level = @level
exp_sds_later(exp)
add_stat_points((@level - old_level) * BlizzCFG::POINTS_PER_LEVEL)
end
def add_stat_points(val)
@points += val if val > 0
end
def remove_stat_points(val)
@points = [@points-val, 0].max
end
alias draw_actor_parameter_sds_later draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
if type == 7
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, 32, BlizzCFG::EVASION)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, 32, actor.eva.to_s, 2)
else
draw_actor_parameter_sds_later(actor, x, y, type)
end
end
end
#====================================================================
class Window_Distribution_Status < Window_Base
#====================================================================
attr_accessor :actor
def initialize(actor)
super(BlizzCFG::WINDOW_MODE ? 160 : 0, 0, 480, 480)
@actor = actor
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
elsif $defaultfonttype != nil
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
self.contents.font.bold = true
end
refresh
end
def remove_points(num)
if @points > 0 && @att[index] > 0
@points = [@points - num, 0].max
@att[index] = [@att[index] - num, 0].max
return true
end
return false
end
def update
super
return unless self.active
if Input.press?(Input::R)
if Input.repeat?(Input::RIGHT)
if add_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(100)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.press?(Input::L)
if Input.repeat?(Input::RIGHT)
if add_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(10)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
elsif Input.repeat?(Input::RIGHT)
if add_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
elsif Input.repeat?(Input::LEFT)
if remove_points(1)
$game_system.se_play($data_system.cursor_se)
refresh
else
$game_system.se_play($data_system.buzzer_se)
end
end
end
def update_cursor_rect
if @index < 0 || !self.active
self.cursor_rect.empty
else
self.cursor_rect.set(32, (@index+1)*64, 64, 32)
end
end
end
#====================================================================
class Window_Sure < Window_Command
#====================================================================
attr_accessor :actor
def update
if @command_window.active
@command_window.update
update_main_command
elsif @sure_window != nil
@sure_window.update
update_sure
elsif @distro_window.active
@distro_window.update
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active, @distro_window.active = true, false
end
end
end
def update_main_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @distro_window.points != 0
@command_window.index, @command_window.active = 3, false
make_sure_window
else
$scene = @scene.new
end
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 0 then @command_window.active, @distro_window.active = false, true
when 1
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 2
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
@distro_window.index = 0
end
when 3
if @distro_window.points != 0
@command_window.active = false
make_sure_window
else
$scene = @scene.new
end
end
end
end
def update_sure
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@sure_window.dispose
@sure_window, @command_window.active = nil, true
elsif Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
case @command_window.index
when 1
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 2
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
i = (@actor.index+$game_party.actors.size-1) % $game_party.actors.size
@actor = @status_window.actor = @distro_window.actor = $game_party.actors[i]
[@status_window, @distro_window].each {|win| win.refresh}
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
when 3
if @sure_window.index > 0
@distro_window.set_new_attributes if @sure_window.index == 1
$scene = @scene.new
end
@sure_window.dispose
@sure_window, @command_window.active = nil, true
end
end
end
end
#====================================================================
class Scene_Battle
#====================================================================
alias main_sds_later main
def main
main_sds_later
if BlizzCFG::AUTOMATIC_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
end
#====================================================================
class Scene_Map
#====================================================================
alias main_sds_later main
def main
main_sds_later
@notify.dispose if @notify != nil
end
alias upd_sds_later update
def update
check_icon if BlizzCFG::DISPLAY_ICON
upd_sds_later
if BlizzCFG::AUTOMATIC_MAP_CALL &&
$game_party.actors.any? {|actor| actor.points > 0}
$scene = Scene_Points.new
end
end
def check_icon
if $game_party.actors.any? {|actor| actor.points > 0}
if @notify == nil
@notify = RPG::Sprite.new
end
end
#====================================================================
# www.ultimateam.pl
#====================================================================
Pomogła: 232 razy Dołączyła: 18 Wrz 2007 Posty: 2424
Wysłany: Sro 30 Gru, 2009 20:56
To dlatego, że zapis gry musi zawierać skrypt... innymi słowy, dopiero po umieszczeniu skryptu powinieneś zapisać grę, a wtedy bez problemu się wczyta.
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