질문과 답변

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 12447
기타 RMMV 아이템 제한 질문 4 BMsoft 2020.12.06 208
기타 RMVXA VX ACE 캐릭터 그래픽 도트 질문 1 file Fillips 2020.12.07 239
기타 RMMV 알만툴로 포인트 앤 클릭 방식 게임을 만들기는 어렵나요? 4 폴트 2020.12.13 677
기타 RMMV 천지창조 오버월드처럼 게임 오버월드 맵을 표현하고 싶습니다. 7 file 레기우스州 2020.12.18 153
기타 RMMV 음원을 ogg,m4a 파일로 변형하고싶습니다. 4 회늑 2020.12.21 131
기타 RMMV 파이널판타지15나 파판7리메이크처럼 전투시스템을 구축하려 하는데 도움을 주셨으면 합니다. 2 레기우스州 2020.12.24 77
기타 RMMV 1280*720 사이즈에 맞는 맵 사이즈 1 멮쟝 2021.01.07 251
기타 RMMV 이미지를 불러올 때마다 메모리가 쌓입니다 1 아루미 2021.01.28 128
기타 RMVXA VX ACE)특정 상태이상을 중첩시키는 방법 게임이만들고파 2021.01.17 225
기타 RMVXA vx ace) (급합니다....부디 도움을...) 알만툴 내 기본 설정 관련 질문 2 게임이만들고파 2021.01.25 113
기타 RMVXA 화면 사이즈를 800X600으로 수정후 동영상을 플레이했는데 옆으로 치우치네요 2 선인장해마 2021.01.26 94
기타 RMMV 타이틀, 메뉴의 이름을 마음대로 바꿀 수 있나요? 2 아루미 2021.01.27 304
기타 RMVXA 압축된 파일 툴 분해하는법이 있나요 겜만들고싶다앙 2021.01.30 87
기타 RMMZ 현실 시간에 맞춘 이벤트에 관하여 2 레기우스州 2021.02.22 138
기타 RMVXA 주인공을 파티 1번째 멤버로 고정시키고 싶습니다. 5 Arfish 2021.01.30 216
기타 RMMZ 1번째 멤버가 누군지에 따라 이벤트의 이미지가 바뀌게 하는 방법이 있을까요? 2 레기우스州 2021.02.10 105
기타 RMMV webm 동영상은 투명배경이 안되나요? hurakan 2021.02.18 430
기타 RMVXA 최대 스킬 수를 제한할 수 있습니까? Arfish 2021.03.18 63
기타 RMVXA 메뉴의 hp 게이지를 삭제하고 싶습니다 1 file 은예림 2021.03.27 126
기타 RMMZ 알만툴 mz에서 캐릭터 제작툴에있는 여러 옷이나 머리모양의 종류들을 어떻게 추가하는지 알고싶습니다 1 file 라인_ 2021.04.12 637
Board Pagination Prev 1 ... 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 ... 83 Next
/ 83