Jump to content
Rpg²S Forum
  • 0

Aiuto Script Thomas Edison 0.1 di Kylock


lzol
 Share

Question

Salve a tutti, chiunque abbia mai usato lo script Thomas Edison di Kylock, potrebbe dirmi perché lo script non mi funziona? Io creo l'evento con il commento LIGHT e dovrebbe prendere il file "le.png" dalla cartella pictures e far apparire la luce. Il problema è che, una volta avviato l'evento, non mi mostra nessuna luce sul lampione.

 

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.

Link to comment
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Sempre solito discorso, dacci più dettagli, ma soprattutto, linkaci lo script, sennò come facciamo a sapere di cosa parli? :wink:

Hai seguito per bene le istruzioni dello script? :smile:

Edited by Dilos
Link to comment
Share on other sites

  • 0
Guest clyde
Allora innanzitutto togli il processo parallelo che è un'info superflua. Lo script si limita ad agire sugli eventi che presentano il commento, senza considerare minimamente il trigger. Thomas edison inoltre è previsto per funzionare col KGC Day Night, per cui si lega al suddetto script, e se vuoi farlo funzionare senza devi disattivare il legame(che altrimenti attende il calar della notte) o ancor meglio se non usi il Day Night dovresti cercare lo script kylock light effects . Inoltre ricorda che l'attivazione delle luci è legata a delle switch, che devono essere off. Controlla di lasciarle off quando vuoi attivare l'effetto luce e soprattutto verifica che non ci siano altri script che modificano le stesse switch. È inoltre possibile che altri script siano incompatibili e interferiscano impedendo il corretto funzionamento.
Link to comment
Share on other sites

  • 0
Dilos tu ne sbagli molte andando OT invece, dà il buon esempio da bravo mod ^ ^

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png 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) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0

Perdonate la negligenza maestri U.U

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 (bulletxt@gmail.com)
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

Link to comment
Share on other sites

  • 0
Guest clyde

Maestri de che?

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.

Link to comment
Share on other sites

  • 0

Dov'è il tag Spoiler? Nell'editor non c'è

:blink:

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?

Edited by lzol
Link to comment
Share on other sites

  • 0
Guest clyde

Allora è incompatibilità con altri script che usi. Servirebbe un elenco di script che usi o meglio ancora il progetto su cui stai lavorando (ovviamente se non c'è niente che vuoi tenere segreto). Puoi postare qui o se preferisci per Messaggio Privato se hai informazioni che non vuoi diffondere.

 

Intendevo il tag spoiler del forum per il codice:

 

 

#==============================================================================
# ■ 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

 

 

Link to comment
Share on other sites

  • 0
E penso che lui intendesse l'editor dei messaggi! XD Se così è... terza icona special BB Code! ^ ^

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png 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) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0

Intendevo il tag spoiler del forum per il codice

E penso che lui intendesse l'editor dei messaggi! XD Se così è... terza icona special BB Code! ^ ^

Siii, clyde ne ha sbagliata una! Oppure si può utilizzare lo schema [ spoiler]PIZZA[ /spoiler], senza spazi ovviamente. :cool:

 

Comunque, quoto, abbiamo bisogno dell' elenco completo (meglio il progetto), così capiamo dove sta precisamente l' errore. :cool:

 

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ì? :smile:

 

 

Guardian, lo sai che quando la mia barra Limit è carica utilizzo la turbotecnica "Off Topic"...XD, ma ora è di nuovo scarica, don' t worry!

Però avvisami in privato che sennò perdo reputazione agli occhi del pubblico! http://server80.chatexpert.it/admin/emoticons/1_timeno.gif

 

Edited by Dilos
Link to comment
Share on other sites

  • 0
Guest clyde

Se vuoi spegnere solo un determinato tipi di luci, questa funzione è stata implementata da BulletXt nella sua versione dello script. Se vuoi spegnere tutte le luci (eccetto FIRE e TORCH che sono fatti per restare accesi), allora va bene il metodo di kylock. Solo hai interpretato male le sue istruzioni. Lui si riferiva a modificare il codice non a un comando Call Script.

 

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.

