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
74 기타 현재 맵BGM을 그대로 전투 BGM으로 연결 from phylomortis.com 백호 2009.02.22 1180
73 기타 스크롤되는 파노라마(Autoscrolling Panorama) by RPG Advocate 백호 2009.02.22 993
72 기타 폰트 자동 설치 스크립트 12 file 백호 2009.02.22 2865
71 기타 아이디 스크립트 4 백호 2009.02.22 1761
70 기타 몬스터 도감 18 file 백호 2009.02.22 2668
69 기타 Hero Databass 4 file 백호 2009.02.22 797
68 기타 Activation_system file 백호 2009.02.22 775
67 기타 횡스크롤 스크립트 한국말 번역. 15 file 백호 2009.02.21 3311
66 기타 Steal Script (SDK Required) file 백호 2009.02.21 1182
65 기타 능력치 무한대 스크립트 (따로 넣을필요없음) 2 백호 2009.02.21 1027
64 기타 AMS-Advanced Message Script Edited by Dubleax 3 file 백호 2009.02.21 765
63 기타 시작하자 마자 풀 스크린 2 백호 2009.02.21 1082
62 기타 Anti Event Lag Script 3 백호 2009.02.21 1057
61 기타 killer님 요청하신 스크립트 두번째입니다. 나뚜루 2009.02.21 759
60 기타 스크립트로 프리윈도우 예제 4 file 백호 2009.02.21 812
59 기타 프리 윈도우 스크립트 (상입오두막 출처) 6 백호 2009.02.21 1449
58 기타 [KGC] 개요 스크립트 2 백호 2009.02.21 1049
» 기타 액터 선택 스크립트 2 백호 2009.02.21 1228
56 기타 Materia System file 백호 2009.02.21 749
55 기타 Sphere Grid System file 백호 2009.02.21 765
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 Next
/ 13