XP 스크립트

실행하는 스크립트는 $scene = Scene_Choise.new 입니다.

출처는 RMXP.net

사용법은
@id[1] = 1
이 부분에서 마지막의 숫자 1을 액터의 아이디로 바꿔주시면 됩니다.
액터 선택을 3명이상 할려면 @number_of_actor = 3에서의 3을 바꿔주시면 됩니다.

#================================================= =============
# ■ Scene_Choise
#================================================= =============

class Scene_Choise

def initialize(menu_index = 0)
@menu_index = menu_index
end
#--------------------------------main
def main
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title($data_system.title_name)

#=======================================================
# add the id of hero who you want to show in the selectable table
@id = []
@id[1] = 1
@id[2] = 4
@id[3] = 2
@number_of_actor = 3
# end of add
#=======================================================

s = []
for i in 1..@number_of_actor
s.push($game_actors[@id[i]].name)
end

@command_window = Window_Command.new(130, s)
@command_window.index = @menu_index
@command_window.x = 20
@command_window.y = 90

@playtime_window = Window_Choise.new()
id = @id[@menu_index + 1]
@playtime_window.change_actor($game_actors[id])
@playtime_window.x = 180
@playtime_window.y =0
# @playtime_window.back_opacity = 130

Graphics.transition

loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end

Graphics.freeze
@command_window.dispose
@playtime_window.dispose
end
#------------------ update
def update
if @command_window.index != @menu_index
@menu_index = @command_window.index
id = @id[@menu_index + 1]
@playtime_window.change_actor($game_actors[id])
end
@command_window.update
@playtime_window.update
if @command_window.active
update_command
return
end
end
# -------------------- update command
def update_command

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Title.new
return
end

if Input.trigger?(Input::C)
$game_system.se_play($data_system.decision_se)
Graphics.frame_count = 0
Audio.bgm_stop

# $game_variables[1] use as the id of the main hero
$game_variables[1] = @id[@command_window.index + 1]

#add the main hero to the group
$game_party.add_actor($game_variables[1])

#=======================================================
# if the other heros (in the select table) will be add in the group later
# you must know who is the next one
gv = 2
for i in 1..@number_of_actor
next if i == @command_window.index + 1
$game_variables[gv] = @id[i]
gv += 1
end

# add other heros (in the select table) to the group
for i in 2..@number_of_actor
$game_party.add_actor($game_variables[i])
end
#=======================================================

#=======================================================
# here to add the other heros (not in the select table)
$game_party.add_actor(3)
#=======================================================


# Setting up the map of initial position
$game_map.setup($data_system.start_map_id)
# Moving the prayer to initial position
$game_player.moveto($data_system.start_x, $data_system.start_y)
# Refreshing the prayer
$game_player.refresh
# Executing the automatic operation change of BGM and BGS which are set to the map
$game_map.autoplay
# Map renewal (parallel event execution)
$game_map.update

$scene = Scene_Map.new
return
end
end
end

#================================================= =============================
# ■ Window_Choise
#================================================= =============================

class Window_Choise < Window_Base
#--------------------------------------------------------------------------
def initialize()
super(0, 0, 440, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $defaultfonttype # "Status" window font
self.contents.font.size = $defaultfontsize
end
#---------------------------------------------------------------------------
# tao hinh battler
#---------------------------------------------------------------------------
def draw_actor_battler(actor, x, y)
bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
cw = bitmap.width
ch = bitmap.height
src_rect = Rect.new(0, 0, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
#--------------------------------------------------------------------------
def change_actor(actor)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
def refresh
self.contents.clear

draw_actor_hp(@actor, 10, 120, 172)
draw_actor_sp(@actor, 10, 152, 172)

for i in 0..6
draw_actor_parameter(@actor, 10, 192 + i * 36, i)
end

draw_item_name($data_weapons[@actor.weapon_id], 240, 208)
draw_item_name($data_armors[@actor.armor1_id], 240, 256)
draw_item_name($data_armors[@actor.armor2_id], 240, 304)
draw_item_name($data_armors[@actor.armor3_id], 240, 352)
draw_item_name($data_armors[@actor.armor4_id], 240, 400)

draw_actor_name(@actor, 80, 0)
draw_actor_class(@actor, 113, 30)

draw_actor_graphic(@actor, 150, 110)
draw_actor_battler(@actor, 300, 200)

self.contents.font.color = system_color
self.contents.draw_text(5, 0, 120, 32, "Name :")
self.contents.draw_text(5, 30, 236, 32, "Class :")
self.contents.draw_text(5, 72, 288, 32, "Normal Picture :")

self.contents.draw_text(200, 208 - 30 , 100, 32, $data_system.words.weapon + ":")
self.contents.draw_text(200, 256 - 30, 100, 32, $data_system.words.armor1+ ":")
self.contents.draw_text(200, 304 - 30, 100, 32, $data_system.words.armor2 + ":")
self.contents.draw_text(200, 352 - 30, 100, 32, $data_system.words.armor3 + ":")
self.contents.draw_text(200, 400 - 30, 100, 32, $data_system.words.armor4 + ":")

end
end

Who's 백호

?

이상혁입니다.

http://elab.kr


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
214 기타 일시정지 스크립트 13 【§㉤ㅏ법㉧ㅣ§】 2011.02.26 1841
213 기타 일본RPGXP게임에서 번역한 스크립트 입니다. 1 백호 2009.02.22 1735
212 기타 이벤트 범위 스크립트 2 Tine 2012.07.25 1580
211 기타 요리스크립트 (구) 6 *ps인간 2009.01.26 1932
210 기타 요리 시스템 스크립트 12 file 백호 2009.02.21 2022
209 기타 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 1 file 백호 2009.02.21 1263
208 기타 엔딩에 스탭롤을 도입하는 스크립트 1 file 백호 2009.02.21 1335
207 기타 에어리어 설정 by RPG Advocate 백호 2009.02.22 709
206 기타 업데이트 (죽었을경우부활 )스크립트한글화 2 by향온 2011.09.27 2438
205 기타 어디에 쓰이는지 불확실한 스크립트 1 백호 2009.02.22 1063
204 기타 양손무기, 전신갑옷 스크립트 2 백호 2009.02.22 1714
» 기타 액터 선택 스크립트 2 백호 2009.02.21 1228
202 기타 액알 30 지존!! 2010.07.26 5095
201 기타 암울한스크립트? 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 5 *ps인간 2009.01.26 2532
200 기타 아이디 스크립트 4 백호 2009.02.22 1761
199 기타 아래 스크립트에 대한 Guillaume777님의 개량판입니다. 백호 2009.02.22 880
198 기타 쓸만한스크립트61개포함 28 file 궭크이 2012.01.09 4297
197 기타 쓸 용도가 없지만 마비노기 게임 만들 때 좋죠[장작스크립트] 5 백호 2009.02.22 2407
196 기타 실제시간표시스크립트입니다...[중뷁이면지성;;] 4 백호 2009.02.22 1349
195 기타 시작하자 마자 풀 스크린 2 백호 2009.02.21 1082
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13