Jump to content
Rpg²S Forum

*Script effetto luce


the-joker
 Share

Recommended Posts

Create una classe sopra main col nome di Light Effects e inserite questo:
(Per ottenere l'effetto luce, mettere un evento nella mappa che abbia il commento:Light Effects
e il commento Fire.
Poi mettete nella cartella Graphics/Picture questo file chiamandolo LE.png
post-996-1205058046.png

 

 

#================================
# ■ Light Effects
#================================
# By: Near Fantastica
# Date: 28.06.05
# Version: 3
#================================

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 == ["Light Effects"]
					type = event.list[i+1].parameters.to_s
					case type.upcase!
					when "GROUND"
						light_effects = Light_Effect.new(event,type)
						light_effects.light.zoom_x = 200 / 100.0
						light_effects.light.zoom_y = 200 / 100.0
						light_effects.light.opacity = 50
						@light_effects.push(light_effects)
					when "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)
					when "LAMPPOST"
						light_effects = Light_Effect.new(event,"LEFT LAMP POST")
						light_effects.light.opacity = 100
						@light_effects.push(light_effects)
						light_effects = Light_Effect.new(event,"RIGHT LAMP POST")
						light_effects.light.opacity = 100
						@light_effects.push(light_effects)
					when "LEFTLANTERN"
						light_effects = Light_Effect.new(event,type)
						light_effects.light.opacity = 150
						@light_effects.push(light_effects)
					when "RIGHTLANTERN"
						light_effects = Light_Effect.new(event,type)
						light_effects.light.opacity = 150
						@light_effects.push(light_effects)
					end
				end
			end
		end
		for effect in @light_effects
			case effect.type
			when "GROUND"
				effect.light.x = (effect.event.real_x - 200 - $game_map.display_x) / 4
				effect.light.y = (effect.event.real_y - 200 - $game_map.display_y) / 4
			when "FIRE"
				effect.light.x = (effect.event.real_x - 300 - $game_map.display_x) / 4
				effect.light.y = (effect.event.real_y - 300 - $game_map.display_y) / 4
			when "LEFT LAMP POST"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 5
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
			when "RIGHT LAMP POST"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 25
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
			when "LEFTLANTERN"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 20
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
			when "RIGHTLANTERN"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 10
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
			end
		end
	end
	#--------------------------------------------------------------
	def update_light_effects
		for effect in @light_effects
			next if not in_range?(effect.event)
			case effect.type
			when "GROUND"
				effect.light.x = (effect.event.real_x - 200 - $game_map.display_x) / 4
				effect.light.y = (effect.event.real_y - 200 - $game_map.display_y) / 4
			when "FIRE"
				effect.light.x = (effect.event.real_x - 300 - $game_map.display_x) / 4
				effect.light.y = (effect.event.real_y - 300 - $game_map.display_y) / 4
			when "LEFT LAMP POST"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 5
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
			when "RIGHT LAMP POST"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 25
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 15
			when "LEFTLANTERN"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 20
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
			when "RIGHTLANTERN"
				effect.light.x = (-0.25 * $game_map.display_x) + (effect.event.x * 32) - 10
				effect.light.y = (-0.25 * $game_map.display_y) + (effect.event.y * 32) - 5
			end
		end
	end
	#--------------------------------------------------------------
	def in_range?(object)
		screne_x = $game_map.display_x
		screne_x -= 256
		screne_y = $game_map.display_y
		screne_y -= 256
		screne_width = $game_map.display_x
		screne_width += 2816
		screne_height = $game_map.display_y
		screne_height += 2176
		return false if object.real_x <= screne_x
		return false if object.real_x >= screne_width
		return false if object.real_y <= screne_y
		return false if object.real_y >= screne_height
		return true
	end
end

#================================
# ■ Light Effects Class
#================================

class Light_Effect
	#--------------------------------------------------------------
	attr_accessor :light
	attr_accessor :event
	attr_accessor :type
	#--------------------------------------------------------------
	def initialize(event, type)
		@light = Sprite.new
		@light.bitmap = RPG::Cache.picture("LE.PNG")
		@light.visible = true
		@light.z = 1000
		@event = event
		@type = type
	end
end

 

 

Edited by Dilos
Applicato tag code.

"Quarantadue!" urlò Loonquawl. "Questo è tutto ciò che sai dire dopo un lavoro di sette milioni e mezzo di anni?"

"Ho controllato molto approfonditamente," disse il computer, "e questa è sicuramente la risposta. Ad essere sinceri, penso che il problema sia che voi non abbiate mai saputo veramente qual è la domanda."

 

 

 

Gioco disponibile: Prophecy of Last Era - OPEN SOURCE

 

http://www.mediafire.com/?u6aut42ks12ixgf

 

Puoi utilizzare qualsiasi evento, mappa, chara, grafica, e programmazione contenuta nel gioco-demo.

Nessun diritto di copia.

Hope you enjoy.

http://www.rpg2s.net/awards/bestmusician3.jpg

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Ti sei dimenticato di aggiungere la picture Le.png...

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

Giusto. Scusate.

"Quarantadue!" urlò Loonquawl. "Questo è tutto ciò che sai dire dopo un lavoro di sette milioni e mezzo di anni?"

"Ho controllato molto approfonditamente," disse il computer, "e questa è sicuramente la risposta. Ad essere sinceri, penso che il problema sia che voi non abbiate mai saputo veramente qual è la domanda."

 

 

 

Gioco disponibile: Prophecy of Last Era - OPEN SOURCE

 

http://www.mediafire.com/?u6aut42ks12ixgf

 

Puoi utilizzare qualsiasi evento, mappa, chara, grafica, e programmazione contenuta nel gioco-demo.

Nessun diritto di copia.

Hope you enjoy.

http://www.rpg2s.net/awards/bestmusician3.jpg

Link to comment
Share on other sites

a me non funge... su un lampione ho creato un evento vuoto e nel commento ho messo Light Effects giusto ? (con processo parallelo) o sbaglio qualcosa ? poi cosa cambia se metti fire ?

IL MIO NICK è FRISKON Quando mi son registrato, credevo di fare lo spettatore!

 

 

Link to comment
Share on other sites

Bello script!Magari la luce dovrebbe essere meno trasparente..Si può impostare l'opacità dell'immagine?

http://www.freankexpo.net/signature/1129.png

2986.png

BIM_Banner3.png

Premi RpgMaker

 


http://www.rpg2s.net/forum/uploads/monthly_01_2017/msg-293-0-48316500-1483794996.jpghttp://www.rpg2s.net/dax_games/r2s_regali2.pngContesthttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest3Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest1Oct.gif http://rpg2s.net/gif/SCContest2Oct.gif http://rpg2s.net/gif/SCContest2Oct.gifhttp://rpg2s.net/gif/SCContest1Oct.gifhttp://www.rpg2s.net/awards/bestpixel2.jpghttp://www.rpg2s.net/awards/bestresourCSist2.jpghttp://www.rpg2s.net/awards/mostproductive1.jpghttp://i42.servimg.com/u/f42/13/12/87/37/iconap13.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap14.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap15.pnghttp://i42.servimg.com/u/f42/13/12/87/37/iconap16.pnghttp://i42.servimg.com/u/f42/13/12/87/37/screen10.pnghttp://www.rpgmkr.net/contest/screen-contest-primo.pnghttp://www.makerando.com/forum/uploads/jawards/iconawards3.png

Link to comment
Share on other sites

sì, basta editare le righe che citano:

 

light_effects.light.opacity = XX

Finrod, GDR PBF

2PV e 1PAEquip: - faretra con 20 frecce- arco lungo- pugnale comune- Armatura di cuoio- Torcia- Cappuccio

Mi sa che è ora di vincere qualche premio per rinnovare questa firma! :3Posizioni raggiunte nei contest

http://rpg2s.net/gif/SCContest3Oct.gifhttp://www.rpg2s.net/awards/bestresourCSist3.jpghttp://www.rpg2s.net/awards/mosthelpful2.jpghttp://www.rpg2s.net/awards/mostpresent2.jpg

 

 

 

Link to comment
Share on other sites

Grazie, mi è utile :)


