VX 스크립트

던전에 적정 레벨이 뭔지 표시해주는(화면상에)스크립트입니다.

그러니까 화면상에... 스위치 71(디폴트 온오프 스위치) 를 on시키면 표시를 하지 않고, off시키면 표시를 해주는 스크립트입니다.

직접 만든 HUD도 첨부했으니 꼭 "Lvname.PNG"로 시스템(Graphics/System)에 넣어주시길.

변수(조정 변수-default27)을 꼭 장소 이동 전(예를 들면 문에라던가...)를 조정해주시면, 그 변수의 값 대로 LV를 표시해 줍니다.

꼭 유용한데 쓰시길 바라겠습니다.

아래부터 복사..

#--------------------------------------------------------------
# [VX] Level Range Indicator
#--------------------------------------------------------------
# by Kilin (kilin08@hotmail.com)
# Shaltix Games
# Version: 1.0
# Notes: This was written to work next to Mog's Map Location
# HUD script. This script can be used with or without it, but
# the basic layout is pretty much the same, with altered
# variable names.
#--------------------------------------------------------------
# The idea of this script is to display a recommended level
# value upon entering a map. The range is determined by one
# variable which can be changed through a call script. The
# script is useful for letting players know when they're in
# an area that they won't be able to survive in.
# You will need to declare the variable BEFORE you enter the
# map in order for it to work. A good place to change it is in
# the Transfer Player event.
#--------------------------------------------------------------
# REQUIREMENTS BEFORE USE:
# Set aside a switch and a variable for this script. The default
# number for both the switch and variable are 11. Let's say you
# already have a switch or variable in slot 11. Simply change the
# value in SWITCH_LEVELRANGE_OFF or LVVAR to match the slots you're
# using. Then when your player is changing rooms, change the
# level variable to whatever you wish and it will show in the
# next room.
#--------------------------------------------------------------
module LevelRange
#==============================================================
# SCRIPT SETUP - Declares customizable variables (You can change
# any of these values and the script will still run.
#==============================================================
SWITCH_LEVELRANGE_OFF = 71 # Turn this switch (default slot 71) on to stop showing the level range
LVVAR = 27 # This is the editable variable (default slot 27) that you'll change through variable actions
# - it signifies the level indication
LVFONT = "Georgia" # Text font
LVFADE = true # Fading on or off - This lets you keep it on the screen at all times if set to false
LVFADETIME = 10 # Fading time - This has no effect if LVFADE is set to false
LVWPOS = 2 # Window Position. 0 - Top Left, 1 - Bottom Left, 2 - Top Right, 3 - Bottom Right
end
#==============================================================
# Game_System - Declares secondary variables.
#==============================================================
class Game_System
attr_accessor :fadetm
attr_accessor :lvrn_x
attr_accessor :lvrn_y
alias lvrn_ini initialize
def initialize
lvrn_ini
@fadetm = 255 + 40 * LevelRange::LVFADETIME
if LevelRange::LVWPOS == 0
@lvrn_x = -300
@lvrn_y = 48
elsif LevelRange::LVWPOS == 1
@lvrn_x = -300
@lvrn_y = 272
elsif LevelRange::LVWPOS == 2
@lvrn_x = 640
@lvrn_y = 48
else
@lvrn_x = 640
@lvrn_y = 272
end 
end
def lvrn_x
return @lvrn_x
end
def lvrn_y
return @lvrn_y
end
def fadetm
if @fadetm <= 0
@fadetm = 0
end
return @fadetm
end
end
#==============================================================
# Window_Base - Controls text and icon drawing.
#==============================================================
class Window_Base < Window
def nd_lvpic
lvic = Cache.system("")    
end
def draw_lvname(x,y)
lvic = Cache.system("Lvname") rescue nd_lvic
cw = lvic.width 
ch = lvic.height
sr_rec = Rect.new(0, 0, cw, ch)
self.contents.blt(x , y - ch + 65, lvic, sr_rec)
self.contents.font.name = LevelRange::LVFONT
self.contents.font.size = 16
self.contents.font.bold = true
self.contents.font.shadow = true
self.contents.font.color = Color.new(0,0,0,255)
self.contents.draw_text(x - 12, y + 32, 160, 32, "Level " + $game_variables[LevelRange::LVVAR].to_s,1)
self.contents.font.color = Color.new(255,255,255,255)
self.contents.draw_text(x - 11, y + 31, 160, 32, "Level " + $game_variables[LevelRange::LVVAR].to_s,1)
end
end
#==============================================================
# Lvname - Declares a final class.
#==============================================================
class Lvname < Window_Base
def initialize(x , y)
super($game_system.lvrn_x, $game_system.lvrn_y, 250, WLH + 70)
self.opacity = 0
refresh
end
def refresh
self.contents.clear
draw_lvname(10,0)   
end
end
#~ #==============================================================
# Scene_Map - Does all the drawing.
#==============================================================
class Scene_Map
alias lvrn_start start
def start
@lvrn = Lvname.new($game_system.lvrn_x, $game_system.lvrn_y)
@lvrn.contents_opacity = $game_system.fadetm
if $game_switches[LevelRange::SWITCH_LEVELRANGE_OFF] == false
@lvrn.visible = true
else
@lvrn.visible = false 
end 
lvrn_start
end 
alias lvrn_term terminate
def terminate
lvrn_term
@lvrn.dispose
end
alias lvrn_upd update
def update
lvrn_upd 
$game_system.lvrn_x = @lvrn.x
$game_system.lvrn_y = @lvrn.y
if $game_switches[LevelRange::SWITCH_LEVELRANGE_OFF] == true or $game_system.fadetm <= 0
@lvrn.visible = false
else
@lvrn.visible = true
end
if LevelRange::LVWPOS == 0 or LevelRange::LVWPOS == 1
if @lvrn.x < -50
@lvrn.x += 5
elsif @lvrn.x >= -50
@lvrn.x = -50
end  
else
if @lvrn.x > 400
@lvrn.x -= 5
elsif @lvrn.x <= 400
@lvrn.x = 400
end    
end
@lvrn.contents_opacity = $game_system.fadetm
if LevelRange::LVFADE == true
$game_system.fadetm -= 3
end
end
alias lvrn_upd_trans_player update_transfer_player
def update_transfer_player
return unless $game_player.transfer?
@lvrn.contents_opacity = 0
lvrn_upd_trans_player
if LevelRange::LVWPOS == 0
$game_system.lvrn_x = -340
$game_system.lvrn_y = 48
elsif LevelRange::LVWPOS == 1
$game_system.lvrn_x = -340
$game_system.lvrn_y = 320
elsif LevelRange::LVWPOS == 2
$game_system.lvrn_x = 640
$game_system.lvrn_y = 48
else
$game_system.lvrn_x = 640
$game_system.lvrn_y = 320
end 
@lvrn.y = $game_system.lvrn_y
@lvrn.x = $game_system.lvrn_x
$game_system.fadetm = 255 + 60 * LevelRange::LVFADETIME
@lvrn.refresh
end
end

