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
241 아이템 아이템,돈 보관창고 스크립트 4 file 백호 2009.02.21 1769
240 아이템 아이템도감 14 키라링 2009.01.22 2299
239 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1500
238 아이템 아이템을 사용하여 기술 습득하기 (기술문서 아이템) 2 file 백호 2009.02.21 1033
237 아이템 아이템을 얻으면 자동으로 아이템 입수 메세지윈도우 띄우기 4 백호 2009.02.22 2279
236 아이템 아이템제한스크립트 ps인간 2009.01.23 1680
235 아이템 아이템창변경 27 카르닉스 2010.02.26 3634
234 아이템 아이템획득스크립트 ps인간 2009.01.23 2993
233 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 30 아하!잘봤어요. 2010.02.28 4772
232 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 2 23 아하!잘봤어요. 2010.02.28 3815
231 이동 및 탈것 아하! 그렇구나의 3D 신기술 체험 3 14 아하!잘봤어요. 2010.02.28 4258
230 기타 암울한스크립트? 엔딩후 캐릭터 이어서 새로운 게임시작 스크립트 5 *ps인간 2009.01.26 2533
229 타이틀/게임오버 애니메이션을 타이틀 화면에서 이용 15 file 백호 2009.02.21 3340
228 기타 액알 30 지존!! 2010.07.26 5095
227 전투 액알 스크립트 24 백호 2009.02.22 6013
226 액알 스크립트 강좌용~!!!| 27 아방스 2007.11.09 5461
225 액알입니다.정말 확신함 12 dkqkfsoatp 2007.12.13 4266
» 기타 액터 선택 스크립트 2 백호 2009.02.21 1228
223 전투 액티브 타임 배틀(보행그래픽) file 백호 2009.02.21 2104
222 스킬 약간 수정한 심플액알(크리티컬,스킬) 10 백호 2009.02.22 3836
Board Pagination Prev 1 ... 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 ... 52 Next
/ 52