Jump to content
Rpg²S Forum

tHE DARKNESS AND THE LIGHT


Xemnas
 Share

Recommended Posts

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 luce

Autore=Kylock
Istruzioni 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.:
post-3668-1261167678.png
(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.png


Bugs e conflitti noti:
Nessuno per ora...

spero di aver rispettato il Template
A presto

Xemnas :tongue:

Cliccate sullo spoiler per vedere la mia firma...^_^:

 

 

 

 

http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gif

Venite 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.gif

Basnners by Me^_^

 

 

Link to comment
Share on other sites

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 :wink: :wink:

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

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 :wink: :wink:

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 by Xemnas

Cliccate sullo spoiler per vedere la mia firma...^_^:

 

 

 

 

http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gif

Venite 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.gif

Basnners by Me^_^

 

 

Link to comment
Share on other sites

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 :wink:

 

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

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

:wink:

Cliccate sullo spoiler per vedere la mia firma...^_^:

 

 

 

 

http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gif

Venite 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.gif

Basnners by Me^_^

 

 

Link to comment
Share on other sites

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

:wink:

 

 

A me piace! cercavo giusto il tipo di luce come LIGHT2 e FIRE!

Di nuovo grazie hai centrato in pieno cosa cercavo! :wink:

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

A me piace! cercavo giusto il tipo di luce come LIGHT2 e FIRE!

Di nuovo grazie hai centrato in pieno cosa cercavo! :wink:

Di niente sono felice di aver aiutato qualcuno!

 

 

 

 

Ciao a tutti...

Xemnas

:wink:

Cliccate sullo spoiler per vedere la mia firma...^_^:

 

 

 

 

http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gif

Venite 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.gif

Basnners by Me^_^

 

 

Link to comment
Share on other sites

  • 4 weeks later...

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 :tongue:

Cliccate sullo spoiler per vedere la mia firma...^_^:

 

 

 

 

http://i84.servimg.com/u/f84/14/44/79/04/graffi11.gif

Venite 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.gif

Basnners by Me^_^

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...