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
337 이동 및 탈것 동료가 따라다니게 하는 스크립트 59 file 아방스 2008.01.23 6512
336 전투 돌아가는 전투 메뉴 시스템 33 아방스 2008.08.29 5083
335 아이템 돈 아이템 장비를저장 11 file RPGbooster 2008.10.11 3452
334 기타 데이터베이스 자체 제한 해체 스크립트 [Database Limit Breaker] 13 file 할렘 2009.02.07 3562
» 기타 던전에 적정 레벨이 어떤건지 스크린에 표시해주는 스크립트! 5 file 루시페르 2009.06.06 2907
332 메시지 대화창효과 8 078656577er 2009.10.20 5972
331 이동 및 탈것 대쉬금지의 변경 1 rukan 2009.07.02 1449
330 전투 대미지%MP흡수 스크립트 4 Evangelista 2009.08.31 2279
329 전투 대미지 MP전환 스테이트 : 수정 => 마나쉴드 7 Evangelista 2009.08.29 2384
328 파티 대규모파티 KGC스크립 50 file RPGbooster 2008.10.08 6012
327 이동 및 탈것 대각선 이동 스크립트 17 아방스 2009.05.02 3677
326 키입력 답을 입력하는 텍스트박스 스크립트!! 21 file 좀비사냥꾼 2009.03.29 4206
325 이동 및 탈것 달릴때 그래픽을 바꿔주는 스크립트 12 file 아방스 2008.01.24 4097
324 이동 및 탈것 달리면 스태미너가 감소하는 스크립트 18 file 카르와푸딩의아틀리에 2009.06.30 2869
323 다음 레벨까지의 경험치 강제조정 13 정의로운녀석 2008.07.24 3273
322 다운로드 링크로 가세요.(스크린 샷 올려놨음) 5 Man... 2008.10.27 1618
321 변수/스위치 다른 이벤트 셀프스위치 조작 - xp, vx 사용가능 3 허걱 2009.07.18 2387
320 기타 다른 방식의 테트리스 미니게임 7 file 사람이라면? 2010.08.17 2362
319 기타 능력치에 따른 스테이트변화 / 능력치한계지정 5 Evangelista 2009.05.26 2479
318 이동 및 탈것 느리게 걷기 5 허걱 2009.08.23 2424
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ... 32 Next
/ 32