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
701 상점 상점 메뉴 개조시킨 스크립트 9 file 백호 2009.02.21 2322
700 전투 사이트뷰 전투 스크립트 (CBS R1) 8 file 백호 2009.02.21 3498
699 전투 사이비 CTB 1 file 백호 2009.02.21 1701
698 전투 사이드뷰 전투(보행그래픽) 15 file 백호 2009.02.21 4244
697 전투 사이드뷰 배틀 (2003 형식으 전투)| 12 file 아방스 2007.11.09 4744
696 전투 사이드뷰 방식 스크립트. 8 file 백호 2009.02.21 4640
695 기타 빛의 퍼즐 -미니게임- 1 file 백호 2009.02.21 1360
694 메뉴 비밀소년님의 필드에서 경치 % 로 나오는거 윈도우 없이 8 백호 2009.02.22 1789
693 기타 비밀소년님의 경험치 표시 스크립트 백호 2009.02.22 1419
692 비공정 스크립트의 탑승속도 변경하기. 3 아방스 2008.01.14 1346
691 이동 및 탈것 비공정 스크립트 5 file 백호 2009.02.22 1506
690 기타 분류 별로 윈도우 스킨 다르게 사용하기 file 백호 2009.02.21 1015
689 기타 부활스크립트 4 캉쿤 2011.09.19 2061
688 그래픽 부드럽게 화면이 움직이는 스크립트 입니다. 16 GangSin 2012.09.12 4590
687 기타 복권 스크립트 6 백호 2009.02.21 1258
686 전투 보행그래픽으로 싸우는 턴알 17 백호 2009.02.22 3782
685 전투 버틀러 색조 변경 5 file 백호 2009.02.21 1552
684 이동 및 탈것 백호님이올린 발소리 스크립트를 소리만 바꾸어 밨음 4 lhh9606 2009.05.19 2676
683 전투 배틀포인트 + 배틀샵 1 file 백호 2009.02.21 1272
682 전투 배틀샵 스크립트 1 백호 2009.02.22 1126
Board Pagination Prev 1 ... 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ... 52 Next
/ 52