แก้ไขครั้งสุดท้ายโดย hengmana เมื่อ 2014-7-19 16:54
สวัดดีค่ะ เจอกันอีกแล้วนะค่ะ กลับ Mint ตอนนี้ หลายๆ คน อาจจะ เบื่อๆ กับ scirpt Train_Actor เพราะว่า script Train_Actor มันจะตามได้ แค่ 4 คน
บางคนก็เบื่อๆ กับ ต้องหา scirpt คนเดินตามเยอะๆ แต่วันนี้ ไม่ทำให้เบื่อ เอานี่ ค่ะ scirpt
อีก หนึ่ง script นะค่ะ คือ Walking Sound คือ script เสียงเดินของ เรา นะค่ะ หลายคน เบื่อๆคือ เวลาเดินทำไมไม่มีเสียง
script 3 script แบบ หายาก นะค่ะ จะหาที่นี่ก็ไม่เจอ ค่ะ
สวัดดีค่ะ เจอกันอีกแล้วนะค่ะ กลับ Mint ตอนนี้ หลายๆ คน อาจจะ เบื่อๆ กับ scirpt Train_Actor เพราะว่า script Train_Actor มันจะตามได้ แค่ 4 คน
บางคนก็เบื่อๆ กับ ต้องหา scirpt คนเดินตามเยอะๆ แต่วันนี้ ไม่ทำให้เบื่อ เอานี่ ค่ะ scirpt
#==============================================================================
# ** Large Party
#------------------------------------------------------------------------------
# Author: Dargor
# Version 1.3
# 02/08/2007
#==============================================================================
#==============================================================================
# ** Large Party Customization Module
#==============================================================================
module Dargor
module Large_Party
# Maximum number of actors allowed in the party
Max_Size = 59
# Battle status window refresh rate (used in phase5)
Battle_Refresh_Rate = 59
end
end
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :battle_actor_index # @actor_index in battle scene
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_temp_initialize initialize
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
large_party_temp_initialize
@battle_actor_index = 26
end
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# This class handles the party. It includes information on amount of gold
# and items. Refer to "$game_party" for the instance of this class.
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :max_size # Max number of actors allowed in the party
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_initialize initialize
alias large_party_add_actor add_actor
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
large_party_initialize
@max_size = Dargor::Large_Party::Max_Size
end
#--------------------------------------------------------------------------
# * Add an Actor
# actor_id : actor ID
#--------------------------------------------------------------------------
def add_actor(actor_id)
# Original method
large_party_add_actor(actor_id)
# Get actor
actor = $game_actors[actor_id]
# If the party has less than 4 members and this actor is not in the party
if @actors.size < @max_size and not @actors.include?(actor)
# Add actor
@actors.push(actor)
# Refresh player
$game_player.refresh
end
end
end
#==============================================================================
# ** Sprite_Battler
#------------------------------------------------------------------------------
# This sprite is used to display the battler.It observes the Game_Character
# class and automatically changes sprite conditions.
#==============================================================================
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_sprite_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Original method
large_party_sprite_update
# Set sprite coordinates
if @battler.is_a?(Game_Actor)
self.x = @battler.screen_x - ($game_temp.battle_actor_index / 4) * 640
end
end
end
#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================
class Spriteset_Battle
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_spriteset_update update
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Cycle through all extra actors (4+)
# Create/update sprites
for i in 4...$game_party.actors.size
if @actor_sprites<i>.nil?
@actor_sprites.push(Sprite_Battler.new(@viewport2))
end
@actor_sprites<i>.battler = $game_party.actors<i>
end
# Original method
large_party_spriteset_update
end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
# This window displays party member status on the menu screen.
#==============================================================================
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_menu_status_initialize initialize
alias large_party_menu_status_refresh refresh
alias large_party_menu_status_update_cursor_rect update_cursor_rect
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Original method
large_party_menu_status_initialize
# Adjust contents height
@item_max = $game_party.actors.size
height = @item_max * 118
self.contents = Bitmap.new(width - 32, height - 32)
# Refresh
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh(*args)
# Original method
large_party_menu_status_refresh(*args)
# Adjust default height
self.height = 480
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
large_party_menu_status_update_cursor_rect
row = @index / @column_max
if row < self.top_row
self.top_row = row
end
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
cursor_width = self.width / @column_max - 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 116 - self.oy
self.cursor_rect.set(x, y, cursor_width, 96)
end
#--------------------------------------------------------------------------
# * Top Row
#--------------------------------------------------------------------------
def top_row
return self.oy / 116
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : new row
#--------------------------------------------------------------------------
def top_row=(row)
if row < 0
row = 0
end
if row > row_max - 1
row = row_max - 1
end
self.oy = row * 116
end
#--------------------------------------------------------------------------
# * Page Row Max
#--------------------------------------------------------------------------
def page_row_max
return 4
end
end
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
# This window displays the status of all party members on the battle screen.
#==============================================================================
class Window_BattleStatus < Window_Base
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_battle_status_initialize initialize
alias large_party_battle_status_refresh refresh
alias large_party_battle_status_update update
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@column_max = 4
large_party_battle_status_initialize
width = $game_party.actors.size * 160
self.contents = Bitmap.new(width - 32, height - 32)
self.width = 640
@level_up_flags = []
for i in 0...$game_party.actors.size
@level_up_flags << false
end
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
# Refresh contents when actors are added/removed in-battle
if $game_party.actors.size != @item_max
@item_max = $game_party.actors.size
width = @item_max * 160
self.contents = Bitmap.new(width - 32, height - 32)
self.width = 640
end
large_party_battle_status_refresh
column = $game_temp.battle_actor_index / 4
self.ox = column * 640
end
end
#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------
# This class performs battle screen processing.
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# * Alias Listing
#--------------------------------------------------------------------------
alias large_party_phase3_setup_command_window phase3_setup_command_window
alias large_party_update_phase4_step2 update_phase4_step2
alias large_party_start_phase5 start_phase5
alias large_party_update_phase5 update_phase5
#--------------------------------------------------------------------------
# * Actor Command Window Setup
#--------------------------------------------------------------------------
def phase3_setup_command_window
$game_temp.battle_actor_index = @actor_index
@status_window.refresh
large_party_phase3_setup_command_window
@actor_command_window.x = (@actor_index%4) * 160
end
#--------------------------------------------------------------------------
# * Frame Update (main phase step 2 : start action)
#--------------------------------------------------------------------------
def update_phase4_step2
if @active_battler.is_a?(Game_Actor)
$game_temp.battle_actor_index = @active_battler.index
@status_window.refresh
end
large_party_update_phase4_step2
end
#--------------------------------------------------------------------------
# * Start After Battle Phase
#--------------------------------------------------------------------------
def start_phase5
@actor_index = 0
@status_wait = Graphics.frame_count
large_party_start_phase5
end
#--------------------------------------------------------------------------
# * Frame Update (after battle phase)
#--------------------------------------------------------------------------
def update_phase5
refresh_rate = Dargor::Large_Party::Battle_Refresh_Rate
if Graphics.frame_count >= @status_wait + refresh_rate
$game_temp.battle_actor_index = @actor_index
@status_window.refresh
@status_wait = Graphics.frame_count
max = ($game_party.actors.size.to_f/4).ceil * 4
@actor_index = (@actor_index+1) % max
end
large_party_update_phase5
end
end
แค่นี้ ค่ะ ต่อไป Camera หลายคน อาจไม่รู้จักร นะค่ะ มันคือ scirpt เลื่อนหน้าจอ หรือมันแบบว่า เรากำลัง โดน ถ่าย หลายคน อาจจะเบื่อๆ คือ มันเลื่อนหน้าจอ ไม่ได้ เผื่อ ศัตรู มา เราจะได้หลบ ทัน ทีนี้ ก็ scirpt ค่ะ#==============================================================================
# ★ 촬영 기술 var 1.0 (07.2.12) by shun 번역: 인간(jty1025)
#------------------------------------------------------------------------------
# 맵 화면에서 스크롤을 카메라풍으로 늦추거나
# 플레이어와는 독립시켜 스크롤 시키거나 할 수 있습니다.
#==============================================================================
module SIMP
#--------------------------------------------------------------------------
# ○ 설정
#--------------------------------------------------------------------------
#
# 스크롤 속도
#
CAMERA_MIN_SPEED = 1 # 최저한의 스크롤 속도
CAMERA_DELEY = 2 # 속도 보정 (값이 큰 만큼 늦는다)
#
# 독립 스크롤
#
CAMERA_SCROLL_SWITCH = 48 # 스크롤 금지 스위치의 번호
CAMERA_SCROLL_KEY = Input::A # 스크롤을 개시하는 버튼 (Input::<버튼>)
CAMERA_SCROLL_SPEED = 5 # 스크롤 하는 기본 속도
CAMERA_SCROLL_DIR8 = true # 8 방향 입력
end
class Game_Map
#--------------------------------------------------------------------------
# ● 공개 인스턴스 변수
#--------------------------------------------------------------------------
attr_writer :real_display_x # X 좌표 (실좌표)
attr_writer :real_display_y # Y 좌표 (실좌표)
#--------------------------------------------------------------------------
# ● 오브젝트 초기화
#--------------------------------------------------------------------------
alias camera_initialize initialize
def initialize
camera_initialize
@real_display_x = 0
@real_display_y = 0
end
#--------------------------------------------------------------------------
# ● 셋업
# map_id : 맵 ID
#--------------------------------------------------------------------------
alias camera_setup setup
def setup(map_id)
camera_setup(map_id)
@real_display_x = 0
@real_display_y = 0
end
#--------------------------------------------------------------------------
# ● 표시 X 좌표 * 128
#--------------------------------------------------------------------------
def display_x
return @real_display_x
end
#--------------------------------------------------------------------------
# ● 표시 Y 좌표 * 128
#--------------------------------------------------------------------------
def display_y
return @real_display_y
end
#--------------------------------------------------------------------------
# ● 프레임 갱신
#--------------------------------------------------------------------------
alias camera_update update
def update
camera_update
dx = @display_x - @real_display_x
unless dx == 0
speed = get_speed(dx.abs)
distance = 2 ** speed
if dx > 0
@real_display_x = [@real_display_x + distance, @display_x].min
else
@real_display_x = [@real_display_x - distance, @display_x].max
end
end
dy = @display_y - @real_display_y
unless dy == 0
speed = get_speed(dy.abs)
distance = 2 ** speed
if dy > 0
@real_display_y = [@real_display_y + distance, @display_y].min
else
@real_display_y = [@real_display_y - distance, @display_y].max
end
end
end
#--------------------------------------------------------------------------
# ○ 스크롤 속도를 취득
# distance : 움직이는 목표까지의 거리
#--------------------------------------------------------------------------
def get_speed(distance)
return [SIMP::CAMERA_MIN_SPEED, distance / 32 - SIMP::CAMERA_DELEY].max
end
end
class Game_Player < Game_Character
#--------------------------------------------------------------------------
# ● 프레임 갱신
#--------------------------------------------------------------------------
alias camera_update update
def update
# 이동중, 이벤트 실행중, 이동 루트 강제중,
# 메세지 윈도우 표시중의 머지않아도 아닌 경우
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# 스크롤 키가 밀렸을 경우, 독립 스크롤 플래그를 유효하게 한다
if Input.trigger?(SIMP::CAMERA_SCROLL_KEY) and @scroll != true and
$game_switches[SIMP::CAMERA_SCROLL_SWITCH] != true
# 결정 SE 를 연주
$game_system.se_play($data_system.decision_se)
@scroll = true
Input.update
end
end
# 독립 스크롤중의 경우
if @scroll
super
update_scroll
else
camera_update
end
end
#--------------------------------------------------------------------------
# ○ 프레임 갱신 (독립 스크롤)
#--------------------------------------------------------------------------
def update_scroll
# 스크롤 키가 밀렸을 경우
if Input.trigger?(SIMP::CAMERA_SCROLL_KEY)
# 캔슬 SE 를 연주
$game_system.se_play($data_system.cancel_se)
# 플레이어에 화면을 되돌린다
center(@x, @y)
# 독립 스크롤 플래그를 무효로 한다
@scroll = false
return
end
distance = 2 ** SIMP::CAMERA_SCROLL_SPEED
# 방향 버튼이 밀리고 있으면, 그 방향에 스크롤
dir = (SIMP::CAMERA_SCROLL_DIR8 ? Input.dir8 : Input.dir4)
case dir
when 1
$game_map.scroll_down(distance)
$game_map.scroll_left(distance)
when 2
$game_map.scroll_down(distance)
when 3
$game_map.scroll_down(distance)
$game_map.scroll_right(distance)
when 4
$game_map.scroll_left(distance)
when 6
$game_map.scroll_right(distance)
when 7
$game_map.scroll_left(distance)
$game_map.scroll_up(distance)
when 8
$game_map.scroll_up(distance)
when 9
$game_map.scroll_right(distance)
$game_map.scroll_up(distance)
end
end
#--------------------------------------------------------------------------
# ● 화면 중앙에 오도록(듯이) 맵의 표시 위치를 설정
#--------------------------------------------------------------------------
alias camera_center center
def center(x, y)
camera_center(x, y)
$game_map.real_display_x = $game_map.display_x
$game_map.real_display_y = $game_map.display_y
end
end
#--------------------------------------------------------------------------อีก หนึ่ง script นะค่ะ คือ Walking Sound คือ script เสียงเดินของ เรา นะค่ะ หลายคน เบื่อๆคือ เวลาเดินทำไมไม่มีเสียง
script 3 script แบบ หายาก นะค่ะ จะหาที่นี่ก็ไม่เจอ ค่ะ
แจก scirpt Camera และ script Party แจก script Walking sound