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 맵/타일 누가 이전에 올렸을지도..... KGC_MapLightening 3 file 클로버군 2012.07.02 2745
316 기타 높이(층)를 설정하는 스크립트 11 file 카르와푸딩의아틀리에 2009.07.01 3343
315 온라인 넷VX - 온라인 스크립트 29 아방스 2009.01.06 6749
314 메시지 네오 메시지 시스템 최신 17 file RPGbooster 2008.10.08 4251
313 HUD 네비게이션 (나침반) 36 file 허걱 2009.08.25 4908
312 메시지 넘버님의로딩수정101번눌르긴그레서..... 7 file 알피지vx초짜 2010.01.22 2394
311 상태/속성 넓어진 상태창 v1.0 11 file 아방스 2009.01.20 4536
310 장비 남성 / 여성전용 장비 스크립트 (수정 v1.1) 16 Evangelista 2009.11.15 3070
309 날씨 스크립트ㅎㅎ 9 Man... 2008.10.27 2360
308 기타 낚시 스크립트~(낚시대로 하는 낚시가 아니라 사람을 낚는 낚시 스크립트) 14 file ~AYARSB~ 2010.03.18 3630
307 깔끔한 링메뉴 45 file RPGbooster 2008.10.08 5000
306 타이틀/게임오버 까만화면으로 시작하기 27 file 허걱 2009.07.04 4528
305 메뉴 김태히님이 개조한 모그메뉴 스텟화면 43 file RPGbooster 2008.10.08 6360
304 메뉴 기본메인 메뉴 아이콘 추가 10 아방스 2010.12.11 4573
303 이름입력 글자조합 (이름생성용) - 수정 12 file 허걱 2009.07.17 3638
302 기타 글씨표시 스크립트 32 file 허걱 2009.08.10 4421
301 그래픽 그림자 없에는 스크립트(그런것 같음) 1 Man... 2008.10.27 1641
300 기타 그림자 없애기... 3 비극ㆍ 2010.04.19 1642
299 기타 그림을 각도로 회전시키기 1 허걱 2009.06.30 2328
298 기타 경험치, HP, MP 백분율계산 (실시간) 8 file 허걱 2009.08.01 3540
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