질문과 답변

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 12444
RMVXA 캐릭터 전용 장비(무기, 방어구) 시스템을 추가하고 싶습니다. 겜맨602 2017.05.08 117
RMVX 자신이 버튼으로 조사한 이벤트만 작동시키게 못 하나요? 스크립트 같은 방법도 좋은데요 14 file 후라이팬샷 2017.02.15 117
RMXP rpgxp로 만든 게임을 네코로 돌리고 싶은데... 호리바리 2017.01.02 117
RMMV 이 플러그인 써보신분? 1 잠행인 2016.10.08 117
RMVXA BGM 관련 질문입니다. 2 천지설화 2016.09.21 117
RMVXA 상태이상을 걸 때 1 l유리눈물l 2016.07.28 117
RMVXA 주석 'Light'를 지우고 싶어요! file 뉴리키 2015.11.01 117
RMVXA 레벨을 올리는 이벤트 깡쨩 2015.09.02 117
RMVXA 무기 상성 설정 Lycious 2015.02.17 117
에러 해결 RMVX VX 스크립트 사용 중 에러가 났습니다.... 1 file CatoN 2019.03.20 117
RMVXA 알만툴 실행 캐릭터 문장 오류 file 모카라떼카푸치노 2018.02.20 117
기타 이미지적용하는 방법 1 듀잉 2016.02.24 117
RMVXA 점프 시 그래픽을 바꿀 수 있을까요? 게임만듭니다 2018.03.14 117
RMMV 랜덤 버프 부여 관련 질문드립니다. 2 file 엔라스 2018.05.10 117
플러그인 추천 기타 바람 만드는 법 알고 계신 분 계신가요? 2 무명시절 2019.06.29 117
기타 사이트 이용 왜 제가 만든 게임은 다들 아무 말도 안하시나요? 2 샤이르 2023.11.06 117
기타 이미 배포된 게임을 열어보기? 닐니리뽕 2017.11.28 117
기타 유메닛키가 안 켜져요 ㅠㅠ ㅂㄷㅂㄷ 2017.11.28 117
기타 rpg xp, rpg vx의 다운, 실행이 되지 않습니다. 바가베가 2018.04.15 117
기타 RMMV 반격기를 넣고싶습니다. 2 JDG 2020.04.27 117
Board Pagination Prev 1 ... 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 ... 516 Next
/ 516