Bonsoir, j'ai cherché dans le script un petit peu et comme j'avai peur d'endomager le scipt
je n'est rien voulu toucher. Le voici:
#==============================================================================
# AUTOLIGHT 1.3.1 UNOFFICIAL PORTING VX ACE
# 12.27.2008
#------------------------------------------------------------------------------
# SCRIPT BY: Kylock
# PORTING BY: I don't want to be credited.
#
#==============================================================================
# INSTRUCTIONS
#
# Remember, you must have the file "le.png" in your "Graphics\Pictures" folder!
# If you're missing the file follow this link:
# http://imageshack.us/photo/my-images/189/81598086.png/
#
# To make an event glow, choose the desired event and comment with the applied
# term. If you want Light 1, comment "LIGHT 1".
#==============================================================================
# ? Change Log
#------------------------------------------------------------------------------
# 1.0 - Original Release
# 1.1 - New light modes added: LIGHT2, TORCHLIT 1, TORCHLIT 2
# - Changed sprite blend mode to ADD
# - Fire-based lights are now red in color
# 1.2 - Bug fixed with looping maps and lights displaying above message boxes
# 1.3 - More bugfixes
#==============================================================================
# ? Light Modes
#------------------------------------------------------------------------------
#LIGHT 1 - Lumière blanche régulière. (Petit)
#FIREPIT - Scintillement.
#LIGHT 2 - Lumière blanche régulière. (Grand)
#LIGHT 3 - Lumière blanche régulière.
#TORCHLIT 1 - Scintillement. (Lourd)
#TORCHLIT 2 - Scintillement. (Lumière)
#==============================================================================
module LES
#The switch used to turn lights ON/OFF
#If the Switch is ON the lights turn OFF
#If the Switch is OFF the lights turn ON
SWITCH = 30
end
#==============================================================================
# ■ Spriteset_Map
#==============================================================================
class Spriteset_Map
alias les_spriteset_map_initalize initialize
def initialize
initialize_effects
les_spriteset_map_initalize
update
end
def initialize_effects
@light_effects = []
setup_lights
end
alias les_spriteset_map_dispose dispose
def dispose
les_spriteset_map_dispose
dispose_effects
end
def dispose_effects
for effect in @light_effects
effect.light.dispose
end
@light_effects = []
end
alias les_spriteset_map_update update
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.code == 108 and event.list.parameters == ["LIGHT 1"]
type = "LIGHT 1"
light_effects = Light_Effect.new(event,type)
light_effects.light.zoom_x = 2
light_effects.light.zoom_y = 2
light_effects.light.opacity = 100
@light_effects.push(light_effects)
end
if event.list.code == 108 and event.list.parameters == ["FIREPIT"]
type = "FIREPIT"
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.code == 108 and event.list.parameters == ["LIGHT 2"]
type = "LIGHT 2"
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.code == 108 and event.list.parameters == ["LIGHT 3"]
type = "LIGHT 3"
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.code == 108 and event.list.parameters == ["TORCHLIT 1"]
type = "TORCHLIT 1"
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.code == 108 and event.list.parameters == ["TORCHLIT 2"]
type = "TORCHLIT 2"
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 "LIGHT 1"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
effect.light.blend_type = 1
when "FIREPIT"
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 2"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
effect.light.blend_type = 1
when "LIGHT 3"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
effect.light.blend_type = 1
when "TORCHLIT 1"
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 "TORCHLIT 2"
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 setup_lights
def update_light_effects
if $game_switches[LES::SWITCH]
for effect in @light_effects
effect.light.visible = false
end
else
for effect in @light_effects
effect.light.visible = true
end
end
for effect in @light_effects
case effect.type
when "LIGHT 1"
effect.light.x = effect.event.screen_x - 64
effect.light.y = effect.event.screen_y - 86
when "FIREPIT"
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 2"
effect.light.x = effect.event.screen_x - 32
effect.light.y = effect.event.screen_y - 54
when "LIGHT 3"
effect.light.x = effect.event.screen_x - 182 - 20
effect.light.y = effect.event.screen_y - 214
when "TORCHLIT 1"
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 "TORCHLIT 2"
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 #def update_light_effects
end #class Spriteset_Map
#==============================================================================
# ■ Light_Effect
#==============================================================================
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 #class Light_Effect
#==============================================================================
# ■ Scene_Map
#==============================================================================
class Scene_Map
alias les_pre_transfer pre_transfer
def pre_transfer
les_pre_transfer
@spriteset.dispose_effects
end
alias les_post_transfer post_transfer
def post_transfer
@spriteset.initialize_effects
les_post_transfer
end
end #Scene_Map
#==============================================================================
# END OF FILE
#==============================================================================
Après avoir essayer de comprendre ce charabia j'ai trouver le problème A la ligne 41 Il est écrit SWITH= 30 ce qui signifie qu'a la switch 30 les lumière s'éteignent. Alors j'ai remplacer le nombre par 99 et nikel sa fonctionne ! Maintenant la questions est peut on aller a plus de 99 ? :/
|