#1 Inviato 21 May 2012 - 09:53 AM
Ho controllato tutto: il file "le.png" è regolarmente presente nella cartella pictures, l'evento dovrebbe essere settato nel modo giusto (l'ho settato a "Parallel Process" così dovrebbe avviarsi da solo) con il commento "LIGHT" ma la luce non appare. Qualcuno sa come risolvere? Grazie.
#2 Inviato 21 May 2012 - 10:35 AM
Hai seguito per bene le istruzioni dello script?
Modificato da Dilos, 21 May 2012 - 10:35 AM.
#3 Inviato 21 May 2012 - 10:56 AM
#5 Inviato 21 May 2012 - 11:56 AM
(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
disponibile su Google Play, qui i dettagli! ^ ^
completo! Giocabile online, qui i dettagli! ^ ^
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^
#6 Inviato 21 May 2012 - 15:00 PM
Ecco lo script, premetto che non uso il KGC day/night quindi come tolgo il legame col Thomas Edison?
=begin Thomas Edison VX Version: 0.1 Author: BulletXt ([email protected]) Date: 12/06/2009 Script based upon Kylock's (http://www.rpgmakervx.net/index.php?showtopic=2432) Description: To make an event glow, put a Comment inside event with one of the following light modes. When importing this script to a new project, be sure to copy Graphics/Pictures/le.png to your project. Light Modes: GROUND - Medium steady white light. GROUND2 - Medium white light with slight flicker. GROUND3 - Small steady red light. GROUND4 - Medium steady green light. GROUND5 - Medium steady blu light. FIRE - Large red light with a slight flicker. LIGHT - Small steady white light. LIGHT2 - X-Large steady white light. LIGHT3 - Small white light with slight flicker. TORCH - X-Large red light with a heavy flicker. TORCH2 - X-Large red light with a sleight flicker. TORCH3 - Large white light with a slight flicker. You can make a specific light type turn off/on by turning one of the following switches id ON/off. By default, the switches are off so the lights will show. Of course, turning all switches to ON will make all light types go off. =end #id switch that if ON turns off FIRE mode lights #applies only to light mode: FIRE FIRE = 87 #id switch that if ON turns off LIGHT mode lights #applies to light mode: LIGHT, LIGHT2, LIGHT3 LIGHT = 86 #id switch that if ON turns off GROUND mode lights #applies to light mode: GROUND, GROUND2, GROUND3, GROUND4, GROUND5 GROUND = 85 #id switch that if ON turns off TORCH mode lights #applies to light mode: TORCH, TORCH2, TORCH3 TORCH = 84 # this value can be true or false. If true, it enables compatibility with # KGC_DayNight script. When it's night, lights will automatically go on, when # morning comes back lights will go off. If you set this to true, be sure to # place this script below KGC_DayNight script in the Scripting Editor of VX. ENABLE_KGC_DAY_NIGHT_SCRIPT = true =begin This value must be exactly the same of "PHASE_VARIABLE" setting in KGC_DayNight script. By default the script sets it to 11. To make the event light go on/off with DayNight system, set the event page to be triggered with this variable id and set it to be 1 or above. =end KGC_DAY_NIGHT_SCRIPT_VARIABLE = 11 =begin Tips and tricks: You can't make a single specific light inside event go on/off if a condition applies, for example if a switch is ON. For the moment, you can achieve this by doing a script call immediatley after you make the condition apply. If for example the light event must go on if switch 100 is ON, after you turn on the switch do this call script: $scene = Scene_Map.new Be aware that doing this call script will make game freeze for 30 milliseconds. ################################################################################ =end $bulletxt_day_check = 0 class Spriteset_Map alias bulletxt_spriteset_map_initalize initialize def initialize @light_effects = [] initialize_lights bulletxt_spriteset_map_initalize update end alias bulletxt_spriteset_map_dispose dispose def dispose bulletxt_spriteset_map_dispose for effect in @light_effects effect.light.dispose end @light_effects = [] end alias bulletxt_spriteset_map_update update def update bulletxt_spriteset_map_update check_day_night if ENABLE_KGC_DAY_NIGHT_SCRIPT update_light_effects end def check_day_night #if night if $bulletxt_day_check == 0 if $game_variables[KGC_DAY_NIGHT_SCRIPT_VARIABLE] == 1 $scene = Scene_Map.new $bulletxt_day_check = 1 end else #if morning if $game_variables[KGC_DAY_NIGHT_SCRIPT_VARIABLE] == 3 $game_variables[KGC_DAY_NIGHT_SCRIPT_VARIABLE] = -1 $scene = Scene_Map.new $bulletxt_day_check = 0 end end end def initialize_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 == ["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 == ["LIGHT3"] type = "LIGHT3" 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 == ["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 if event.list[i].code == 108 and event.list[i].parameters == ["TORCH3"] type = "TORCH3" 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 == ["GROUND"] type = "GROUND" 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[i].code == 108 and event.list[i].parameters == ["GROUND2"] type = "GROUND2" 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[i].code == 108 and event.list[i].parameters == ["GROUND3"] type = "GROUND3" 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[i].code == 108 and event.list[i].parameters == ["GROUND4"] type = "GROUND4" 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[i].code == 108 and event.list[i].parameters == ["GROUND5"] type = "GROUND5" 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 end end for effect in @light_effects case effect.type when "FIRE" effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3 effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3 effect.light.tone = Tone.new(255,-100,-255, 0) effect.light.blend_type = 1 when "LIGHT" effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15 effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15 effect.light.blend_type = 1 when "LIGHT2" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 effect.light.blend_type = 1 when "LIGHT3" effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15 effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15 effect.light.blend_type = 1 when "TORCH" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 effect.light.tone = Tone.new(255,-100,-255, 0) effect.light.blend_type = 1 when "TORCH2" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 effect.light.tone = Tone.new(255,-100,-255, 0) effect.light.blend_type = 1 when "TORCH3" effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3 effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3 effect.light.blend_type = 1 when "GROUND" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.blend_type = 1 when "GROUND2" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.blend_type = 1 when "GROUND3" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.tone = Tone.new(255,-255,-255, 255) effect.light.blend_type = 1 when "GROUND4" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.tone = Tone.new(-255,255,-255, 100) effect.light.blend_type = 1 when "GROUND5" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.tone = Tone.new(-255,255,255, 100) effect.light.blend_type = 1 end end end def update_light_effects ################################################################################ # handle FIRE if $game_switches[FIRE] for effect in @light_effects next if effect.type != "FIRE" effect.light.visible = false end else for effect in @light_effects next if effect.type != "FIRE" effect.light.visible = true end end # handle LIGHT if $game_switches[LIGHT] for effect in @light_effects next if effect.type != "LIGHT" && effect.type != "LIGHT2" && effect.type != "LIGHT3" effect.light.visible = false end else for effect in @light_effects next if effect.type != "LIGHT" && effect.type != "LIGHT2" && effect.type != "LIGHT3" effect.light.visible = true end end # handle GROUND if $game_switches[GROUND] for effect in @light_effects next if effect.type != "GROUND" && effect.type != "GROUND2" && effect.type != "GROUND3" && effect.type != "GROUND4" && effect.type != "GROUND5" effect.light.visible = false end else for effect in @light_effects next if effect.type != "GROUND" && effect.type != "GROUND2" && effect.type != "GROUND3" && effect.type != "GROUND4" && effect.type != "GROUND5" effect.light.visible = true end end # handle TORCH if $game_switches[TORCH] for effect in @light_effects next if effect.type != "TORCH" && effect.type != "TORCH2" && effect.type != "TORCH3" effect.light.visible = false end else for effect in @light_effects next if effect.type != "TORCH" && effect.type != "TORCH2" && effect.type != "TORCH3" effect.light.visible = true end end ################################################################################ for effect in @light_effects case effect.type when "FIRE" effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3 effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3 effect.light.opacity = rand(10) + 90 when "LIGHT" effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15 effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15 when "LIGHT2" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 when "LIGHT3" effect.light.x = (-0.25 / 2 * $game_map.display_x) + (effect.event.x * 32) - 15 effect.light.y = (-0.25 / 2 * $game_map.display_y) + (effect.event.y * 32) - 15 effect.light.opacity = rand(10) + 90 when "TORCH" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 + rand(20) - 10 effect.light.opacity = rand(30) + 70 when "TORCH2" effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 effect.light.y = (effect.event.real_y - 1200 - $game_map.display_y) / 8 effect.light.opacity = rand(10) + 90 when "TORCH3" effect.light.x = (effect.event.real_x - 600 - $game_map.display_x) / 8 + rand(6) - 3 effect.light.y = (effect.event.real_y - 600 - $game_map.display_y) / 8 + rand(6) - 3 effect.light.opacity = rand(10) + 90 when "GROUND" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 when "GROUND2" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 effect.light.opacity = rand(10) + 90 when "GROUND3" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 when "GROUND4" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 when "GROUND5" effect.light.x = (effect.event.real_x - 400 - $game_map.display_x) / 8 effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8 end end #close def end #close class 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 = 1000 @event = event @type = type end end
#7 Inviato 21 May 2012 - 15:46 PM
In testa allo script modifica: ENABLE_KGC_DAY_NIGHT_SCRIPT = false
e assicurati che lo switch 86 sia OFF.
Ricordati di inserire il codice dentro il tag SPOILER.
#8 Inviato 21 May 2012 - 17:47 PM
Dov'è il tag Spoiler? Nell'editor non c'è
Ho implementato il Lights Effects di Kylock.
#============================================================================== # ■ 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 = 2 light_effects.light.zoom_y = 2 light_effects.light.opacity = 100 @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[1] 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
Solo che dice "per usarlo basta creare un evento e metterci il commento (LIGHT, FIRE, ecc...)", ma la luce continua a non vedersi. Bah, non so che fare. :V
EDIT:
Sono riuscito ad implementarlo correttamente ma ora il problema è un altro: vorrei fare in modo da poter spegnere e accendere le luci in tempo reale, il che significherebbe settare lo switch tramite un "call script" come dice kylock in questa parte.
Both scripts work together without errors. The script uses switch 1 to determine weather or not to use the lights. A neat trick it to change line 141 from:
CODE
if $game_switches[1]
to:
CODE
if !$game_switches[1]
All that's added here is a !, but what this will do is turn all your lights off when it's not nighttime, as long as you kept the default switch for night to switch 1.
Ora come si fa a fare questo procedimento in tempo reale?
Modificato da lzol, 21 May 2012 - 18:04 PM.
#9 Inviato 21 May 2012 - 17:56 PM
Intendevo il tag spoiler del forum per il codice:
#10 Inviato 21 May 2012 - 18:43 PM
(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
disponibile su Google Play, qui i dettagli! ^ ^
completo! Giocabile online, qui i dettagli! ^ ^
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^
#11 Inviato 22 May 2012 - 00:12 AM
Intendevo il tag spoiler del forum per il codice
Siii, clyde ne ha sbagliata una! Oppure si può utilizzare lo schema [ spoiler]PIZZA[ /spoiler], senza spazi ovviamente.E penso che lui intendesse l'editor dei messaggi! XD Se così è... terza icona special BB Code! ^ ^
Comunque, quoto, abbiamo bisogno dell' elenco completo (meglio il progetto), così capiamo dove sta precisamente l' errore.
Non ho ben capito il "procedimento in tempo reale"...in quella citazione l' autore dice di aggiungere il punto esclamativo a quel codice nello script...non vedo call script...hai provato così?
Modificato da Dilos, 22 May 2012 - 00:13 AM.
#12 Inviato 22 May 2012 - 08:15 AM
#13 Inviato 22 May 2012 - 09:07 AM
Comunque, da quello che leggo nel tuo codice, lo switch di riferimento è lo switch 1. Se lo switch 1 è ON le luci si spengono. Purtroppo suppongo che si presenti l'errore individuato a suo tempo da BulletXt, e cioè che le luci vengono aggiornate solo quando spriteset viene aggiornato. L'espediente suggerito da BulletXt è quello di chiamare tramite Call Script $scene = Scene_Map.new per aggiornare la mappa, lo spriteset, e di conseguenza le luci. Questo metodo funziona, ma causa un breve momento di freeze nella grafica.
In sintesti, nel momento in cui tramite comando evento imposti la switch 1 ON aggiungi subito dopo il Call Script $scene = Scene_Map.new.
Modificato da clyde, 22 May 2012 - 19:56 PM.
#14 Inviato 22 May 2012 - 12:51 PM
Questo pezzo dell'Edison sembra altamente inefficiente, vengono eseguiti update degli effects per ogni switch di categoria . . . Credo che sarebbe meglio sostituirlo con un solo ciclo di tutti gli effetti con next per ogni accoppiata "switch & effect" . . .
EDIT - Rewrite del Thomas Edison VX - Non Testata - Ma se funziona, le prestazioni miglioreranno di parecchio . . .
Modificato da giver, 01 June 2012 - 04:20 AM.
#15 Inviato 22 May 2012 - 13:30 PM
^ ^
(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
disponibile su Google Play, qui i dettagli! ^ ^
completo! Giocabile online, qui i dettagli! ^ ^
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^
#16 Inviato 22 May 2012 - 13:52 PM
#17 Inviato 22 May 2012 - 13:57 PM
Eliminare quel pezzo e sostituirlo con questo . . .
def update_light_effects ################################################################################ swc_fire = !$game_switches[FIRE] swc_light = !$game_switches[LIGHT] swc_ground = !$game_switches[GROUND] scw_torch = !$game_switches[TORCH] for effect in @light_effects effect.light.visible = (effect.type == "FIRE" && swc_fire) or (swc_light && (effect.type == "LIGHT" or effect.type == "LIGHT2" or effect.type == "LIGHT3")) or (scw_ground && (effect.type == "GROUND" or effect.type == "GROUND2" or effect.type == "GROUND3" or effect.type == "GROUND4" or effect.type == "GROUND5")) or (swc_torch && (effect.type == "TORCH" or effect.type == "TORCH2" or effect.type == "TORCH3")) end
Naturalmente sarebbe meglio ancora creare dei filtri specifici per categoria, mantenendo gli switch, o uno solo aggiornabile tramite (call) script, ed eliminare gli switch . . .
@clyde: Li ho letti, ma è più forte di me . . . Comunque lo è sì "migliore", in quanto basta vedere che il mio esegue un solo ciclo, mentre l'originale scorre la lista degli effetti per ogni categoria di effetto, quindi ben 4 volte, passando da altrettanti if-else . . .
EDIT - Avevo lasciato un != al posto di un ==, EDIT2 - ed un end di troppo, mi sa . . .
Modificato da giver, 22 May 2012 - 16:11 PM.
#18 Inviato 22 May 2012 - 14:02 PM
Non ho capito la questione scarto, ma va beh... sembra abbastanza risolutivo come topic! XD
^ ^
(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)
Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^
disponibile su Google Play, qui i dettagli! ^ ^
completo! Giocabile online, qui i dettagli! ^ ^
REVERIE : : RENDEZVOUS (In allenamento per apprendere le buone arti prima di cominciarlo per bene ^ ^) Trovate i dettagli qui insieme alla mia intervista (non utilizzerò più rpgmaker) ^ ^
#19 Inviato 22 May 2012 - 15:12 PM
#20 Inviato 22 May 2012 - 16:23 PM
Se switch della categoria è ON spegni questi effetti, altrimenti accendili, scorrendo l'intera lista di effetti . . . E per vedere quali effetti vanno accesi o spenti, next se effect.type è in elenco appropriato, ossia i controlli fatti da me, solo separati tra le categorie, quindi altre 4 if, contro la mia singola . . .. . . Comunque lo è sì "migliore", in quanto basta vedere che il mio esegue un solo ciclo, mentre l'originale scorre la lista degli effetti per ogni categoria di effetto, quindi ben 4 volte, passando da altrettanti if-else . . .
Ed ho segnalato altri modi per rendere il codice ancora più efficace . . .
Quel codice l'ho creato al volo, modificando alla buona quello otiginale, anche perchè mi sembra inutile perderci troppo tempo per soluzioni più efficaci ma lunghe da ri-scrivere, visto che, come hai detto tu, si è scelta un'altra strada . . .
Modificato da giver, 22 May 2012 - 16:33 PM.