Progetti in corso?


Troppi.
----------------------------------------------
Se vi va, qualcosa di interessante(CERCO COLLABORATORI):
www.youtube.com/user/Progettopoesia
-------------------------------------------------------------------

GIOCO:THOKK JASCONIUS(Risultati)


game contest 2007/2008
Premio atmosfera:terzo classificato
Premio effetti speciali rpgxp:secondo classificato

game contest 2008/2009
http://www.rpg2s.net/gif/GC_trama2.gif Trama secondo posto assoluto
La versione seguente è comprensivadi rtp. Ricordate di installare il font Monotype Corsiva che troverete all'interno dell'archivio. Fatemi sapere!:D

Thokk Jasconius Versione Contest 2009 con rtp

Topic del progetto del gioco:
Thokk Jasconius Il Progetto

GIOCO:FIVE DAYS


Partecipante allo short contest. Ho scritto i testi. Ciao Progm, Ciao Flame XD
Five Days

PROMOTORE DEL POESIA E LETTERATURA CONTEST
POESIA E LETTERATURA CONTEST
ENTRA NEL PROGETTO POESIA E LETTERATURA

 

I miei giochi da tavolo (social, seguimi!):

https://www.instagram.com/maremma_che_giochi/

https://www.facebook.com/MaremmacheGiochi/

