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
517 기타 이벤트 뿌리기 + 범위지정 8 file 허걱 2009.07.13 2698
516 이동속도의 한계를 없앤다 11 file RPGbooster 2008.10.08 2815
515 이동 및 탈것 이동 기능 파워업 (장애물 등을 피하는 이동방식) 8 file 파노 2014.04.27 1717
514 메뉴 윈도우창 크기 조절 스크립트 0.3 5 아방스 2008.01.30 3038
513 메뉴 윈도우 색변경 스크립트 7 file 비극ㆍ 2010.03.01 2598
512 웨이포인트 9 file RPGbooster 2008.10.08 3415
511 맵/타일 월드맵 스크립트 49 아방스 2008.09.07 6123
510 원경 원경(파노라마) 바꾸기 9 file 허걱 2010.05.28 3369
509 움직이는커서 11 file RPGbooster 2008.10.08 5090
508 기타 요리 시스템을 도입하는 스크립트입니다. 9 file 스페나로츠 2011.08.18 3145
507 온라인 온라인입니다 4 file 알피지GM 2010.03.07 6358
506 저장 오토세이브 VX 5 file 카르와푸딩의아틀리에 2009.10.05 4138
505 전투 오버 드라이브 프로블럼 2 Man... 2008.10.28 2268
504 오버 드라이브 8/24 버젼 20 file RPGbooster 2008.10.11 2904
503 퀘스트 오메가7 퀘스트 스크립트 한글화,사용법,데모게임 직접제작 32 file DH Games 2010.02.14 4578
502 영어 잘하는 사람만 보세요..저도 모르겠음(무슨 스크립트인지) 3 Man... 2008.10.27 1372
501 메시지 여러항목 선택지 ... Scene처리.. 23 file 허걱 2009.02.14 5277
500 기타 여러스크립트(목적은 포인트) 12 file 인생은 힘들다. 2011.08.26 3087
499 전투 에너미를 아이템으로 변화하는 스킬 8 Evangelista 2009.05.27 2850
498 엄청 좋음(DEMO)클릭 하이퍼링크 걸려있음(누가 변혁좀 해 줬으면...) 4 Man... 2008.10.27 1745
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 32 Next
/ 32