Project1
标题:
请问这个队员改变脚本如何使用
[打印本页]
作者:
反斗奇彬
时间:
2010-10-20 17:25
标题:
请问这个队员改变脚本如何使用
#==============================================================================
# ** 队员改变系统
#------------------------------------------------------------------------------
# 编写:Dargor©
# 时间:2008.08.03
# 汉化:DeathKing
# 时间:2009.06.17
# 更新:DeathKing
# 时间:2009.06.17
# 版本:1.1
#------------------------------------------------------------------------------
# 更新历史:
# - 1.0 (2008.08.03), 发布初始版本
# - 1.1 (2009.06.17), DeathKing更新版本,修正了与国内RMVX脚本
# 不兼容问题。(找不到Game_Party的max_members方法)
#------------------------------------------------------------------------------
# 备注:
# 一些无关紧要的就不翻译了!
#==============================================================================
# 词汇定义
Vocab::PartyAccept = '确认' # 确认排序
Vocab::PartyArrange = '调整' # 调整顺序
Vocab::PartyReset = '重置' # 重新设定
Vocab::PartyAcceptTxt = '确认排列' # 用于下方的详细说明
Vocab::PartyArrangeTxt = '调整顺序' # 同上
Vocab::PartyResetTxt = '重置队列' # 同上
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# 所有窗口的超级类。
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Remake Window Contents
#--------------------------------------------------------------------------
def remake_contents(width, height)
self.width = width
self.height = height
create_contents
end
#--------------------------------------------------------------------------
# * Draw Actor Walking Graphic
# actor : actor
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_actor_graphic(actor, x, y, opacity = 255)
draw_character(actor.character_name, actor.character_index, x, y, opacity)
end
#--------------------------------------------------------------------------
# * Draw Character Graphic
# character_name : Character graphic filename
# character_index : Character graphic index
# x : draw spot x-coordinate
# y : draw spot y-coordinate
#--------------------------------------------------------------------------
def draw_character(character_name, character_index, x, y, opacity = 255)
return if character_name == nil
bitmap = Cache.character(character_name)
sign = character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, opacity)
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. The instance of this class is referenced by $game_party.
#==============================================================================
class Game_Party < Game_Unit
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :actors
attr_accessor :reserve_actors
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias dargor_party_changer_party_initialize initialize
alias dargor_party_add_actor add_actor
alias dargor_party_remove_actor remove_actor
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
dargor_party_changer_party_initialize
@reserve_actors = []
end
#--------------------------------------------------------------------------
# * Get Reserve Members
#--------------------------------------------------------------------------
def reserve_members
result = []
for i in @reserve_actors
result.push($game_actors)
end
return result
end
#--------------------------------------------------------------------------
# * Get All Members
#--------------------------------------------------------------------------
def all_members
all_actors = (@actors + @reserve_actors).sort
array = []
for i in all_actors
array << $game_actors
end
return array.uniq
end
#--------------------------------------------------------------------------
# * Add an Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
dargor_party_add_actor(actor_id)
add_reserve_actor(actor_id)
end
#--------------------------------------------------------------------------
# * Remove Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def remove_actor(actor_id)
dargor_party_remove_actor(actor_id)
remove_reserve_actor(actor_id)
end
#--------------------------------------------------------------------------
# * Add an Actor from the Reserve
# actor_id : actor ID
#--------------------------------------------------------------------------
def add_reserve_actor(actor_id, force=false)
if force
@reserve_actors.push(actor_id)
$game_player.refresh
return
end
if @actors.size == MAX_MEMBERS and not @reserve_actors.include?(actor_id)
@reserve_actors.push(actor_id)
$game_player.refresh
end
end
#--------------------------------------------------------------------------
# * Remove Actor from the Reserve
# actor_id : actor ID
#--------------------------------------------------------------------------
def remove_reserve_actor(actor_id)
@reserve_actors.delete(actor_id)
$game_player.refresh
end
#--------------------------------------------------------------------------
# ● 获取最大同伴数
#--------------------------------------------------------------------------
def max_members
return MAX_MEMBERS
end
end
#==============================================================================
# ** Window_Party
#------------------------------------------------------------------------------
# This window displays party member status on the party changer screen.
#==============================================================================
class Window_PartyMembers < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :members
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize
super(0, 0, 272, 416)
@members = []
@selection_rect = false
@selection_y = 0
refresh
self.active = false
self.index = -1
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@item_max = @members.size
if @selection_rect
color = Color.new(0,0,0,160)
self.contents.fill_rect(2, @selection_y, contents.width-4, 92, color)
end
i = 0
for actor in @members
x = 104
y = i * 96 + WLH / 2 + 10
draw_actor_face(actor, 2, i * 96 + 2, 92)
draw_actor_name(actor, x, y - WLH)
draw_actor_level(actor, x, y)
draw_actor_hp(actor, x, y + WLH * 1)
draw_actor_mp(actor, x, y + WLH * 2)
i += 1
end
end
#--------------------------------------------------------------------------
# * Add Member
#--------------------------------------------------------------------------
def add_member(id)
return if @members.include?($game_party.all_members[id])
@members.push($game_party.all_members[id])
w = self.width
h = self.height = 416 + (96 * (@members.size-4))
remake_contents(w, h)
self.height = 416
refresh
end
#--------------------------------------------------------------------------
# * Remove Member
#--------------------------------------------------------------------------
def remove_member(id)
@members.delete($game_party.all_members[id])
w = self.width
h = self.height = 416 + (96 * (@members.size-4))
remake_contents(w, h)
self.height = 416
refresh
end
#--------------------------------------------------------------------------
# * Clear Members
#--------------------------------------------------------------------------
def clear_members
@members = []
w = self.width
h = self.height = 416 + (96 * (@members.size-4))
remake_contents(w, h)
self.height = 416
refresh
end
#--------------------------------------------------------------------------
# * Set Selection Rect
#--------------------------------------------------------------------------
def set_selection_rect(index)
@selection_rect = true
@selection_y = index * 96 - WLH / 2 + 14
refresh
end
#--------------------------------------------------------------------------
# * Clear Selection Rect
#--------------------------------------------------------------------------
def clear_selection_rect
@selection_rect = false
refresh
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
if @index < 0
self.cursor_rect.empty
return
end
# Get top row
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
# Reset Top Row if at bottom of list
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
y = @index / @column_max * 96 - self.oy
# Draw the cursor
self.cursor_rect.set(0, y, contents.width, 96)
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
return self.oy / 96
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 96
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
return 4
end
end
#==============================================================================
# ** Window_ReserveMembers
#------------------------------------------------------------------------------
# This window displays reserve members on the party changer screen.
#==============================================================================
class Window_ReserveMembers < Window_Selectable
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :members
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize
@members = $game_party.all_members.dup
height = 58 * (@members.size.to_f / 4).ceil
super(272, 128, 272, height)
@item_max = @members.size
@column_max = 4
@row_max = (@members.size.to_f / 4).ceil
refresh
self.height = 128
self.index = 0
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
i = 0
for actor in @members
opacity = 255
if actor.nil?
actor = $game_party.all_members
opacity = 160
end
x = 24 + i % 4 * 60
y = 40 + i / 4 * 48
draw_actor_graphic(actor,x,y,opacity)
i += 1
end
end
#--------------------------------------------------------------------------
# * Set Member
#--------------------------------------------------------------------------
def set_member(index, member_id)
@members[index] = member_id
refresh
end
#--------------------------------------------------------------------------
# * Reset Members
#--------------------------------------------------------------------------
def reset_members
@members = $game_party.all_members.dup
refresh
end
#--------------------------------------------------------------------------
# * Update cursor
#--------------------------------------------------------------------------
def update_cursor
x = @index % 4 * 60
y = @index / 4 * 48
y -= self.oy
if @index < 0 # No cursor
self.cursor_rect.empty
elsif @index < @item_max # Normal
self.cursor_rect.set(x, y, 48, 48)
end
# Get top row
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
# Reset Top Row if at bottom of list
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
return self.oy / 48
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 48
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
return 2
end
end
#==============================================================================
# ** Window_MemberStatus
#------------------------------------------------------------------------------
# This window displays a member's status on the party changer screen.
#==============================================================================
class Window_MemberStatus < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize
super(272, 0, 272, 128)
@member = nil
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
return if @member.nil?
actor = @member
x = 104
draw_actor_face(actor, 2, 2, 92)
draw_actor_name(actor, x, 0)
draw_actor_level(actor, x, WLH)
draw_actor_hp(actor, x, WLH * 2)
draw_actor_mp(actor, x, WLH * 3)
end
#--------------------------------------------------------------------------
# * Set Member
#--------------------------------------------------------------------------
def set_member(member)
@member = $game_actors[member]
refresh
end
end
#==============================================================================
# ** Scene_PartyChanger
#------------------------------------------------------------------------------
# This class performs the Party Changer screen processing.
#==============================================================================
class Scene_PartyChanger < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
create_menu_background
create_command_window
create_help_window
@party_window = Window_PartyMembers.new
@reserve_window = Window_ReserveMembers.new
@status_window = Window_MemberStatus.new
@status_window.set_member(@reserve_window.index)
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_menu_background
@party_window.dispose
@reserve_window.dispose
@command_window.dispose
@status_window.dispose
@help_window.dispose
end
#--------------------------------------------------------------------------
# * Create Help Window
#--------------------------------------------------------------------------
def create_help_window
@help_window = Window_Help.new
@help_window.x = 272
@help_window.y = 416 - 56
@help_window.width = 272
@help_window.create_contents
@help_window.set_text('从你的同伴')
end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------
def create_command_window
s1 = Vocab::PartyAccept
s2 = Vocab::PartyArrange
s3 = Vocab::PartyReset
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.index = 0
@command_window.x = 272
@command_window.y = 256
@command_window.width = 272
@command_window.active = false
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@old_index = @reserve_window.index
super
update_menu_background
update_help
@command_window.update
@party_window.update
@reserve_window.update
@status_window.update
@help_window.update
if can_display_status?
@status_window.set_member(@reserve_window.index+1)
end
if @command_window.active
update_command_selection
return
end
if @party_window.active
update_party_selection
return
end
if @reserve_window.active
update_reserve_selection
return
end
end
#--------------------------------------------------------------------------
# * Can Display Status?
#--------------------------------------------------------------------------
def can_display_status?
return @reserve_window.index != @old_index
end
#--------------------------------------------------------------------------
# * Frame Update : Help Window
#--------------------------------------------------------------------------
def update_help
if @party_window.active
@help_window.set_text('调整队列')
end
if @reserve_window.active
@help_window.set_text('从你的同伴')
end
if @command_window.active
case @command_window.index
when 0
@help_window.set_text(Vocab::PartyAcceptTxt)
when 1
@help_window.set_text(Vocab::PartyArrangeTxt )
when 2
@help_window.set_text(Vocab::PartyResetTxt)
end
end
end
#--------------------------------------------------------------------------
# * Frame Update : Party Window
#--------------------------------------------------------------------------
def update_party_selection
# 跳转至命令窗口
if Input.trigger?(Input::B)
@party_window.active = false
@party_window.index = -1
@command_window.active = true
@party_window.clear_selection_rect
@member1 = nil
@member2 = nil
return
end
# 调整队列
if Input.trigger?(Input::C)
# 创建第一同伴变量
if @member1.nil?
@member1 = @party_window.members[@party_window.index]
@member1_index = @party_window.index
@party_window.set_selection_rect(@member1_index)
return
end
# 创建第二同伴变量
if @member2.nil?
@member2 = @party_window.members[@party_window.index]
@member2_index = @party_window.index
# 如果不是同一人就交换他们的位置
if @member1 != @member2
@party_window.members[@member1_index] = @member2
@party_window.members[@member2_index] = @member1
end
@party_window.clear_selection_rect
@member1 = nil
@member2 = nil
end
end
end
#--------------------------------------------------------------------------
# * Frame Update : Reserve Window
#--------------------------------------------------------------------------
def update_reserve_selection
# 如果同伴少于一人则调回选择角色的窗口。
if Input.trigger?(Input::B) and @party_window.members.size > 0
@reserve_window.active = false
@command_window.active = true
return
end
# 将角色加入同伴
if Input.trigger?(Input::C)
@party_window.add_member(@reserve_window.index)
@reserve_window.set_member(@reserve_window.index, nil)
end
# 如果同伴已满就跳转至另一窗口
if @party_window.members.size == $game_party.max_members
@command_window.active = true
@reserve_window.active = false
return
end
end
#--------------------------------------------------------------------------
# * Frame Update : Command Window
#--------------------------------------------------------------------------
def update_command_selection
if Input.trigger?(Input::C)
case @command_window.index
# 重置队列
when 0
$game_party.actors.clear
for member in @party_window.members + @reserve_window.members
if @party_window.members.include?(member)
$game_party.add_actor(member.id)
end
$game_party.add_reserve_actor(member.id, true)
end
$game_player.refresh
$scene = Scene_Map.new
# 调整队列
when 1
@party_window.index = 0
@party_window.active = true
@command_window.active = false
# 重置队列
when 2
@party_window.clear_members
@party_window.clear_selection_rect
@reserve_window.reset_members
@reserve_window.active
@reserve_window.active = true
@command_window.active = false
end
end
end
end
复制代码
我问的是在游戏中如何把它调出来,用什么命令啊,拜托各位大哥大姐告诉我一下
作者:
巧克力猫咪
时间:
2010-10-20 17:32
本帖最后由 巧克力猫咪 于 2010-10-20 17:34 编辑
回复
反斗奇彬
的帖子
插入脚本$scene = Scene_PartyChanger.new,不过这个的话有点BUG
# 1.系统呼出命令: $scene = Scene_Party.new
# 2.队员锁定命令: $game_party.members[0].actor.required = true
# (其中数字0表示1号队员在队伍中锁定而无法进入仓库,1即为2号队员,以此类推)
# 3.队员加入仓库命令: $data_actors[5].found = true
# (其中数字5表示5号队员直接进入仓库等待招募而不加入队伍,当队伍满员时使用此命令)
# 4.队员踢除仓库命令: $data_actors[5].found = false
# (其中数字5表示将呆在仓库里的5号队员清除,该命令用于离开的队员)
# 5.队员加入仓库但无法被招募:$data_actors[8].found = true
# $data_actors[8].unavailable = true
# (其中数字8表示8号队员# 直接进入仓库但无法被招募,该命令用于俘虏类)
# 6.仓库里无法招募的队员启动命令: $data_actors.each do |a|
# a.unavailable = false if a
# end
# (该命令作为第5项命令的补充,使所有仓库里无法被招募的队员重启为可招募状态)
# 7.全体队员进入仓库: $data_actors.each do |a|
# a.found = true if a
# nd
# (该命令使所有队员进入仓库等待招募,在队伍 中的队员不受影响)
# 队员管理脚本(v1.1c)
module RPG
class Actor
def setup
@found = false
@unavailable = false
@required = false
end
attr_accessor :found
attr_accessor :unavailable
attr_accessor :required
end
end
class Game_Actors
attr_reader :data
alias prex_party_g_actors_initialize initialize
def initialize
prex_party_g_actors_initialize
$data_actors.each do |actor|
actor.setup if actor
@data[actor.id] = Game_Actor.new(actor.id) if actor
end
end
end
class Scene_File < Scene_Base
alias prex_party_s_file_write_save_data write_save_data
alias prex_party_s_file_read_save_data read_save_data
def write_save_data(file)
prex_party_s_file_write_save_data(file)
Marshal.dump($data_actors, file)
end
def read_save_data(file)
prex_party_s_file_read_save_data(file)
$data_actors = Marshal.load(file)
end
end
class Scene_Title < Scene_Base
alias prex_party_s_title_command_new_game command_new_game
def command_new_game
prex_party_s_title_command_new_game
$game_party.members.each {|s| s.actor.found = true if s}
end
end
class Window_Base < Window
def draw_item_name(item, x, y, enabled = true, width = 172)
if item != nil
draw_icon(item.icon_index, x, y, enabled)
self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 24, y, width, WLH, item.name)
end
end
end
class Scene_Party < Scene_Base
def start
super
create_menu_background
create_windows
end
def create_windows
@member_window = Window_CurrentMember.new
@party_window = Window_CurrentParty.new
@party_window.active = true
@selectable_window = Window_SelectMember.new
end
def update_windows
@member_window.update
@party_window.update
@selectable_window.update
if @party_window.active
@member_window.set_member(@party_window.member)
elsif @selectable_window.active
@member_window.set_member(@selectable_window.member)
end
end
def terminate
super
@member_window.dispose
@party_window.dispose
@selectable_window.dispose
end
def update
super
update_windows
update_input
end
def update_input
if Input.trigger?(Input::A)
if @member_window.mode == 1
@member_window.set_mode(0)
elsif @member_window.mode == 0
@member_window.set_mode(1)
end
end
if @party_window.active
if Input.trigger?(Input::B)
Sound.play_cancel
$scene = Scene_Map.new
elsif Input.trigger?(Input::C)
member = @party_window.member
if member != nil
if member.actor.unavailable or member.actor.required
Sound.play_buzzer
return
end
end
Sound.play_decision
@party_window.active = false
@selectable_window.active = true
@selectable_window.index = 0
end
elsif @selectable_window.active
if Input.trigger?(Input::B)
Sound.play_cancel
@selectable_window.index = -1
@selectable_window.active = false
@party_window.active = true
elsif Input.trigger?(Input::C)
member = @selectable_window.member
if member != nil
if member.actor.unavailable
Sound.play_buzzer
return
end
end
Sound.play_decision
$game_party.remove_actor(@party_window.member.id) if @party_window.member != nil
$game_party.add_actor(@selectable_window.member.id) if @selectable_window.member != nil
@selectable_window.refresh
@party_window.refresh
@selectable_window.index = -1
@selectable_window.active = false
@party_window.active = true
end
end
end
end
class Window_CurrentMember < Window_Base
attr_reader :mode
def initialize(member = nil, mode = 0)
super(304, 80, 192, 256)
create_contents
@member = member
@mode = 0
refresh
end
def member
return @member
end
def set_member(member)
old_member = @member
@member = member
refresh if old_member != @member
end
def set_mode(mode)
@mode = mode if [0, 1].include?(mode)
refresh
end
def refresh
self.contents.clear
return unless @member
x, y = 0, 0
self.draw_actor_name(@member, x + 100, y)
self.draw_actor_class(@member, x + 100, y + WLH)
self.draw_actor_level(@member, x + 103, y + WLH*2)
case @mode
when 0
self.draw_actor_face(@member, x, y, 96) #****
self.draw_actor_hp(@member, x, y + WLH*3, 160)
self.draw_actor_mp(@member, x, y + WLH*4, 160)
self.draw_actor_parameter(@member, x, y + WLH*5, 0)
self.draw_actor_parameter(@member, x, y + WLH*6, 1)
self.draw_actor_parameter(@member, x, y + WLH*7, 2)
self.draw_actor_parameter(@member, x, y + WLH*8, 3)
when 1
self.draw_actor_face(@member, x, y, 96) #****
for i in
[email protected]
item = @member.equips
self.draw_item_name(item, x, y + WLH*(3+i), true, self.contents.width - 24)
end
end
end
end
class Window_CurrentParty < Window_Selectable
def initialize
super(48, 80, 256, 64)
@item_max = 4
@column_max = @item_max
create_contents
self.index = 0
refresh
end
def member
return $game_party.members[self.index]
end
def refresh
for i in 0...@item_max
rect = item_rect(i)
self.contents.clear_rect(rect)
end
for i in 0...$game_party.members.size
rect = item_rect(i)
bitmap = Cache.character($game_party.members
.character_name)
sign = $game_party.members
.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = $game_party.members
.character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
if $game_party.members
.actor.unavailable
self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
else
self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
end
if $game_party.members
.actor.required
lock_bitmap = Cache.system("Locked")
self.contents.blt(rect.x + rect.width - lock_bitmap.width,
rect.y + rect.height - lock_bitmap.height,
lock_bitmap, lock_bitmap.rect)
end
end
end
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = 32
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * 32
return rect
end
end
class Window_SelectMember < Window_Selectable
def initialize
super(48, 144, 256, 192)
calculate_actors
@item_max = @actors.size + 1
@column_max = 4
self.index = -1
self.active = false
refresh
end
def calculate_actors
@actors = []
for a in $game_actors.data
@actors << a if a != nil and a.actor.found and !$game_party.members.include?(a)
end
end
def member
return @actors[self.index]
end
def refresh
self.contents.clear
calculate_actors
@item_max = @actors.size + 1
for i in
[email protected]
rect = item_rect(i)
bitmap = Cache.character(@actors
.character_name)
sign = @actors
.character_name[/^[\!\$]./]
if sign != nil and sign.include?('$')
cw = bitmap.width / 3
ch = bitmap.height / 4
else
cw = bitmap.width / 12
ch = bitmap.height / 8
end
n = @actors
.character_index
src_rect = Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch)
if @actors
.actor.unavailable
self.contents.blt(rect.x, rect.y, bitmap, src_rect, 128)
else
self.contents.blt(rect.x, rect.y, bitmap, src_rect, 255)
end
if @actors
.actor.required
lock_bitmap = Cache.system("Locked")
self.contents.blt(rect.x + rect.width - lock_bitmap.width,
rect.y + rect.height - lock_bitmap.height,
lock_bitmap, lock_bitmap.rect)
end
end
end
def item_rect(index)
rect = Rect.new(0, 0, 0, 0)
rect.width = (contents.width + @spacing) / @column_max - @spacing
rect.height = 32
rect.x = index % @column_max * (rect.width + @spacing)
rect.y = index / @column_max * 32
return rect
end
end
我个人建议,这个比较好,至少我喜欢用这个
作者:
反斗奇彬
时间:
2010-10-20 17:42
回复
巧克力猫咪
的帖子
貌似命令不行,我也知道ls推荐的那个脚本,现在问题是我使用了装备扩展脚本会与人物仓库脚本冲突,其中ls推荐的那个脚本更是冲突地厉害,实在没办法才换的,不过找了几个都不行,ls能推荐一个不?
作者:
巧克力猫咪
时间:
2010-10-20 18:12
本帖最后由 巧克力猫咪 于 2010-10-20 18:16 编辑
Project1.rar
(251.41 KB, 下载次数: 42)
2010-10-20 18:11 上传
点击文件名下载附件
就这2个脚本的话貌似行的啊,是不是还加了别的脚本
KGC.rar
(259.29 KB, 下载次数: 37)
2010-10-20 18:16 上传
点击文件名下载附件
这个是KGC的队伍脚本,也没冲突
作者:
反斗奇彬
时间:
2010-10-20 18:19
本帖最后由 反斗奇彬 于 2010-10-20 18:21 编辑
回复
巧克力猫咪
的帖子
我起初也是这样想的,不过我测试过新建一个工程,只添加这两个脚本,发现还是不行,它提示Game_Actor的443出错,顺便说一句吧,你提供的工程我下载试了一下,发现而是错误退出,我晕
未命名.jpg
(12.44 KB, 下载次数: 25)
下载附件
保存到相册
2010-10-20 18:21 上传
作者:
巧克力猫咪
时间:
2010-10-20 18:23
我倒,真的假的,我是新建个工程,然后把这2个放上去,发现没错才发的啊,还有错误
不是我的问题吧,你出现的是哪的错误啊,晕死了
作者:
反斗奇彬
时间:
2010-10-20 18:37
回复
巧克力猫咪
的帖子
不好意思,可能是我操作上有问题吧,这次测试你给的工程可以了,不过我新建工程,把你的脚本复制过去后,发现又报错了,可能是我的软件有问题
作者:
DeathKing
时间:
2010-10-22 12:34
回复
反斗奇彬
的帖子
如果我没记错的话。。。同这个一起发布的还有范例。。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1