https://maremmachegiochi.wordpress.com/

https://www.youtube.com/channel/UCV7NKeTFlOIe4pKl8DIBIzw

https://maremmachegiochi.forumfree.it/

Link to comment
Share on other sites

Basta che metti un evento vuoto sulla mappa senza parallel process, basta anche action key, ma dentro devi inserire due commenti: il primo deve essere "Light Effects" senza le virgolette, il secondo

"Fire"senza le virgolette.

"Quarantadue!" urlò Loonquawl. "Questo è tutto ciò che sai dire dopo un lavoro di sette milioni e mezzo di anni?"

"Ho controllato molto approfonditamente," disse il computer, "e questa è sicuramente la risposta. Ad essere sinceri, penso che il problema sia che voi non abbiate mai saputo veramente qual è la domanda."

 

 

 

Gioco disponibile: Prophecy of Last Era - OPEN SOURCE

 

http://www.mediafire.com/?u6aut42ks12ixgf

 

Puoi utilizzare qualsiasi evento, mappa, chara, grafica, e programmazione contenuta nel gioco-demo.

Nessun diritto di copia.

Hope you enjoy.

http://www.rpg2s.net/awards/bestmusician3.jpg

Link to comment
Share on other sites

  • 4 weeks later...
Ricorda che non deve essere parallelo...

(\__/)

(='.'=)

(")_(")

Questo è Bunny. Ho deciso di aiutarlo nella sua missione di conquista del mondo.

Compagni di Bunny unitevi a me!

 

http://img170.imageshack.us/img170/1858/pizzelartzzennm9.png

I chara da me postati: CLICCA QUI! PER XP - CLICCA QUI! PER XP(2) - CLICCA QUI! PER VX - CLICCA QUI! PER 2K/2K3!

I tileset da me postati:CLICCA QUI! PER XP

I Personaggi Completi da me postati: CLICCA QUI! PER XP

I Face da me postati: CLICCA QUI! PER XP

I Battlers da me postati: CLICCA QUI! PER XP!

Le Windowskin da me postate: CLICCA QUI! PER XP!

Risorse sonore da me postate: CLICCA QUI! PER SCARICARLE!

Guida al Ruby: CLICCA QUI! PER SCARICARLA!

Vi prego di inserirmi nei crediti...Grazie!

Link to comment
Share on other sites

L'immagine da importare in Pictures (quella allegata) si deve chiamare LE.png ;)

"Dopo gli ultimi Final Fantasy, ho capito solamente una cosa: che il gioco è bello quando Nomura poco."

Making is not dead. You are dead.
RELEASE: La Bussola d'Oro | Download | Video di anteprima - La Partenza di Hanna

http://i.imgur.com/cFgc2lW.png

Prova Standrama!

Link to comment
Share on other sites

Grazie Tio della correzione, avevo sbagliato a scrivere! :happy:

"Quarantadue!" urlò Loonquawl. "Questo è tutto ciò che sai dire dopo un lavoro di sette milioni e mezzo di anni?"

