VX 스크립트

말그대로... 게이지에 몬스터와 만나려면 몇걸음 남았는지

게이지 형식으로 메뉴에 표시하는 스크립트입니다.

그러니까... 걍 MAIN위에 붙여넣으시면 알아서 게이지를 형성합니다아>.

좀 쓸모 없을 지도 모르지만,, 뭐 아이템에 콜 스크립트로 쓰실 수도 있으니... 아이템에 이용하셔도 될듯..

 

#===============================================================================
# Encounter Gauge by Deriru
# Version 1.0
# How to install:
# --Put under Materials and above Main
#
# Enabling/Disabling Gauge:
# Script: $EncGaugeCtrl.turn_on or $EncGaugeCtrl.turn_off
#
# Checking the Gauge if disabled/enabled(use as a conditional branch)
# Script: $EncGaugeCtrl.is_on? or $EncGaugeCtrl.is_off?
#===============================================================================

#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS BELOW PLEASE!
#-------------------------------------------------------------------------------
module Deriru
module EncGauge
#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS ABOVE PLEASE!
#-------------------------------------------------------------------------------

#===============================================================================
# Setup Begin
#-------------------------------------------------------------------------------
# X and Y of the gauge.
# X range: 0 to 400
# Y range: 0 to 350
#-------------------------------------------------------------------------------
GX = 0
GY = 0
#-------------------------------------------------------------------------------
# Opacity when player is underneath the gauge.
#-------------------------------------------------------------------------------
BEHIND_OPAC = 128
#-------------------------------------------------------------------------------
# Maps that are encounter areas.
#-------------------------------------------------------------------------------
ENCMAPS = [1]
#-------------------------------------------------------------------------------
# Color for the border of the Gauge
#-------------------------------------------------------------------------------
BORDER = Color.new(0,0,0,255)
#-------------------------------------------------------------------------------
# Set to false if you do not want to see the gauge in non-encounter areas.
#-------------------------------------------------------------------------------
SHOW_TOWN = true
#-------------------------------------------------------------------------------
# Color of the Gauge
#-------------------------------------------------------------------------------
LV = Array.new # DO NOT TOUCH!
LV[0] = Color.new(225,255,255,128) # No encounter
LV[1] = Color.new(0,255,0,128) # 0/5 of encounter
LV[2] = Color.new(0,128,0,128) # 1/5 of encounter
LV[3] = Color.new(128,128,0,128) # 2/5 of encounter
LV[4] = Color.new(128,0,0,128) # 3/5 of encounter
LV[5] = Color.new(225,0,0,128) # 4/5 of encounter
#-------------------------------------------------------------------------------
# Setup End
#===============================================================================
#-------------------------------------------------------------------------------
# DO NOT TOUCH PARTS BELOW PLEASE!
#-------------------------------------------------------------------------------
end
end

class Window_DeriruEncHUD < Window_Base

$encgauge = true
MYX = Deriru::EncGauge::GX
MYY = Deriru::EncGauge::GY
if MYX > 400
MYX = 400
elsif MYX < 0
MYX = 0
end
if MYY > 350
MYY = 350
elsif MYY < 0
MYY = 0
end
def initialize
super(MYX,Deriru::EncGauge::GY,150,120)
self.z = 1
self.opacity = 0
end

def refresh(color)
self.contents.clear
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
redraw(color,true)
else
redraw(0,false)
end
end

def redraw(color, encmap)
if encmap == true
enc_gauge = @enc_need - @enc_step
enc_gauge = 1 if enc_gauge < 1
gauge = 100 * enc_gauge / (@enc_need - 1)
self.contents.fill_rect(0,20,104,13,Deriru::EncGauge::BORDER)
self.contents.gradient_fill_rect(2,22,gauge,9,Deriru::EncGauge::LV[1],Deriru::EncGauge::LV[color])
self.contents.draw_text(0,0,300,32,"Encounter")
else
self.contents.fill_rect(0,20,104,13,Deriru::EncGauge::BORDER)
self.contents.fill_rect(2,22,100,9,Deriru::EncGauge::LV[0])
self.contents.draw_text(0,0,300,32,"No Encounter")
end
end

def clearself
self.contents.dispose
end

def setopac(num)
self.contents_opacity = num
end

def update_enc
@enc_need = $game_map.encounter_step
@enc_step = $game_player.encounter_count
one_fifth = Integer(@enc_need/5)
two_fifth = Integer(@enc_need/2.5)
three_fifth = Integer(@enc_need/1.67)
four_fifth = Integer(@enc_need/1.25)
if @enc_step < one_fifth
self.refresh(5)
elsif @enc_step < two_fifth
self.refresh(4)
elsif @enc_step < three_fifth
self.refresh(3)
elsif @enc_step < four_fifth
self.refresh(2)
else
self.refresh(1)
end
end

