Jump to content
Rpg²S Forum

BuddyTroller

Utenti
  • Posts

    834
  • Joined

  • Last visited

  • Days Won

    21

Posts posted by BuddyTroller

  1. Ho semplicemente rinominato dispose_effects in kyl_dispose_effects (compare in 3 punti dello script).
    Onestamente mi stupisce che Kylock non abbia dato un nome meno comune al metodo, o forse c'entra lo zampino cricetoso di clyde.

    OT: Quant'è bello sperimentare con script esistenti e capire come funzionano <3 Se capisci le basi puoi divertirti a personalizzare e integrare fra di loro i vari script. Ogni volta che iniziavo qualche folle progetto il primo passo è sempre stato quello di scegliere tutti gli script più interessanti, eliminare il superfluo e farli interagire dove c'erano i presupposti. Partivo con 100+ script, infinite righe di codice e poi ne rimaneva solo uno bello condensato :D

  2. Wow mi ero perso tutte le nuove discussioni.

    -Firepit e Torchlit1

    Ho provato su un progetto completamente nuovo.

    Nello scipt parla di switch 30, io metto nel gioco switch 30 on e non va.

    Ho provato anche con F9, ma niente

     

    EDIT : ho scoperto che "FIRETIP" e "TORCHLIT 1" non si spengono mentre gli altri si.

    Come mai? Come posso spegnerle tutte?

    Firepit e Torchlit1 non si spengono semplicemente perchè erano pensati per funzionare così :P
    Qualora ti servisse, è possibile creare nuovi effetti luce secondo le tue esigenze, ma devi capire bene come funzionano.

    -Per il day/night system vedo che ha risolto NinjaGuardian :D

     

    -Per l'ultima domanda stiamo risolvendo in un topic a parte!

  3. La pezza che avevo scritto era sicuramente sbagliata e l'ho modificata. Dovresti aggiungerla come nuovo script, sotto gli altri due.

    Non ho rpg maker quindi non posso fare alcuna prova, per cui proviamo con una cosa differente. Ho modificato direttamente lo script di kylock per cambiare nome al metodo, così che i due non vadano in conflitto:

     

    #==============================================================================
    # WARNING: EDITED BY BUDDYTROLLER, USE AT YOUR OWN RISK!
    #==============================================================================
    # AUTOLIGHT 1.3.1 UNOFFICIAL PORTING VX ACE
    # 12.27.2008
    #------------------------------------------------------------------------------
    # SCRIPT BY: Kylock
    # PORTING BY: I don't want to be credited.
    #
    #==============================================================================
    # INSTRUCTIONS
    #
    # Remember, you must have the file "le.png" in your "Graphics\Pictures" folder!
    # If you're missing the file follow this link:
    # http://imageshack.us/photo/my-images/189/81598086.png/
    #
    # To make an event glow, choose the desired event and comment with the applied
    # term. If you want Light 1, comment "LIGHT 1".
    #==============================================================================
    # ? Change Log
    #------------------------------------------------------------------------------
    # 1.0 - Original Release
    # 1.1 - New light modes added: LIGHT2, TORCHLIT 1, TORCHLIT 2
    #	 - Changed sprite blend mode to ADD
    #	 - Fire-based lights are now red in color
    # 1.2 - Bug fixed with looping maps and lights displaying above message boxes
    # 1.3 - More bugfixes
    #==============================================================================
    # ? Light Modes
    #------------------------------------------------------------------------------
    # LIGHT 1 - Steady white light. (Small)
    # FIREPIT - Flicker.
    # LIGHT 2 - Steady white light. (Large)
    # LIGHT 3 - Steady white light.
    # TORCHLIT 1 - Flicker. (Heavy)
    # TORCHLIT 2 - Flicker. (Light)
    #==============================================================================
    
    module LES
    
      #The switch used to turn lights ON/OFF
      #If the Switch is ON the lights turn OFF
      #If the Switch is OFF the lights turn ON
      SWITCH = 30
    
    end
    
    #==============================================================================
    # ■ Spriteset_Map
    #==============================================================================
    class Spriteset_Map
    
      alias les_spriteset_map_initalize initialize
    
      def initialize
    	initialize_effects
    	les_spriteset_map_initalize
    	update
      end
    
      def initialize_effects
    	@light_effects = []
    	setup_lights
      end
    
      alias les_spriteset_map_dispose dispose
      def dispose
    	les_spriteset_map_dispose
    	kyl_dispose_effects
      end
    
      def kyl_dispose_effects
    	for effect in @light_effects
    	  effect.light.dispose
    	end
    	@light_effects = []
      end
    
      alias les_spriteset_map_update update
      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 1"]
    		  type = "LIGHT 1"
    		  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 == ["FIREPIT"]
    		  type = "FIREPIT"
    		  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 2"]
    		  type = "LIGHT 2"
    		  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 == ["LIGHT 3"]
    		  type = "LIGHT 3"
    		  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 == ["TORCHLIT 1"]
    		  type = "TORCHLIT 1"
    		  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 == ["TORCHLIT 2"]
    		  type = "TORCHLIT 2"
    		  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 "LIGHT 1"
    		effect.light.x = effect.event.screen_x - 64
    		effect.light.y = effect.event.screen_y - 86
    		effect.light.blend_type = 1
    	  when "FIREPIT"
    		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 2"
    		effect.light.x = effect.event.screen_x - 32
    		effect.light.y = effect.event.screen_y - 54
    		effect.light.blend_type = 1
    	  when "LIGHT 3"
    		effect.light.x = effect.event.screen_x - 182 - 20
    		effect.light.y = effect.event.screen_y - 214
    		effect.light.blend_type = 1
    	  when "TORCHLIT 1"
    		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 "TORCHLIT 2"
    		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 setup_lights
    
      def update_light_effects
    	if $game_switches[LES::SWITCH]
    	  for effect in @light_effects
    		next if effect.type == "FIREPIT" || effect.type == "TORCHLIT 1"
    		effect.light.visible = false
    	  end
    	else
    	  for effect in @light_effects
    		next if effect.type == "FIREPIT" || effect.type == "TORCHLIT 2"
    		effect.light.visible = true
    	  end
    	end
    	for effect in @light_effects
    	  case effect.type
    	  when "LIGHT 1"
    		effect.light.x = effect.event.screen_x - 64
    		effect.light.y = effect.event.screen_y - 86
    	  when "FIREPIT"
    		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 2"
    		effect.light.x = effect.event.screen_x - 32
    		effect.light.y = effect.event.screen_y - 54
    	  when "LIGHT 3"
    		effect.light.x = effect.event.screen_x - 182 - 20
    		effect.light.y = effect.event.screen_y - 214
    	  when "TORCHLIT 1"
    		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 "TORCHLIT 2"
    		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 #def update_light_effects
    
    end #class Spriteset_Map
    
    #==============================================================================
    # ■ Light_Effect
    #==============================================================================
    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 #class Light_Effect
    
    #==============================================================================
    # ■ Scene_Map
    #==============================================================================
    class Scene_Map
    
      alias les_pre_transfer pre_transfer
      def pre_transfer
    	les_pre_transfer
    	@spriteset.kyl_dispose_effects
      end
    
      alias les_post_transfer post_transfer
      def post_transfer
    	@spriteset.initialize_effects
    	les_post_transfer
      end
    
    end #Scene_Map
    
    #==============================================================================
    # END OF FILE
    #==============================================================================
    

     



    EDIT: Aggiunto il warning a inizio script per avvertire che non si tratta della versione originale, ormai questi dettagli me li perdo!

  4. Risposta senza basi sperimentali, ma vedo che entrambi gli script definiscono nella classe Spriteset_Map un nuovo metodo dispose_effects:

     

    Clyde

     

    def dispose_effects
    	for effect in @light_effects
    		effect.light.dispose
    	end
    	@light_effects = []
    end
    

     


    Galv

     

    def dispose_effects
        @reflect_sprites.each {|s| s.dispose}
        @shadow_sprites.each {|s| s.dispose}
        @mirror_sprites.each {|s| s.dispose}
        @icon_sprites.each {|s| s.dispose}
    end
     

     

     

     

    Quello che compare per secondo sovrascrive il primo impedendo il corretto funzionamento (quindi invertire l'ordine dei due script non risolve niente).
    Prova ad aggiungere questa pezza sotto agli altri due script:

     

    class Spriteset_Map
    	def dispose_effects
    		#clyde
    		for effect in @light_effects
    		  effect.light.dispose
    		end
    		@light_effects = []
    		#galv
    		@reflect_sprites.each {|s| s.dispose}
    		@shadow_sprites.each {|s| s.dispose}
    		@mirror_sprites.each {|s| s.dispose}
    		@icon_sprites.each {|s| s.dispose}
    	 end
    end # Spriteset_Map 

     

     

     

    EDIT: (offtopic) ogni volta che leggo luci e riflessioni mi viene da leggere il topic XD

  5. Hai deciso di farlo, ma non ne sei ancora convinto. Per questo sei qui a cercare conferme. Non aspettare che ci sia il solito eroe che esce dal nulla a incitarti e indicare la strada. Mettiti giù e inizia a creare! Solo in questo modo potrai convincere gli scettici (tu in primis).
    Se posso darti un consiglio, pensa a più progetti di genere diverso, creane una breve demo e presentali sul forum per vedere quali ottengono più successo e perché. Cerca di capire qual è il tuo genere e punta su quello, facendo tesoro di quello che avrai imparato dai precedenti.
    Buon Lavoro!

×
×
  • Create New...