"Ho controllato molto approfonditamente," disse il computer, "e questa è sicuramente la risposta. Ad essere sinceri, penso che il problema sia che voi non abbiate mai saputo veramente qual è la domanda."

 

 

 

Gioco disponibile: Prophecy of Last Era - OPEN SOURCE

 

http://www.mediafire.com/?u6aut42ks12ixgf

 

Puoi utilizzare qualsiasi evento, mappa, chara, grafica, e programmazione contenuta nel gioco-demo.

Nessun diritto di copia.

Hope you enjoy.

http://www.rpg2s.net/awards/bestmusician3.jpg

Link to comment
Share on other sites

  • 4 weeks later...
ottimo script..lo userò in un mio proj!Verrai creditato a dovere!

http://img13.imageshack.us/img13/1359/userbarlor.png

 

"La Storia Ha Orrore Dei Paradossi"(Raziel)

Partecipante al Rpg2s.net Game Contest 2008/2009

http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg

Gioco in Sviluppo: Æterna Nova Lux

 

RMXP.IT, Rest In Peace!

Link to comment
Share on other sites

No, non ti preoccupare! :happy:

A parte che lo script non l'ho fatto io, ma poi non ce ne sarebbe stato comunque motivo, perchè anche se l'avessi fatto io, l'avrei comunque postato perchè tutti potessero utilizzarlo.

:happy:

"Quarantadue!" urlò Loonquawl. "Questo è tutto ciò che sai dire dopo un lavoro di sette milioni e mezzo di anni?"

"Ho controllato molto approfonditamente," disse il computer, "e questa è sicuramente la risposta. Ad essere sinceri, penso che il problema sia che voi non abbiate mai saputo veramente qual è la domanda."

 

 

 

Gioco disponibile: Prophecy of Last Era - OPEN SOURCE

 

http://www.mediafire.com/?u6aut42ks12ixgf

 

Puoi utilizzare qualsiasi evento, mappa, chara, grafica, e programmazione contenuta nel gioco-demo.

Nessun diritto di copia.

Hope you enjoy.

http://www.rpg2s.net/awards/bestmusician3.jpg

Link to comment
Share on other sites

  • 1 month later...
l'ho usato, comunque sei stato creditato

http://img13.imageshack.us/img13/1359/userbarlor.png

 

"La Storia Ha Orrore Dei Paradossi"(Raziel)

Partecipante al Rpg2s.net Game Contest 2008/2009

http://www.rpg2s.net/contest/GameContest0809/gc0809-bannerino.jpg

Gioco in Sviluppo: Æterna Nova Lux

 

RMXP.IT, Rest In Peace!

Link to comment
Share on other sites

  • 6 months later...

Si però come si fa a farlo vedere solo quando si vuole?

Se metto come condizione d' avvio evento una swith, anche con i due commenti non fa apparire nulla.

Questo lo rende quasi inutile,perchè non è possibile fare una cosa del tipo luci accese solo di notte!!

Link to comment
Share on other sites

deve essere uno switch sisi

 

 

Partecipante al Rpg2s.net Game Contest 2008/2009

Gioco in Sviluppo:

Fantasy Chronicle

 

Sarica e commenta anche tu!

 

http://img120.imageshack.us/img120/3914/adlucariodd0.pnghttp://img74.imageshack.us/img74/8841/admariomc6.pnghttp://img177.imageshack.us/img177/8113/adzsamuszd3.pnghttp://img359.imageshack.us/img359/9097/adfalcoqq6.png

http://img382.imageshack.us/img382/3572/adlucasom6.pnghttp://img501.imageshack.us/img501/5646/adsnakepp3.png

 

http://team.ffonline.it/imgpersonaggio/cloud_it.jpghttp://team.ffonline.it/imgpersonaggio/cyan_it.jpghttp://team.ffonline.it/imgpersonaggio/steiner_it.jpg

 

Un tizio riguardo Mario Galaxy

 

io l'ho provato, molto divertente e colorato, ma nn c'entra nulla il termine "cpaolavoro" o "miglior gioco" x un gioco del genere, e ha se, nn puo essere paragonato a "veri" giochi del calibro di resident evil,tekken,gran turismo,rachet e clank,assassin's creed ecc.....

 

 

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