end

class Scene_Map < Scene_Base

alias der_start start
def start
der_start
if $encgauge == true
if Deriru::EncGauge::SHOW_TOWN == true
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
end
end
else
if @enchud != nil
@enchud.dispose
@enchud = nil
end
end
end

alias der_update update
def update
der_update
if $encgauge == true
if Deriru::EncGauge::SHOW_TOWN == true
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
if Deriru::EncGauge::ENCMAPS.include?($game_map.map_id)
@enchud = Window_DeriruEncHUD.new if @enchud == nil
@enchud.update_enc if @enchud != nil
else
@enchud.contents.dispose if @enchud != nil
@enchud = nil if @enchud != nil
end
end
if $game_player.screen_x + 16 > Deriru::EncGauge::GX + 48 and
$game_player.screen_y + 4 > Deriru::EncGauge::GY + 48 and
$game_player.screen_x - 16 < Deriru::EncGauge::GX + 120 and
$game_player.screen_y - 28 < Deriru::EncGauge::GY + 48
@enchud.setopac(Deriru::EncGauge::BEHIND_OPAC) if @enchud != nil
else
@enchud.setopac(255) if @enchud != nil
end
else
if @enchud != nil
@enchud.dispose
@enchud = nil
end
end
end

alias der_terminate terminate
def terminate
if @enchud != nil
@enchud.dispose
@enchud = nil
end
der_terminate
end



end

class EncCtrl
def turn_on
$encgauge = true
end
def turn_off
$encgauge = false
end
def is_on?
if $encgauge == true
return true
else
return false
end
end
def is_off?
if $encgauge == false
return true
else
return false
end
end
end

$EncGaugeCtrl = EncCtrl.new



Deriru님이 만드신 인카운터 게이지 스크립틉니다.

유옹하게 쓰시길 바라겠습니다.

Comment '2'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
157 저장 Advanced Files 1.3 by Dargor 6 file Alkaid 2010.09.02 2364
156 전투 GubiD's Tactical Battle System 1.5.1.4 (RMVX용) 2 Alkaid 2010.09.03 2858
155 상점 (수정)크리쳐 샵, 'SW_CreatureShop' by Siot Warrior 15 file 시옷전사 2010.09.03 3675
154 상태/속성 Full Status CMS 1.0d by Modern Algebra 1 file Alkaid 2010.09.03 2408
153 스킬 Grid Inventory 1.0f by Modern Algebra 2 Alkaid 2010.09.05 1960
152 메시지 Advanced Text System 3.0b by Modern Algebra 3 file Alkaid 2010.09.05 2206
151 액터 (수정)크리쳐 합체, 'SW_CreatureMix' by SiotWarrior 22 file 시옷전사 2010.09.07 2972
150 기타 VX Weather Script by ccoa 1 Alkaid 2010.09.08 1318
149 메시지 Universal Message System 0.3.0(beta) by ccoa 3 file Alkaid 2010.09.08 2304
148 액터 Point Spend System 1.05 by Drago del Fato (포인트로 스탯 올리기) 6 Alkaid 2010.09.08 2612
147 메시지 Advanced Text System 3.0c by Modern Algebra 3 file Alkaid 2010.09.08 2302
146 맵/타일 맵상 캐릭터 그래픽 확대 / 축소 이벤트 스크립트 6 시트르산 2010.09.10 3023
145 기타 타격관계도 등의 한계돌파 11 시트르산 2010.09.10 2365
144 전투 RPG Tankentai SBS 3.4d + ATB 1.2c Kaduki 18 시트르산 2010.09.10 6449
143 기타 이벤트 제작용 소품 모음 스크립트 12 시트르산 2010.09.10 2209
142 전투 Animated Battlers VX 3.4 by DerVVulfman 5 file Alkaid 2010.09.10 3117
141 기타 레벨업 시 증가분의 HP/MP 회복 10 시트르산 2010.09.12 2427
140 파티 Party Changer 3.9 by Dargor 5 file Alkaid 2010.09.12 2364
139 기타 みんと씨의 RMVX 샘플 프로젝트 1.11 (2009-11-05) 6 Alkaid 2010.09.13 2005
138 상태/속성 Stat Distribution System 1.71 by Lettuce 7 file Alkaid 2010.09.14 2339
Board Pagination Prev 1 ... 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Next
/ 32