Edited by clyde
Link to comment
Share on other sites

  • 0

Scusate, centra poco col problema di Izel, ma . . .

 

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

 

 

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

 

 

 

 

EDIT - Rewrite del Thomas Edison VX - Non Testata - Ma se funziona, le prestazioni miglioreranno di parecchio . . .

 

 

=begin
							    Thomas Edison VX
NOTE di giver: Versione con codice revisionato al solo scopo di migliorarne le prestazioni
		   NON E' STATO TESTATO.
		   NON SI E' CERCATO DI RIMUOVERE BUG EVENTUALMENTE ESISTENTI NELL'ORIGINALE.
Version: 0.1
Author: BulletXt (bulletxt@gmail.com)
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
#
# NON TOCCARE le 4 righe sottostanti !!
GROUNDS_NAME = "GROUND"
LIGHTS_NAME = "LIGHT"
TORCHES_NAME = "TORCH"
FIRES_NAME = "FIRE"
#
#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 = false
=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
 check_day_night if ENABLE_KGC_DAY_NIGHT_SCRIPT
 update_light_effects
 bulletxt_spriteset_map_initalize
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
   if ["FIRE", "TORCH", "TORCH2", "GROUND3", "GROUND4", "GROUND5"].include?(effect.type)
  effect.light.tone = Tone.new(255,-100,-255, 0)
   end
   effect.light.blend_type = 1
 end
end
def update_light_effects
#
 @swc_grounds = !$game_switches[GROUND]
 @swc_lights = !$game_switches[LIGHT]
 @swc_torches = !$game_switches[TORCH]
 @swc_fires = !$game_switches[FIRE]
 for effect in @light_effects
   effect.light.visible = check_light_visibility(effect.type)
   update_light_effect(effect) if effect.light.visible
 end
#
end
#
def update_light_effect(effect)
 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
#
def check_light_visibility(effect_type)
 return true if @swc_grounds && effect_type.include?(GROUNDS_NAME)
 return true if @swc_lights && effect_type.include?(LIGHTS_NAME)
 return true if @swc_torches && effect_type.include?(TORCHES_NAME)
 return true if @swc_fires && effect_type.include?(FIRES_NAME)
 return false
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

 

 

Edited by giver

 


SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]


Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !!

 


http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gif


Non riesco a smettere di essere affascinato da immagini come questa . . .

http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpg


Alcuni wallpapers che faccio ruotare sul mio vecchio PC . . .


http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpg

http://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpg
http://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpg
http://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg


La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . .


BBCode Testing


Typeface & Size



Link to comment
Share on other sites

  • 0

Sei in grado di sostituirlo e lo faresti? :3

^ ^

(\_/)
(^ ^) <----coniglietto rosso, me!
(> <)


Il mio Tumblr dove seguire i miei progetti, i progetti della Reverie : : Project ^ ^

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png 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) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0
Guest clyde
Giver apprezzo il tuo zelo ma se avessi letto tutti i messaggi ti saresti accorto che abbiamo precedentemente scartato la versione di script a cui ti riferisci. In ogni caso la questione può essere discutibile. Non necessariamente il metodo a cui tu alludi risulterà migliore di questo.
Link to comment
Share on other sites

  • 0

@Guardian: Certamente . . .

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

Edited by giver

 


SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]


Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !!

 


http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gif


Non riesco a smettere di essere affascinato da immagini come questa . . .

http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpg


Alcuni wallpapers che faccio ruotare sul mio vecchio PC . . .


http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpg

http://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpg
http://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpg
http://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg


La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . .


BBCode Testing


Typeface & Size



Link to comment
Share on other sites

  • 0

Perfetto, grazie! ^ ^

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

http://i.imgur.com/KdUDtQt.png disponibile su Google Play, qui i dettagli! ^ ^

http://i.imgur.com/FwnGMI3.png 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) ^ ^

 

SUWOnzB.jpg 🖤
http://www.rpg2s.net/dax_games/r2s_regali2s.png E:3 http://www.rpg2s.net/dax_games/xmas/gifnatale123.gif
http://i.imgur.com/FfvHCGG.png by Testament (notare dettaglio in basso a destra)! E:3
http://i.imgur.com/MpaUphY.jpg by Idriu E:3