이상 루시페르였습니다!

Comment '5'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 3 습작 2012.12.24 5398
637 기타 Gamepad Extender VX 습작 2015.01.02 672
636 버그픽스 DerVVulfman's Tileset Reader VX Bug Fix 습작 2014.11.16 699
635 아이템 현재있는 파티원 선택 레벨업 아이템 만들기 1 file 싸패 2016.06.06 713
634 메뉴 Etude87_Ace_Style_Formation_Change ver.1.01 습작 2014.10.05 758
633 저장 세이브 파일 개수 16개로 늘리기 (기본 세이브 엔진용) 1 file Bunny_Boy 2015.09.07 815
632 ??? 1 Man... 2008.10.27 1020
631 버그픽스 Graphical Object Global Reference VX by Mithran Alkaid 2014.03.03 1026
630 키입력 No F1, F12 and Alt+Return (Kein F1, F12 und Alt+Eingabe) by cremno 습작 2013.04.19 1046
629 메시지 Etude87 Dialogue History Scene file 습작 2014.07.07 1069
628 메뉴 KGC - 커스텀 메뉴 커멘드 (번역) 1 듀란테 2015.07.27 1077
627 ??(다 영어)여기서 부터 드레그만 빼고 Man... 2008.10.27 1078
626 Scene_Credit script Plug & Play 1 Man... 2008.10.27 1085
625 Multi-threader snippet by Omegazion Man... 2008.10.28 1107
624 메뉴 MOG - Scroll Bar for VX file 습작 2014.07.06 1115
623 Screen Shortcut Script Man... 2008.10.27 1142
622 LevelMe v1.2 3 Man... 2008.10.27 1154
621 Screen Resolution 3 Man... 2008.10.28 1171
620 키입력 Key Simulator by Fantasist 습작 2013.05.01 1176
619 MAX Level Limitation System 3 Man... 2008.10.28 1198
618 Simple Fon Chage 3 Man... 2008.10.28 1212
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