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 기타 마우스로 길찾기 스크립트 예제 file 백호 2009.02.21 1168
213 기타 랜덤 지하 감옥 작성 스크립트 1 file 백호 2009.02.21 1338
212 기타 테트리스 ?구현 스크립트 2 file 백호 2009.02.21 1714
211 기타 지정범위안에 들어오면 특정한 움직임을 취한다!! 1 백호 2009.02.21 919
210 기타 대화창에 얼굴그래픽 스크립트 25 file 백호 2009.02.21 4137
209 기타 killer님 요청하신 스크립트입니다. 1 나뚜루 2009.02.21 784
208 기타 KGC꺼 몬스터도감 수정해봤어요;;; 9 file 백호 2009.02.21 2134
207 기타 복권 스크립트 6 백호 2009.02.21 1258
206 기타 ATS-Advanced Time System 1 file 백호 2009.02.21 964
205 기타 [KGC]강화스크립트 백호 2009.02.21 1667
204 기타 레벨9999스크립트 4 백호 2009.02.21 1151
203 기타 [KGC]HP&SP게이지 색다른것(글씨와 게이지가 안겹침) 10 file 백호 2009.02.21 2732
202 기타 무기& 방어구 레벨제한 스크립트 23 file 백호 2009.02.21 1880
201 기타 말걸면그림천천히뜨기 4 file 백호 2009.02.21 1101
200 기타 Sphere Grid System file 백호 2009.02.21 765
199 기타 Materia System file 백호 2009.02.21 749
» 기타 액터 선택 스크립트 2 백호 2009.02.21 1228
197 기타 [KGC] 개요 스크립트 2 백호 2009.02.21 1049
196 기타 프리 윈도우 스크립트 (상입오두막 출처) 6 백호 2009.02.21 1449
195 기타 스크립트로 프리윈도우 예제 4 file 백호 2009.02.21 812
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13