Xemnas Posted December 18, 2009 Share Posted December 18, 2009 Anche io ci sono passato quanto volte avreste voluto usare una torcia per fare luce solo su un determinato evento... beh ora si puo'...Giochi di luceAutore=KylockIstruzioni per l'uso:copia sotto Materials #============================================================= ================= # ¦ 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 Copiare l'allegato dentro la cartella picture.:(Se è chiamato in modo differente chiamatelo "le")Per attivare lo script basta seguire questa immagine d'esempio:http://img686.imageshack.us/img686/5012/15858791.th.pngBugs e conflitti noti:Nessuno per ora...spero di aver rispettato il TemplateA prestoXemnas Cliccate sullo spoiler per vedere la mia firma...^_^: http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gifVenite a trovarmi nel mio nuovo Sito:The Word of the New Game Ecco la Mia firma fatta da me!!!:http://img11.imageshack.us/img11/1676/firmaol.png Ecco il Banner del mio sito!http://searchfile.altervista.org/Immagini/Bannepng.png http://img692.imageshack.us/img692/1655/pywrightsyte.gifBasnners by Me^_^ Link to comment Share on other sites More sharing options...
lesien Posted December 21, 2009 Share Posted December 21, 2009 ciao scusami ho una domanda, ma si puo ingrandire la luce? se si puo, devo modificare lo script o devo ingrandire solo l'img della luce "le" ?? a ki mi risponde lo ringrazio e gli auguro un buon natale e buon anno nuovo Cammino sull’orlo del baratro come senon mi importasse più niente di mesuccede, a volte capita come secome se mi importasse soltanto di chiudere Link to comment Share on other sites More sharing options...
Xemnas Posted December 21, 2009 Author Share Posted December 21, 2009 (edited) ciao scusami ho una domanda, ma si puo ingrandire la luce? se si puo, devo modificare lo script o devo ingrandire solo l'img della luce "le" ?? a ki mi risponde lo ringrazio e gli auguro un buon natale e buon anno nuovo editato il primo post ho aggiunto una demo dove vengono descritti tutti il comandi DELLO SCRIT (Poichè non esiste solo LIGHT come comando...)è stato un mio grave errore non postare altri comandi...Dalle 20:00 di questa sera sarà disponibile (Problemi con l'host.....) Edited December 21, 2009 by Xemnas Cliccate sullo spoiler per vedere la mia firma...^_^: http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gifVenite a trovarmi nel mio nuovo Sito:The Word of the New Game Ecco la Mia firma fatta da me!!!:http://img11.imageshack.us/img11/1676/firmaol.png Ecco il Banner del mio sito!http://searchfile.altervista.org/Immagini/Bannepng.png http://img692.imageshack.us/img692/1655/pywrightsyte.gifBasnners by Me^_^ Link to comment Share on other sites More sharing options...
lesien Posted December 21, 2009 Share Posted December 21, 2009 editato il primo post ho aggiunto una demo dove vengono descritti tutti il comandi DELLO SCRIT (Poichè non esiste solo LIGHT come comando...)è stato un mio grave errore non postare altri comandi...Dalle 20:00 di questa sera sarà disponibile (Problemi con l'host.....) grazie mille! mi sei stato utilissimo ok allora ripasso questa sera per la demo ciaoo! Cammino sull’orlo del baratro come senon mi importasse più niente di mesuccede, a volte capita come secome se mi importasse soltanto di chiudere Link to comment Share on other sites More sharing options...
Xemnas Posted December 21, 2009 Author Share Posted December 21, 2009 Ecco la demo...Cliccate Quì per scaricarla P.S.=Scusate per il ritardo Megaupload non ne voleva sapere proprio di hostarmi il file.Fatemi sapere se vi piace.....P.P.S.= per un piccolissimo problema nopn si possono spegenere i comandi (Torch, Torch2) Cerchero' di risolverlo il più presto possibile..... Ciao a tutti!^^ Xemnas Cliccate sullo spoiler per vedere la mia firma...^_^: http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gifVenite a trovarmi nel mio nuovo Sito:The Word of the New Game Ecco la Mia firma fatta da me!!!:http://img11.imageshack.us/img11/1676/firmaol.png Ecco il Banner del mio sito!http://searchfile.altervista.org/Immagini/Bannepng.png http://img692.imageshack.us/img692/1655/pywrightsyte.gifBasnners by Me^_^ Link to comment Share on other sites More sharing options...
lesien Posted December 21, 2009 Share Posted December 21, 2009 Ecco la demo...Cliccate Quì per scaricarla P.S.=Scusate per il ritardo Megaupload non ne voleva sapere proprio di hostarmi il file.Fatemi sapere se vi piace.....P.P.S.= per un piccolissimo problema nopn si possono spegenere i comandi (Torch, Torch2) Cerchero' di risolverlo il più presto possibile..... Ciao a tutti!^^ Xemnas A me piace! cercavo giusto il tipo di luce come LIGHT2 e FIRE!Di nuovo grazie hai centrato in pieno cosa cercavo! Cammino sull’orlo del baratro come senon mi importasse più niente di mesuccede, a volte capita come secome se mi importasse soltanto di chiudere Link to comment Share on other sites More sharing options...
Xemnas Posted December 22, 2009 Author Share Posted December 22, 2009 A me piace! cercavo giusto il tipo di luce come LIGHT2 e FIRE!Di nuovo grazie hai centrato in pieno cosa cercavo! Di niente sono felice di aver aiutato qualcuno! Ciao a tutti... Xemnas Cliccate sullo spoiler per vedere la mia firma...^_^: http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gifVenite a trovarmi nel mio nuovo Sito:The Word of the New Game Ecco la Mia firma fatta da me!!!:http://img11.imageshack.us/img11/1676/firmaol.png Ecco il Banner del mio sito!http://searchfile.altervista.org/Immagini/Bannepng.png http://img692.imageshack.us/img692/1655/pywrightsyte.gifBasnners by Me^_^ Link to comment Share on other sites More sharing options...
Xemnas Posted January 15, 2010 Author Share Posted January 15, 2010 Ho una bella n ovit? per chiunque voleva utilizzare iquesto script finalmente si possono "spegnere tutte le luci basta seguire questo semplice procedimento^_^:andate alla linea 139 e sostituite questo: 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 Con questo^_^ def update_light_effects if $game_switches[1] for effect in @light_effects next if effect.type == "" || effect.type == "" effect.light.visible = false end else for effect in @light_effects next if effect.type == "" || effect.type == "" effect.light.visible = true spero di esservi stato d'aiuto....a presto....Xemnas Cliccate sullo spoiler per vedere la mia firma...^_^: http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gifVenite a trovarmi nel mio nuovo Sito:The Word of the New Game Ecco la Mia firma fatta da me!!!:http://img11.imageshack.us/img11/1676/firmaol.png Ecco il Banner del mio sito!http://searchfile.altervista.org/Immagini/Bannepng.png http://img692.imageshack.us/img692/1655/pywrightsyte.gifBasnners by Me^_^ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now