BellGoRiiing
Member
I do not script, have no idea on how to either. All I can do is explain the problem I have encountered with it.
Script 1
I found this script in the Submitted Scripts board a couple pages back and decided to test it out. Right when I start the game I get this weird error, I'll post it later if needed. Basically the error was saying it couldn't find the Graphics/Characters/Facesets or something like that. If you know what's wrong here let me know, if you want me to tell you exactly what the script says tell me.
Script 2
Same situation as above, it all works fine until I use a recovery item during battle, then I get another weird error. If you want me to tell you exactly what the error says then let me know. This was found on a Japanese site, http://www.66RPG.com, if this could be the cause then again, let me know.
Script 3 and 4
These two scripts basically works together, I don't know how it all works and stuff but...
Script 1
#==============================================================================
# Easy Party Switcher by Blizzard
# Version 1.2b
# Date: 21.05.2006
# Date v1.1: 25.05.2006
# Date v1.2b: 27.05.2006
#
#
# This is the official Party Switcher of:
# Chaos Project - The Three Moonsâ„¢
#
#
# Special Thanks to:
# Zeriab for pointing out a few glitches and shortening the code. =D
#
#
# IMPORTANT NOTE:
#
# Be sure to set the $party_max_size to the maximum size of your party.
# There is already a preconfiguration of 4.
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested altough. Can cause
# incompatibility with Party Change Systems. WILL corrupt your old savegames.
#
#
# Features:
#
# - Set party members for "not _available" (shown transparent in the reserve)
# - Remove party members from the reserve list ("disabled_for_party")
# - Set party members, who MUST be in the party (shown transparent in the
# current party, "must_be_in_party")
# - option either to wipe the party (for multi-party use) or only remove every
# member (except 1) from the party.
# - Easy to use and easy to switch party members
# - also supports small parties (2 or 3 members) and large parties (5 or more)
#
#
# How to use:
#
# To call this script, make a "Call script" command in an event. The syntax is:
#
# $scene = Scene_PartySwitcher.new
# or
# $scene = Scene_PartySwitcher.new(XXX)
# or
# $scene = Scene_PartySwitcher.new(XXX, 1)
# or
# $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ)
#
# - If you use the first syntax, no extra feature will be applied and you can
# switch the party as you wish.
# - If you use the second syntax, you can replace XXX for 1 to remove all party
# members except one (either one, who must be in the party or a random one), or
# replace XXX with 2, to cause a wipe party. Wiping a party will disable the
# of the current members and a NEW party of the remaining members must be
# formed. If you replace it with 3, the current party configuration will be
# stored for a later fast switch-back.
# - If you use the third sytnax, you can use the XXX as described above or just
# set it to 0 to disable it. Also the "1" in the syntax will reset any
# disabled_for_party and is made to be used after multi-party use.
# - If you use the fourth syntax you can replace ZZZ with 1 to replace the
# party with a stored one AND store the current or replace it with 2 to replace
# the party with a stored one, but without storing the current. USE THIS ONLY
# IF YOU ASSUME TO HAVE A STORED PARTY READY! This syntax will not open the
# Party Switcher and it will override the commands XXX and YYY, so you can
# replace these with any number.
#
# - Character faces go into a "Faces" folder in "Characters" and they have the
# same name as the character spritesets have.
#
#
# Other syntaxes:
# $game_actors[XXX].not_available = true/false
# $game_actors[XXX].disabled_for_party = true/false
# $game_actors[XXX].must_be_in_party = true/false
#
# - not_available will disable the possibility of an already unlocked character
# to be in th current party.
# - disabled for party will cause the character NOT to appear in the party
# switch screen.
# - must_be_in_party will cause the character to be automatically moved into
# the current party, while switching parties and also he cannot be put in the
# reserve.
#
#
# Additional note:
#
# For your own sake, do not apply the attribute "must_be_in_party" to a
# character at the same time with "not_available" or "disabled_for_party" as
# this WILL disrupt your party and party switch system.
#
#==============================================================================
$party_max_size = 4
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party
attr_accessor :disabled_for_party
attr_accessor :not_available
alias setup_eps_later setup
def setup(actor_id)
@must_be_in_party = false
@disabled_for_party = false
@not_available = false
setup_eps_later(actor_id)
end
end
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
def actors=(actors)
@actors = actors
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
def draw_actor_face(actor, x, y)
if actor != nil
bitmap = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
cw = 80
ch = 80
src_rect = Rect.new(0, 0, cw, ch)
if actor.not_available or actor.must_be_in_party
self.contents.blt(x, y, bitmap, src_rect, 128)
else
self.contents.blt(x, y, bitmap, src_rect)
end
end
end
end
#==============================================================================
# Window_Current
#==============================================================================
class Window_Current < Window_Selectable
def initialize
if $party_max_size > 4
super(0, 0, 240 + 32, 480)
else
super(0, 0, 240 + 32, $party_max_size * 120)
end
@item_max = $party_max_size
self.contents = Bitmap.new(width - 32, 480 - 32 + (@item_max - 4) * 120)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 0
y = i * 120 - 4
actor = $game_party.actors
self.contents.font.color = normal_color
if actor != nil
draw_actor_face(actor, x, y + 8)
draw_actor_name(actor, x + 160, y)
draw_actor_level(actor, x + 96, y)
draw_actor_hp(actor, x + 96, y + 32)
draw_actor_sp(actor, x + 96, y + 64)
end
end
end
def setactor(index_1, index_2)
temp = $game_party.actors[index_1]
$game_party.actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def getactor(index)
return $game_actors[$game_party.actors[index].id]
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 = 0
y = (@index / @column_max) * 120 - self.oy
self.cursor_rect.set(x, y, self.width - 32, 88)
end
def clone_cursor
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 = 0
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width, 88)
bitmap = RPG::Cache.windowskin("Cursor_Current")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 116
end
def top_row=(row)
row = row % row_max
self.oy = row * 120
end
def page_row_max
return (self.height / 120)
end
end
#==============================================================================
# Window_Reserve
#==============================================================================
class Window_Reserve < Window_Selectable
def initialize
super(0, 0, 400 - 32, 320)
setup
@column_max = 3
if (@item_max / @column_max) >= 3
self.contents = Bitmap.new(width - 32, @item_max / @column_max * 96)
else
self.contents = Bitmap.new(width - 32, height - 32)
end
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.active = false
self.index = -1
refresh
end
def setup
@actors = []
for i in 0...$data_actors.size
flag = false
for j in 0...$game_party.actors.size
if $game_actors == $game_party.actors[j]
flag = true
end
end
if flag == false
unless $game_actors == nil or $game_actors.disabled_for_party
@actors.push($game_actors)
end
end
end
@item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3
end
def refresh
self.contents.clear
for i in 0... @actors.size
drawing(@actors, i)
end
end
def drawing(actor, i)
x = (i % 3) * 112 + 16
y = (i / 3) * 96 - 8
self.contents.font.color = normal_color
draw_actor_face(actor, x, y + 18)
end
def getactor(index)
return @actors[index]
end
def setactor(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = @actors[index_2]
@actors[index_2] = temp
refresh
end
def setparty(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
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) * 112 + 8
y = (@index / @column_max) * 96 - self.oy
self.cursor_rect.set(x, y, 96, 96)
end
def clone_cursor
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) * 112 + 8
y = (@index / @column_max) * 96
src_rect = Rect.new(0, 0, 96, 96)
bitmap = RPG::Cache.windowskin("Cursor_Reserve")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 96
end
def top_row=(row)
row = row % row_max
self.oy = row * 96
end
def page_row_max
return (self.height - 32) / 96
end
end
#==============================================================================
# Window_HelpStatus
#==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor)
super(0, 0, 400 - 32, 160)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh(gotactor)
self.active = false
end
def refresh(actor)
self.contents.clear
if actor != nil
x = 0
y = 0
self.contents.font.color = normal_color
if actor.not_available
self.contents.draw_text(x + 8, y, 160, 32, "not available", 0)
end
draw_actor_face(actor, x, y + 40)
draw_actor_name(actor, x + 160, y + 32)
draw_actor_level(actor, x + 96, y + 32)
draw_actor_hp(actor, x + 96, y + 64)
draw_actor_sp(actor, x + 96, y + 96)
end
end
end
#==============================================================================
# Window_Warning
#==============================================================================
class Window_Warning < Window_Base
def initialize
super(0, 0, 320, 96)
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.x = 320 - (width / 2)
self.y = 240 - (height / 2)
self.z = 9999
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 288, 32, "You cannot remove", 1)
self.contents.draw_text(0, 32, 288, 32, "the last party member!", 1)
end
end
#==============================================================================
# Scene_PartySwitcher
#==============================================================================
class Scene_PartySwitcher
def initialize(wipe_party = 0, reset = 0, store = 0)
@wipe_party = wipe_party
@store = store
@reset = reset
@current_window_temp = 0
@reserve_window_temp = 0
@canceler = false
@temp_window = ""
end
def main
if @store == 0
if @wipe_party == 1
setup_forced_party
elsif @wipe_party == 2
wipe_party
elsif @wipe_party == 3
store_party
wipe_party
end
@current_window = Window_Current.new
@current_window.index = 0
@current_window.active = true
@reserve_window = Window_Reserve.new
@reserve_window.x = 240 + 32
@reserve_window.y = 160
@warning_window = Window_Warning.new
actor = @reserve_window.getactor(0)
@help_window = Window_HelpStatus.new(actor)
@help_window.x = 240 + 32
if @reset == 1
actor.not_available = false
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@current_window.dispose
@reserve_window.dispose
@help_window.dispose
else
swap_parties(@store)
$scene = Scene_Map.new
end
sort_party
$game_player.refresh
Graphics.transition
end
def update
check = @reserve_window.index
if @reserve_window.active
reserve_update
@reserve_window.update
end
if check != @reserve_window.index
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
end
if @current_window.active
current_update
@current_window.update
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @canceler == false
$scene = Scene_Map.new
elsif @canceler == true
@temp_window = ""
@canceler = false
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
@current_window.refresh
@reserve_window.refresh
end
return
end
if Input.trigger?(Input::A)
sort_party
@current_window.refresh
end
end
def current_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @current_window.index
@temp_window = "Current"
@current_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@current_window.active = false
@reserve_window.active = true
@current_window_temp = @current_window.index
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.index = -1
@reserve_window.index = @reserve_window_temp
if @canceler == false
@help_window.refresh(actor)
end
return
end
end
def reserve_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @reserve_window.index
@temp_window = "Reserve"
@reserve_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if (@reserve_window.index % 3) == 0
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@reserve_window.active = false
@current_window.active = true
@reserve_window_temp = @reserve_window.index
@reserve_window.index = -1
@current_window.index = @current_window_temp
end
return
end
end
def switch_members
if @temp_window == "Reserve" and @reserve_window.active
@reserve_window.setactor(@temp_actor_index, @reserve_window.index)
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
end
if @temp_window == "Current" and @current_window.active
@current_window.setactor(@temp_actor_index, @current_window.index)
end
if @temp_window == "Reserve" and @current_window.active
actor1 = @current_window.getactor(@current_window.index)
actor2 = @reserve_window.getactor(@temp_actor_index)
if call_warning(@current_window.index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@temp_actor_index, @current_window.index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window_temp)
@help_window.refresh(actor)
else
warning
end
end
if @temp_window == "Current" and @reserve_window.active
actor1 = @current_window.getactor(@temp_actor_index)
actor2 = @reserve_window.getactor(@reserve_window.index)
if call_warning(@temp_actor_index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@reserve_window.index, @temp_actor_index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
else
warning
end
end
$game_system.se_play($data_system.decision_se)
@canceler = false
@temp_window = ""
return
end
def sort_party
actors = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor != nil
actors.push($game_actors[actor.id])
end
end
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil
actor.must_be_in_party = false
end
end
end
def wipe_party
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor != nil
actor.not_available = true
end
end
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil and actor.must_be_in_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
if $game_party.actors.size == 0
for i in 0...$data_actors.size
actor = $game_actors
unless actor == nil or actor.not_available or actor.disabled_for_party
$game_party.add_actor(actor.id)
return
end
end
end
end
def setup_forced_party
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil and actor.must_be_in_party and
not actor.disabled_for_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
end
def store_party
$stored_party = $game_party.actors
end
def swap_parties(swap)
temp = $game_party.actors
for i in 0...temp.size
if temp != nil
temp.not_available = true
end
end
for i in 0...$stored_party.size
if $stored_party != nil
$stored_party.not_available = false
end
end
$game_party.actors = $stored_party
if swap == 1
$stored_party = temp
else
$stored_party = nil
end
end
def call_warning(index, actor2)
actor1 = $game_party.actors[index]
if actor1 != nil and actor2 == nil
count = 0
for i in $game_party.actors
if i != nil
count += 1
end
end
if count <= 1
return false
end
end
return true
end
def warning
$game_system.se_play($data_system.buzzer_se)
@warning_window.visible = true
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
@warning_window.visible = false
@current_window.refresh
@reserve_window.refresh
break
end
end
return
end
end
# Easy Party Switcher by Blizzard
# Version 1.2b
# Date: 21.05.2006
# Date v1.1: 25.05.2006
# Date v1.2b: 27.05.2006
#
#
# This is the official Party Switcher of:
# Chaos Project - The Three Moonsâ„¢
#
#
# Special Thanks to:
# Zeriab for pointing out a few glitches and shortening the code. =D
#
#
# IMPORTANT NOTE:
#
# Be sure to set the $party_max_size to the maximum size of your party.
# There is already a preconfiguration of 4.
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested altough. Can cause
# incompatibility with Party Change Systems. WILL corrupt your old savegames.
#
#
# Features:
#
# - Set party members for "not _available" (shown transparent in the reserve)
# - Remove party members from the reserve list ("disabled_for_party")
# - Set party members, who MUST be in the party (shown transparent in the
# current party, "must_be_in_party")
# - option either to wipe the party (for multi-party use) or only remove every
# member (except 1) from the party.
# - Easy to use and easy to switch party members
# - also supports small parties (2 or 3 members) and large parties (5 or more)
#
#
# How to use:
#
# To call this script, make a "Call script" command in an event. The syntax is:
#
# $scene = Scene_PartySwitcher.new
# or
# $scene = Scene_PartySwitcher.new(XXX)
# or
# $scene = Scene_PartySwitcher.new(XXX, 1)
# or
# $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ)
#
# - If you use the first syntax, no extra feature will be applied and you can
# switch the party as you wish.
# - If you use the second syntax, you can replace XXX for 1 to remove all party
# members except one (either one, who must be in the party or a random one), or
# replace XXX with 2, to cause a wipe party. Wiping a party will disable the
# of the current members and a NEW party of the remaining members must be
# formed. If you replace it with 3, the current party configuration will be
# stored for a later fast switch-back.
# - If you use the third sytnax, you can use the XXX as described above or just
# set it to 0 to disable it. Also the "1" in the syntax will reset any
# disabled_for_party and is made to be used after multi-party use.
# - If you use the fourth syntax you can replace ZZZ with 1 to replace the
# party with a stored one AND store the current or replace it with 2 to replace
# the party with a stored one, but without storing the current. USE THIS ONLY
# IF YOU ASSUME TO HAVE A STORED PARTY READY! This syntax will not open the
# Party Switcher and it will override the commands XXX and YYY, so you can
# replace these with any number.
#
# - Character faces go into a "Faces" folder in "Characters" and they have the
# same name as the character spritesets have.
#
#
# Other syntaxes:
# $game_actors[XXX].not_available = true/false
# $game_actors[XXX].disabled_for_party = true/false
# $game_actors[XXX].must_be_in_party = true/false
#
# - not_available will disable the possibility of an already unlocked character
# to be in th current party.
# - disabled for party will cause the character NOT to appear in the party
# switch screen.
# - must_be_in_party will cause the character to be automatically moved into
# the current party, while switching parties and also he cannot be put in the
# reserve.
#
#
# Additional note:
#
# For your own sake, do not apply the attribute "must_be_in_party" to a
# character at the same time with "not_available" or "disabled_for_party" as
# this WILL disrupt your party and party switch system.
#
#==============================================================================
$party_max_size = 4
#==============================================================================
# Game_Actor
#==============================================================================
class Game_Actor < Game_Battler
attr_accessor :must_be_in_party
attr_accessor :disabled_for_party
attr_accessor :not_available
alias setup_eps_later setup
def setup(actor_id)
@must_be_in_party = false
@disabled_for_party = false
@not_available = false
setup_eps_later(actor_id)
end
end
#==============================================================================
# Game_Party
#==============================================================================
class Game_Party
def actors=(actors)
@actors = actors
end
end
#==============================================================================
# Window_Base
#==============================================================================
class Window_Base
def draw_actor_face(actor, x, y)
if actor != nil
bitmap = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
cw = 80
ch = 80
src_rect = Rect.new(0, 0, cw, ch)
if actor.not_available or actor.must_be_in_party
self.contents.blt(x, y, bitmap, src_rect, 128)
else
self.contents.blt(x, y, bitmap, src_rect)
end
end
end
end
#==============================================================================
# Window_Current
#==============================================================================
class Window_Current < Window_Selectable
def initialize
if $party_max_size > 4
super(0, 0, 240 + 32, 480)
else
super(0, 0, 240 + 32, $party_max_size * 120)
end
@item_max = $party_max_size
self.contents = Bitmap.new(width - 32, 480 - 32 + (@item_max - 4) * 120)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 0
y = i * 120 - 4
actor = $game_party.actors
self.contents.font.color = normal_color
if actor != nil
draw_actor_face(actor, x, y + 8)
draw_actor_name(actor, x + 160, y)
draw_actor_level(actor, x + 96, y)
draw_actor_hp(actor, x + 96, y + 32)
draw_actor_sp(actor, x + 96, y + 64)
end
end
end
def setactor(index_1, index_2)
temp = $game_party.actors[index_1]
$game_party.actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end
def getactor(index)
return $game_actors[$game_party.actors[index].id]
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 = 0
y = (@index / @column_max) * 120 - self.oy
self.cursor_rect.set(x, y, self.width - 32, 88)
end
def clone_cursor
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 = 0
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width, 88)
bitmap = RPG::Cache.windowskin("Cursor_Current")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 116
end
def top_row=(row)
row = row % row_max
self.oy = row * 120
end
def page_row_max
return (self.height / 120)
end
end
#==============================================================================
# Window_Reserve
#==============================================================================
class Window_Reserve < Window_Selectable
def initialize
super(0, 0, 400 - 32, 320)
setup
@column_max = 3
if (@item_max / @column_max) >= 3
self.contents = Bitmap.new(width - 32, @item_max / @column_max * 96)
else
self.contents = Bitmap.new(width - 32, height - 32)
end
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.active = false
self.index = -1
refresh
end
def setup
@actors = []
for i in 0...$data_actors.size
flag = false
for j in 0...$game_party.actors.size
if $game_actors == $game_party.actors[j]
flag = true
end
end
if flag == false
unless $game_actors == nil or $game_actors.disabled_for_party
@actors.push($game_actors)
end
end
end
@item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3
end
def refresh
self.contents.clear
for i in 0... @actors.size
drawing(@actors, i)
end
end
def drawing(actor, i)
x = (i % 3) * 112 + 16
y = (i / 3) * 96 - 8
self.contents.font.color = normal_color
draw_actor_face(actor, x, y + 18)
end
def getactor(index)
return @actors[index]
end
def setactor(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = @actors[index_2]
@actors[index_2] = temp
refresh
end
def setparty(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
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) * 112 + 8
y = (@index / @column_max) * 96 - self.oy
self.cursor_rect.set(x, y, 96, 96)
end
def clone_cursor
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) * 112 + 8
y = (@index / @column_max) * 96
src_rect = Rect.new(0, 0, 96, 96)
bitmap = RPG::Cache.windowskin("Cursor_Reserve")
self.contents.blt(x, y, bitmap, src_rect, 192)
end
def top_row
return self.oy / 96
end
def top_row=(row)
row = row % row_max
self.oy = row * 96
end
def page_row_max
return (self.height - 32) / 96
end
end
#==============================================================================
# Window_HelpStatus
#==============================================================================
class Window_HelpStatus < Window_Base
def initialize(gotactor)
super(0, 0, 400 - 32, 160)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh(gotactor)
self.active = false
end
def refresh(actor)
self.contents.clear
if actor != nil
x = 0
y = 0
self.contents.font.color = normal_color
if actor.not_available
self.contents.draw_text(x + 8, y, 160, 32, "not available", 0)
end
draw_actor_face(actor, x, y + 40)
draw_actor_name(actor, x + 160, y + 32)
draw_actor_level(actor, x + 96, y + 32)
draw_actor_hp(actor, x + 96, y + 64)
draw_actor_sp(actor, x + 96, y + 96)
end
end
end
#==============================================================================
# Window_Warning
#==============================================================================
class Window_Warning < Window_Base
def initialize
super(0, 0, 320, 96)
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.x = 320 - (width / 2)
self.y = 240 - (height / 2)
self.z = 9999
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 288, 32, "You cannot remove", 1)
self.contents.draw_text(0, 32, 288, 32, "the last party member!", 1)
end
end
#==============================================================================
# Scene_PartySwitcher
#==============================================================================
class Scene_PartySwitcher
def initialize(wipe_party = 0, reset = 0, store = 0)
@wipe_party = wipe_party
@store = store
@reset = reset
@current_window_temp = 0
@reserve_window_temp = 0
@canceler = false
@temp_window = ""
end
def main
if @store == 0
if @wipe_party == 1
setup_forced_party
elsif @wipe_party == 2
wipe_party
elsif @wipe_party == 3
store_party
wipe_party
end
@current_window = Window_Current.new
@current_window.index = 0
@current_window.active = true
@reserve_window = Window_Reserve.new
@reserve_window.x = 240 + 32
@reserve_window.y = 160
@warning_window = Window_Warning.new
actor = @reserve_window.getactor(0)
@help_window = Window_HelpStatus.new(actor)
@help_window.x = 240 + 32
if @reset == 1
actor.not_available = false
end
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end
Graphics.freeze
@current_window.dispose
@reserve_window.dispose
@help_window.dispose
else
swap_parties(@store)
$scene = Scene_Map.new
end
sort_party
$game_player.refresh
Graphics.transition
end
def update
check = @reserve_window.index
if @reserve_window.active
reserve_update
@reserve_window.update
end
if check != @reserve_window.index
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
end
if @current_window.active
current_update
@current_window.update
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
if @canceler == false
$scene = Scene_Map.new
elsif @canceler == true
@temp_window = ""
@canceler = false
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
if @temp_window == "Current" or @temp_window == ""
@help_window.refresh(actor)
end
@current_window.refresh
@reserve_window.refresh
end
return
end
if Input.trigger?(Input::A)
sort_party
@current_window.refresh
end
end
def current_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @current_window.index
@temp_window = "Current"
@current_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@current_window.active = false
@reserve_window.active = true
@current_window_temp = @current_window.index
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.index = -1
@reserve_window.index = @reserve_window_temp
if @canceler == false
@help_window.refresh(actor)
end
return
end
end
def reserve_update
if Input.trigger?(Input::C)
if @canceler == false
$game_system.se_play($data_system.decision_se)
@canceler = true
@temp_actor_index = @reserve_window.index
@temp_window = "Reserve"
@reserve_window.clone_cursor
elsif @canceler == true
switch_members
end
return
end
if (@reserve_window.index % 3) == 0
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@reserve_window.active = false
@current_window.active = true
@reserve_window_temp = @reserve_window.index
@reserve_window.index = -1
@current_window.index = @current_window_temp
end
return
end
end
def switch_members
if @temp_window == "Reserve" and @reserve_window.active
@reserve_window.setactor(@temp_actor_index, @reserve_window.index)
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
end
if @temp_window == "Current" and @current_window.active
@current_window.setactor(@temp_actor_index, @current_window.index)
end
if @temp_window == "Reserve" and @current_window.active
actor1 = @current_window.getactor(@current_window.index)
actor2 = @reserve_window.getactor(@temp_actor_index)
if call_warning(@current_window.index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@temp_actor_index, @current_window.index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window_temp)
@help_window.refresh(actor)
else
warning
end
end
if @temp_window == "Current" and @reserve_window.active
actor1 = @current_window.getactor(@temp_actor_index)
actor2 = @reserve_window.getactor(@reserve_window.index)
if call_warning(@temp_actor_index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@canceler = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@reserve_window.index, @temp_actor_index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
else
warning
end
end
$game_system.se_play($data_system.decision_se)
@canceler = false
@temp_window = ""
return
end
def sort_party
actors = []
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor != nil
actors.push($game_actors[actor.id])
end
end
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil
actor.must_be_in_party = false
end
end
end
def wipe_party
for i in 0...$game_party.actors.size
actor = $game_party.actors
if actor != nil
actor.not_available = true
end
end
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil and actor.must_be_in_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
if $game_party.actors.size == 0
for i in 0...$data_actors.size
actor = $game_actors
unless actor == nil or actor.not_available or actor.disabled_for_party
$game_party.add_actor(actor.id)
return
end
end
end
end
def setup_forced_party
actors = []
$game_party.actors = actors
for i in 0...$data_actors.size
actor = $game_actors
if actor != nil and actor.must_be_in_party and
not actor.disabled_for_party and not actor.not_available
$game_party.add_actor(actor.id)
end
end
end
def store_party
$stored_party = $game_party.actors
end
def swap_parties(swap)
temp = $game_party.actors
for i in 0...temp.size
if temp != nil
temp.not_available = true
end
end
for i in 0...$stored_party.size
if $stored_party != nil
$stored_party.not_available = false
end
end
$game_party.actors = $stored_party
if swap == 1
$stored_party = temp
else
$stored_party = nil
end
end
def call_warning(index, actor2)
actor1 = $game_party.actors[index]
if actor1 != nil and actor2 == nil
count = 0
for i in $game_party.actors
if i != nil
count += 1
end
end
if count <= 1
return false
end
end
return true
end
def warning
$game_system.se_play($data_system.buzzer_se)
@warning_window.visible = true
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
@warning_window.visible = false
@current_window.refresh
@reserve_window.refresh
break
end
end
return
end
end
I found this script in the Submitted Scripts board a couple pages back and decided to test it out. Right when I start the game I get this weird error, I'll post it later if needed. Basically the error was saying it couldn't find the Graphics/Characters/Facesets or something like that. If you know what's wrong here let me know, if you want me to tell you exactly what the script says tell me.
Script 2
#==============================================================================
# 本脚本æ¥è‡ªwww.66RPG.com,使用和转载请ä¿ç•™æ¤ä¿¡æ¯
#==============================================================================
# ■エãƒãƒŸãƒ¼HP&SP(ver 0.98)
# â–¡ カスタマイズãƒã‚¤ãƒ³ãƒˆ
#==============================================================================
module PLAN_HPSP_DRAW
FONT_NAME = ["Arial"] # フォント
FONT_SIZE = 18 # フォントサイズ
FONT_BOLD = true # 太å—
FONT_ITALIC = true # 斜体
DRAW_NAME = true # åå‰ã®æç”»
DRAW_HP = true # HP ã®æç”»
DRAW_SP = true # SP ã®æç”»
DRAW_WIDTH = 80 # æ画幅
DRAW_HEIGHT = 3 * 32 # æ画高ã•
DRAW_SPACE = 0 # 行間
DRAW_Y = 24 # Y 座標修æ£å€¤
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize(viewport, battler = nil)
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_initialize(viewport, battler)
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
x = @battler.screen_x - width / 2
y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
@enemy_hpsp_window = Window_Base.new(x, y, width, height)
@enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
@enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
@enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
@enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
@enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
y = 0
@old_enemy_hpsp = []
one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
if PLAN_HPSP_DRAW::DRAW_NAME
@enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
@old_enemy_hpsp.push(@battler.name)
end
if PLAN_HPSP_DRAW::DRAW_HP
@enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
@old_enemy_hpsp.push(@battler.hp)
end
if PLAN_HPSP_DRAW::DRAW_SP
@enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
@old_enemy_hpsp.push(@battler.sp)
end
@enemy_hpsp_window.opacity = 0
@enemy_hpsp_window.contents_opacity = 0
@enemy_hpsp_window.z = -2
end
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_dispose dispose
def dispose
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.dispose
end
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update update
def update
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.visible = @battler_visible
# スプライトã®åº§æ¨™ã‚’è¨å®š
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
@enemy_hpsp_window.x = self.x - width / 2
@now_enemy_hpsp = []
if PLAN_HPSP_DRAW::DRAW_NAME
@now_enemy_hpsp.push(@battler.name)
end
if PLAN_HPSP_DRAW::DRAW_HP
@now_enemy_hpsp.push(@battler.hp)
end
if PLAN_HPSP_DRAW::DRAW_SP
@now_enemy_hpsp.push(@battler.sp)
end
if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
@old_enemy_hpsp = @now_enemy_hpsp
@enemy_hpsp_window.contents.clear
y = 0
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
if PLAN_HPSP_DRAW::DRAW_NAME
@enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
end
if PLAN_HPSP_DRAW::DRAW_HP
@enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
end
if PLAN_HPSP_DRAW::DRAW_SP
@enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
end
Graphics.frame_reset
end
end
end
#--------------------------------------------------------------------------
# â— visible ã®è¨å®š
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_visible=)
alias plan_enemy_hpsp_draw_visible= visible=
end
def visible=(bool)
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.visible = bool
end
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
self.plan_enemy_hpsp_draw_visible=(bool)
end
#--------------------------------------------------------------------------
# â— ä¸é€æ˜Žåº¦ã®è¨å®š
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_opacity=")
alias plan_enemy_hpsp_draw_opacity= opacity=
end
def opacity=
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
self.plan_enemy_hpsp_draw_opacity=
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.contents_opacity = n
end
end
#--------------------------------------------------------------------------
# ◠ダメージ
#--------------------------------------------------------------------------
def damage(value, critical)
super(value, critical)
bitmap = @_damage_sprite.bitmap
@_damage_sprite.dispose
@_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y - self.oy / 2
@_damage_sprite.viewport.z = self.viewport.z + 1
@_damage_sprite.z = 3000
@_damage_duration = 40
end
#--------------------------------------------------------------------------
# ◠ダメージ解放
#--------------------------------------------------------------------------
def dispose_damage
if @_damage_sprite != nil
@_damage_sprite.viewport.dispose
end
super
end
end
#==============================================================================
# â– Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :enemy_hpsp_refresh
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_initialize
@enemy_hpsp_refresh = false
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠プレãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹ (エãƒãƒŸãƒ¼å+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase1 start_phase1
def start_phase1
$game_temp.enemy_hpsp_refresh = true
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_start_phase1
end
#--------------------------------------------------------------------------
# ◠パーティコマンドフェーズ開始 (エãƒãƒŸãƒ¼å+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase2 start_phase2
def start_phase2
$game_temp.enemy_hpsp_refresh = false
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_start_phase2
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update_phase4_step5
$game_temp.enemy_hpsp_refresh = true
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step6 update_phase4_step6
def update_phase4_step6
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update_phase4_step6
$game_temp.enemy_hpsp_refresh = false
end
end
#==============================================================================
# â– Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# â— åå‰ã®æç”»
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y, width = 220, align = 0)
if $scene.is_a?(Scene_Battle)
flag = actor.name.sub!(/\*f/, '').nil? ? false : true
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x+1, y, width, 32, actor.name, align)
self.contents.draw_text(x, y+1, width, 32, actor.name, align)
end
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, 32, actor.name, align)
end
alias draw_actor_hp_original draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# Draw Shadow Effects for Battles
if $scene.is_a?(Scene_Battle)
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x, y+1, 32, 32, $data_system.words.hp)
self.contents.draw_text(x+1, y, 32, 32, $data_system.words.hp)
self.contents.draw_text(hp_x, y+1, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x+1, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.draw_text(hp_x + 49, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48, y+1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y+1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 61, y, 48, 32, actor.maxhp.to_s)
end
end
# Draw "HP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Draw HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
alias draw_actor_sp_original draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# Draw Shadow Effects for Battles
if $scene.is_a?(Scene_Battle)
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x, y+1, 32, 32, $data_system.words.sp)
self.contents.draw_text(x+1, y, 32, 32, $data_system.words.sp)
self.contents.draw_text(sp_x, y+1, 48, 32, actor.sp.to_s, 2)
self.contents.draw_text(sp_x+1, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.draw_text(hp_x + 49, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48, y+1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y+1, 48, 32, actor.maxsp.to_s)
self.contents.draw_text(hp_x + 61, y, 48, 32, actor.maxsp.to_s)
end
end
# Draw "SP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Draw SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# ◠ステートã®æç”»
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
text = make_battler_state_text(actor, width, true)
self.contents.draw_text(x, y, width, 32, text, 1)
end
end
# 本脚本æ¥è‡ªwww.66RPG.com,使用和转载请ä¿ç•™æ¤ä¿¡æ¯
#==============================================================================
# ■エãƒãƒŸãƒ¼HP&SP(ver 0.98)
# â–¡ カスタマイズãƒã‚¤ãƒ³ãƒˆ
#==============================================================================
module PLAN_HPSP_DRAW
FONT_NAME = ["Arial"] # フォント
FONT_SIZE = 18 # フォントサイズ
FONT_BOLD = true # 太å—
FONT_ITALIC = true # 斜体
DRAW_NAME = true # åå‰ã®æç”»
DRAW_HP = true # HP ã®æç”»
DRAW_SP = true # SP ã®æç”»
DRAW_WIDTH = 80 # æ画幅
DRAW_HEIGHT = 3 * 32 # æ画高ã•
DRAW_SPACE = 0 # 行間
DRAW_Y = 24 # Y 座標修æ£å€¤
end
#==============================================================================
# â– Sprite_Battler
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize(viewport, battler = nil)
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_initialize(viewport, battler)
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
height = PLAN_HPSP_DRAW::DRAW_HEIGHT + 32
x = @battler.screen_x - width / 2
y = @battler.screen_y - height + 32 + PLAN_HPSP_DRAW::DRAW_Y
@enemy_hpsp_window = Window_Base.new(x, y, width, height)
@enemy_hpsp_window.contents = Bitmap.new(width - 32, height - 32)
@enemy_hpsp_window.contents.font.name = PLAN_HPSP_DRAW::FONT_NAME
@enemy_hpsp_window.contents.font.size = PLAN_HPSP_DRAW::FONT_SIZE
@enemy_hpsp_window.contents.font.bold = PLAN_HPSP_DRAW::FONT_BOLD
@enemy_hpsp_window.contents.font.italic = PLAN_HPSP_DRAW::FONT_ITALIC
y = 0
@old_enemy_hpsp = []
one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
if PLAN_HPSP_DRAW::DRAW_NAME
@enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
@old_enemy_hpsp.push(@battler.name)
end
if PLAN_HPSP_DRAW::DRAW_HP
@enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
@old_enemy_hpsp.push(@battler.hp)
end
if PLAN_HPSP_DRAW::DRAW_SP
@enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
@old_enemy_hpsp.push(@battler.sp)
end
@enemy_hpsp_window.opacity = 0
@enemy_hpsp_window.contents_opacity = 0
@enemy_hpsp_window.z = -2
end
end
#--------------------------------------------------------------------------
# ◠解放
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_dispose dispose
def dispose
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.dispose
end
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update update
def update
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.visible = @battler_visible
# スプライトã®åº§æ¨™ã‚’è¨å®š
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
@enemy_hpsp_window.x = self.x - width / 2
@now_enemy_hpsp = []
if PLAN_HPSP_DRAW::DRAW_NAME
@now_enemy_hpsp.push(@battler.name)
end
if PLAN_HPSP_DRAW::DRAW_HP
@now_enemy_hpsp.push(@battler.hp)
end
if PLAN_HPSP_DRAW::DRAW_SP
@now_enemy_hpsp.push(@battler.sp)
end
if @old_enemy_hpsp != @now_enemy_hpsp and $game_temp.enemy_hpsp_refresh
@old_enemy_hpsp = @now_enemy_hpsp
@enemy_hpsp_window.contents.clear
y = 0
width = PLAN_HPSP_DRAW::DRAW_WIDTH + 32
one_line = ((PLAN_HPSP_DRAW::FONT_SIZE * 100 / 28) * 32) / 100
if PLAN_HPSP_DRAW::DRAW_NAME
@enemy_hpsp_window.draw_actor_name(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
end
if PLAN_HPSP_DRAW::DRAW_HP
@enemy_hpsp_window.draw_actor_hp(@battler, 0, y, width - 32)
y += one_line + PLAN_HPSP_DRAW::DRAW_SPACE
end
if PLAN_HPSP_DRAW::DRAW_SP
@enemy_hpsp_window.draw_actor_sp(@battler, 0, y, width - 32)
end
Graphics.frame_reset
end
end
end
#--------------------------------------------------------------------------
# â— visible ã®è¨å®š
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_visible=)
alias plan_enemy_hpsp_draw_visible= visible=
end
def visible=(bool)
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.visible = bool
end
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
self.plan_enemy_hpsp_draw_visible=(bool)
end
#--------------------------------------------------------------------------
# â— ä¸é€æ˜Žåº¦ã®è¨å®š
#--------------------------------------------------------------------------
if !method_defined?("plan_enemy_hpsp_draw_opacity=")
alias plan_enemy_hpsp_draw_opacity= opacity=
end
def opacity=
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
self.plan_enemy_hpsp_draw_opacity=
# エãƒãƒŸãƒ¼ã®å ´åˆ
if @battler.is_a?(Game_Enemy)
@enemy_hpsp_window.contents_opacity = n
end
end
#--------------------------------------------------------------------------
# ◠ダメージ
#--------------------------------------------------------------------------
def damage(value, critical)
super(value, critical)
bitmap = @_damage_sprite.bitmap
@_damage_sprite.dispose
@_damage_sprite = ::Sprite.new(Viewport.new(0, 0, 640, 480))
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80
@_damage_sprite.oy = 20
@_damage_sprite.x = self.x
@_damage_sprite.y = self.y - self.oy / 2
@_damage_sprite.viewport.z = self.viewport.z + 1
@_damage_sprite.z = 3000
@_damage_duration = 40
end
#--------------------------------------------------------------------------
# ◠ダメージ解放
#--------------------------------------------------------------------------
def dispose_damage
if @_damage_sprite != nil
@_damage_sprite.viewport.dispose
end
super
end
end
#==============================================================================
# â– Game_Temp
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# ◠公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :enemy_hpsp_refresh
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_initialize initialize
def initialize
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_initialize
@enemy_hpsp_refresh = false
end
end
#==============================================================================
# â– Scene_Battle
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ◠プレãƒãƒˆãƒ«ãƒ•ã‚§ãƒ¼ã‚ºé–‹å§‹ (エãƒãƒŸãƒ¼å+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase1 start_phase1
def start_phase1
$game_temp.enemy_hpsp_refresh = true
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_start_phase1
end
#--------------------------------------------------------------------------
# ◠パーティコマンドフェーズ開始 (エãƒãƒŸãƒ¼å+アルファベット用)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_start_phase2 start_phase2
def start_phase2
$game_temp.enemy_hpsp_refresh = false
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_start_phase2
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 5 : ダメージ表示)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step5 update_phase4_step5
def update_phase4_step5
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update_phase4_step5
$game_temp.enemy_hpsp_refresh = true
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (メインフェーズ ステップ 6 : リフレッシュ)
#--------------------------------------------------------------------------
alias plan_enemy_hpsp_draw_update_phase4_step6 update_phase4_step6
def update_phase4_step6
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
plan_enemy_hpsp_draw_update_phase4_step6
$game_temp.enemy_hpsp_refresh = false
end
end
#==============================================================================
# â– Window_Base
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# â— åå‰ã®æç”»
#--------------------------------------------------------------------------
def draw_actor_name(actor, x, y, width = 220, align = 0)
if $scene.is_a?(Scene_Battle)
flag = actor.name.sub!(/\*f/, '').nil? ? false : true
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x+1, y, width, 32, actor.name, align)
self.contents.draw_text(x, y+1, width, 32, actor.name, align)
end
self.contents.font.color = normal_color
self.contents.draw_text(x, y, width, 32, actor.name, align)
end
alias draw_actor_hp_original draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
hp_x = x + width - 108
flag = true
elsif width - 32 >= 48
hp_x = x + width - 48
flag = false
end
# Draw Shadow Effects for Battles
if $scene.is_a?(Scene_Battle)
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x, y+1, 32, 32, $data_system.words.hp)
self.contents.draw_text(x+1, y, 32, 32, $data_system.words.hp)
self.contents.draw_text(hp_x, y+1, 48, 32, actor.hp.to_s, 2)
self.contents.draw_text(hp_x+1, y, 48, 32, actor.hp.to_s, 2)
if flag
self.contents.draw_text(hp_x + 49, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48, y+1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y+1, 48, 32, actor.maxhp.to_s)
self.contents.draw_text(hp_x + 61, y, 48, 32, actor.maxhp.to_s)
end
end
# Draw "HP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.hp)
# Draw HP
self.contents.font.color = actor.hp == 0 ? knockout_color :
actor.hp <= actor.maxhp / 4 ? crisis_color : normal_color
self.contents.draw_text(hp_x, y, 48, 32, actor.hp.to_s, 2)
# Draw MaxHP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(hp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y, 48, 32, actor.maxhp.to_s)
end
end
alias draw_actor_sp_original draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# Calculate if there is draw space for MaxHP
if width - 32 >= 108
sp_x = x + width - 108
flag = true
elsif width - 32 >= 48
sp_x = x + width - 48
flag = false
end
# Draw Shadow Effects for Battles
if $scene.is_a?(Scene_Battle)
self.contents.font.color = Color.new(0, 0, 0, 192)
self.contents.draw_text(x, y+1, 32, 32, $data_system.words.sp)
self.contents.draw_text(x+1, y, 32, 32, $data_system.words.sp)
self.contents.draw_text(sp_x, y+1, 48, 32, actor.sp.to_s, 2)
self.contents.draw_text(sp_x+1, y, 48, 32, actor.sp.to_s, 2)
if flag
self.contents.draw_text(hp_x + 49, y, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 48, y+1, 12, 32, "/", 1)
self.contents.draw_text(hp_x + 60, y+1, 48, 32, actor.maxsp.to_s)
self.contents.draw_text(hp_x + 61, y, 48, 32, actor.maxsp.to_s)
end
end
# Draw "SP" text string
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, 32, $data_system.words.sp)
# Draw SP
self.contents.font.color = actor.sp == 0 ? knockout_color :
actor.sp <= actor.maxsp / 4 ? crisis_color : normal_color
self.contents.draw_text(sp_x, y, 48, 32, actor.sp.to_s, 2)
# Draw MaxSP
if flag
self.contents.font.color = normal_color
self.contents.draw_text(sp_x + 48, y, 12, 32, "/", 1)
self.contents.draw_text(sp_x + 60, y, 48, 32, actor.maxsp.to_s)
end
end
#--------------------------------------------------------------------------
# ◠ステートã®æç”»
#--------------------------------------------------------------------------
def draw_actor_state(actor, x, y, width = 120)
# å…ƒã®ãƒ¡ã‚½ãƒƒãƒ‰ã«æˆ»ã™
text = make_battler_state_text(actor, width, true)
self.contents.draw_text(x, y, width, 32, text, 1)
end
end
Script 3 and 4
These two scripts basically works together, I don't know how it all works and stuff but...
Å Jâ€Â