질문과 답변

Extra Form
#==============================================================================
# ■ Light Effects VX 1.3
# 12.27.2008
#------------------------------------------------------------------------------
# Script by: Kylock (originally for RMXP by Near Fantastica)
# Version 1.3 by Enelvon
#==============================================================================
# To make an event glow, give it a Comment: with any of the supported light
# modes.
# The SWITCH setting below will disable light effects from updating with the
# switch is on.
#==============================================================================
# ● Change Log
#------------------------------------------------------------------------------
# 1.0 - Original Release
# 1.1 - New light modes added: LIGHT2, TORCH, TORCH2
# - Changed sprite blend mode to ADD (looks slightly better)
# - Fire-based lights are now red in color
# 1.2 - Bug fixed with looping maps and lights displaying above messageboxes
# 1.3 - More bugfixes
#==============================================================================
# ● Light Modes
#------------------------------------------------------------------------------
# GROUND - Medium steady white light.
# FIRE - Large red light with a slight flicker.
# LIGHT - Small steady white light.
# LIGHT2 - X-Large steady white light.
# TORCH - X-Large red light with a heavy flicker.
# TORCH2 - X-Large red light with a sleight flicker.
#==============================================================================

class Spriteset_Map
alias les_spriteset_map_initalize initialize
alias les_spriteset_map_dispose dispose
alias les_spriteset_map_update update
def initialize
@light_effects = []
setup_lights
les_spriteset_map_initalize
update
end
def dispose
les_spriteset_map_dispose
for effect in @light_effects
effect.light.dispose
end
@light_effects = []
end
def update
les_spriteset_map_update
update_light_effects
end
def setup_lights
for event in $game_map.events.values
next if event.list == nil
for i in 0...event.list.size
if event.list[i].code == 108 and event.list[i].parameters == ["GROUND"]
type = "GROUND"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 1
light_effects.light.zoom_y = 1
light_effects.light.opacity = 1
@light_effects.push(light_effects)
end
if event.list[i].code == 108 and event.list[i].parameters == ["FIRE"]
type = "FIRE"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 300 / 100.0
light_effects.light.zoom_y = 300 / 100.0
light_effects.light.opacity = 100
@light_effects.push(light_effects)
end
if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT"]
type = "LIGHT"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 1
light_effects.light.zoom_y = 1
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list[i].code == 108 and event.list[i].parameters == ["LIGHT2"]
type = "LIGHT2"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list[i].code == 108 and event.list[i].parameters == ["TORCH"]
type = "TORCH"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
if event.list[i].code == 108 and event.list[i].parameters == ["TORCH2"]
type = "TORCH2"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 6
light_effects.light.zoom_y = 6
light_effects.light.opacity = 150
@light_effects.push(light_effects)
end
end
end
for effect in @light_effects
case effect.type
when "GROUND"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
when "FIRE"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "LIGHT"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
effect.light.blend_type = 1
when "LIGHT2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.blend_type = 1
when "TORCH"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
when "TORCH2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.tone = Tone.new(255,-100,-255, 0)
effect.light.blend_type = 1
end
end
end
def update_light_effects
if $game_switches[200]
for effect in @light_effects
next if effect.type == "FIRE" || effect.type == "TORCH"
effect.light.visible = false
end
else
for effect in @light_effects
next if effect.type == "FIRE" || effect.type == "TORCH"
effect.light.visible = true
end
end
for effect in @light_effects
case effect.type
when "GROUND"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
when "FIRE"
effect.light.x = effect.event.screen_x - 96 + rand(6) - 3
effect.light.y = effect.event.screen_y - 118 + rand(6) - 3
effect.light.opacity = rand(10) + 90
when "LIGHT"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
when "LIGHT2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
when "TORCH"
effect.light.x = effect.event.screen_x - 182 - 20 + rand(20) - 10
effect.light.y = effect.event.screen_y - 214 + rand(20) - 10
effect.light.opacity = rand(30) + 70
when "TORCH2"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.opacity = rand(10) + 90
end
end
end
end

class Light_Effect
attr_accessor :light
attr_accessor :event
attr_accessor :type
def initialize(event, type)
@light = Sprite.new
@light.bitmap = Cache.picture("le.png")
@light.visible = true
@light.z = 190
@event = event
@type = type
end
end


bandicam 2015-11-01 01-12-48-850.jpg


위 스크립과 같이 주석으로 Light를 입력하면

불이 켜지는 건 되는데 꺼지는 게 안되네요...!


다른 스위치를 켜서 저 이벤트를 덮어도 계속 켜져있습니다.. ㄷㄷ


어떤 방법 없을까요?


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12456
RMVXA 메시지창의 크기를 줄이고 싶습니다 2 모니 2014.02.08 705
RMVXA 스크립트 오류 질문입니다. 2 file Evr 2014.02.22 705
RMVXA 이벤트 후 그대로 멈춰버리네요..[수정 : 다른 부분 이벤도 추가] 3 file 읭...내이름이뭐지 2013.04.30 706
RMVXA 스킬 적용범위와 적 그룹 수를 변경... 6 휘휘 2014.01.29 706
RMVXA ace게임이름 2 알피지에엑스피 2013.07.05 707
RMVXA ACE대화창 질문좀요 2 ChamSae 2013.02.21 707
RMVXA 스크립트관련 질문입니다(자동세이브,로드) 7 펭블♡ 2013.01.31 707
RMVXA 인터페이스, 원도우 시스템을 바꿀순 없나요? 5 안안녕 2013.01.26 708
RMVXA 겉의 서계처럼 억지로 끄면 뭐가 뜨도록 하는법 조각조각 2014.07.18 708
RMVXA RMVXA, 캐릭터가 쓰러져 있다가 일어나는 행동은 어떻게 만드나요? 3 대악당 2013.08.17 709
RMVXA 탈것사용중 전투배경 선택을 어떻게 바꿀수있나요? 9 game 光 ㅋㅋ 2013.01.10 709
RMVXA 동영상 에러 4 file 게임잘날아가는닝겐 2014.05.07 709
RMVXA 스탯 포인트 분배 시스템 어떻게 구현합니까?? H3r 2013.08.13 710
RMVXA 테스트창을 확대화 못시키나요? 3 훈봉이 2013.07.27 711
RMVXA 다운받은 소재 사용후 캐릭터의 움직임 멈춤 현상이 일어났습니다. 4 빼리쏭 2013.06.19 711
RMVXA 이벤트 페이지 반복 14 file 안내문 2013.02.18 711
RMVXA 아이템 판매 가격 설정 3 시옷청룡 2013.02.23 714
RMVXA 데이터베이스 오류 6 슘슘슘슘 2014.02.28 715
RMVXA [Vx Ace]게임캐릭터가 죽으면 세이브가 지워지는 스크립트가 있을까요? 1 고등학생니트 2014.03.08 715
RMVXA vocab을 수정해도 전투 도중의 대사가 바뀌지 않습니다 2 아브렐라 2014.08.18 715
Board Pagination Prev 1 ... 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 ... 150 Next
/ 150