Membro Onorario, Ambasciatore dei Coniglietti (Membro n.44)

http://i.imgur.com/PgUqHPm.png
Ufficiale
"Ad opera della sua onestà e del suo completo appoggio alla causa dei Panda, Guardian Of Irael viene ufficialmente considerato un Membro portante del Partito, e Ambasciatore del suo Popolo presso di noi"


http://i.imgur.com/TbRr4iS.png<- Grazie Testament E:3
Ricorda...se rivolgi il tuo sguardo ^ ^ a Guardian anche Guardian volge il suo sguardo ^ ^ a te ^ ^
http://i.imgur.com/u8UJ4Vm.gifby Flame ^ ^
http://i.imgur.com/VbggEKS.gifhttp://i.imgur.com/2tJmjFJ.gifhttp://projectste.altervista.org/Our_Hero_adotta/ado2.png
Grazie Testament XD Fan n°1 ufficiale di PQ! :D

Viva
il Rhaxen! <- Folletto te lo avevo detto (fa pure rima) che non
avevo programmi di grafica per fare un banner su questo pc XD (ora ho di
nuovo il mio PC veramente :D)

Rosso Guardiano della
http://i.imgur.com/Os5rvhx.png

Rpg2s RPG BY FORUM:

Nome: Darth Reveal

 

PV totali 2
PA totali 16

Descrizione: ragazzo dai lunghi capelli rossi ed occhi dello stesso colore. Indossa una elegante giacca rossa sopra ad una maglietta nera. Porta pantaloni rossi larghi, una cintura nera e degli stivali dello stesso colore. E' solito trasportare lo spadone dietro la schiena in un fodero apposito. Ha un pendente al collo e tiene ben legato un pezzo di stoffa (che gli sta particolarmente a cuore) intorno al braccio sinistro sotto la giacca, copre una cicatrice.
Bozze vesti non definitive qui.

Equipaggiamento:
Indossa:
60$ e 59$ divisi in due tasche interne
Levaitan

Spada a due mani elsa lunga

Guanti del Defender (2PA)
Anello del linguaggio animale (diventato del Richiamo)

Scrinieri da lanciere (2 PA)

Elmo del Leone (5 PA)

Corazza del Leone in Ferro Corrazzato (7 PA)

ZAINO (20) contenente:
Portamonete in pelle di cinghiale contenente: 100$
Scatola Sanitaria Sigillata (può contenere e tenere al sicuro fino a 4 oggetti curativi) (contiene Benda di pronto soccorso x3, Pozione di cura)
Corda
Bottiglia di idromele
Forma di formaggio
Torcia (serve ad illuminare, dura tre settori)

Fiasca di ceramica con Giglio Amaro (Dona +1PN e Velocità all'utilizzatore)
Ampolla Bianca

Semi di Balissa

 

CAVALLO NORMALE + SELLA (30 +2 armi) contentente:
66$
Benda di pronto soccorso x3
Spada a due mani

Fagotto per Adara (fazzoletto ricamato)


 

Link to comment
Share on other sites

  • 0
Guest clyde
Quello che dici tu accade solo nel peggiore dei casi, e cioèse tutti gli switch sono ON. Nel migliore dei casi vengono effettuati 0 cicli. Senza contare che il tuo è sì un solo ciclo, ma suppongo che tutti quei controlli nfluiscano sulle prestazioni.
Link to comment
Share on other sites

  • 0

 

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

 

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

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

Edited by giver

 


SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]


Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !!

 


http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gif


Non riesco a smettere di essere affascinato da immagini come questa . . .

http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpg


Alcuni wallpapers che faccio ruotare sul mio vecchio PC . . .


http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpg

http://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpg
http://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpg
http://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg


La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . .


BBCode Testing


Typeface & Size



Link to comment
Share on other sites

  • 0
Guest clyde

Corretto in uno dei post precedenti un mio errore. Non si deve chiamare $game_map.update ma $scene = Scene_Map.new.

 

Izol, va bene anche uno screenshot, se poi non riconosco qualche script te lo chiedo.

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