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
317 저장 세이브 시스템 확장 스크립트 9 file 신규회원 2012.02.24 3315
316 아이템 아이템 분류 19 file RPGbooster 2008.10.11 3309
315 저장 세이브/로드가 불가능한 스크립트!!! 9 file ~AYARSB~ 2010.03.08 3298
314 스킬 DQ특기풍스킬 - KGC 4 카르와푸딩의아틀리에 2009.08.19 3288
313 이름입력 MOG 이름바꾸기 11 file RPGbooster 2008.10.08 3285
312 장비 장비 레벨 개념 추가 스크립트 14 아방스 2010.12.06 3275
311 다음 레벨까지의 경험치 강제조정 13 정의로운녀석 2008.07.24 3273
310 액터 한계돌파(렙9999) 18 작은샛별 2010.03.07 3273
309 기타 KGC파라미터배분 2 (VX전용) 20 file 카르와푸딩의아틀리에 2009.07.21 3269
308 이동 및 탈것 탈것탑승후 내부로 이동하는 스크립트 16 file 카르와푸딩의아틀리에 2009.07.01 3268
307 상태/속성 어떤 상태일때에만 사용가능한 스킬 14 file 좀비사냥꾼 2009.03.25 3266
306 기타 라이트 이펙트 스크립트 12 file 아방스 2009.02.07 3262
305 기타 [kcg] 슬립 데미지 상세화 19 BoneheadedAlien 2009.02.22 3242
304 메시지 메시지 오른쪽 정렬되어 나오는 스크립트 3 file 아방스 2009.07.12 3237
303 기타 <중수이상>RPG VX의 대표적 참조값 6 까까까 2009.05.31 3236
302 타이틀/게임오버 Graphics Load System 1.0.1 14 file NightWind AYARSB 2010.06.10 3230
301 전투 사이드뷰배틀에서 찌르기 공격 가능하게 7 078656577er 2009.09.16 3223
300 전투 불사신(무적) 스크립트 9 file 미얼 2009.10.29 3198
299 기타 [자작]게임 실행시 파일 체크 프로그램. 또는 파일 실행기. 16 file NightWind AYARSB 2010.05.20 3193
298 상점 Shopoholic(한글 설명) 11 Man... 2008.10.29 3185
Board Pagination Prev 1 ... 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 ... 32 Next
/ 32