Le Deal du moment : -20%
Pack Gigabyte Ecran PC Gamer 27″ LED M27Q ...
Voir le deal
749 €

Aller en bas
DarKalimHero
DarKalimHero
Membre

Nombre de messages : 15
Distinction : aucune
Date d'inscription : 15/04/2009

Système de Lumières Empty Système de Lumières

Mer 15 Avr 2009 - 15:53
Hello !

Un ptit mod de ce super script avec d'avantages d'effets (inspiré du mod de ce script venant d'ONIROMANCIE... et débuggué Shocked ) Smile
Désolé d'avoir réouvert ce topic, mais je ne pouvais pas laisser ces ajouts dans le vide silent

Code:
#==============================================================================
# ¦ Light Effects VX 1.1
# 5.21.2008
#------------------------------------------------------------------------------
# Script by: Kylock (originally for RMXP by Near Fantastica)
# Traduction fr : Blockade
#==============================================================================
# Pour faire un effet de lumiére, inserer un commentaire avec le nom du mode voulu.
# 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
#==============================================================================
# ? Modes :
#------------------------------------------------------------------------------
# GROUND - Lumière blanche, intensité moyenne
# FIRE - Lumière rouge, intensité forte
# LIGHT - Lumière Blanche, intensité petite
# LIGHT2 - Lumière blanche intensité forte

# TORCH - Lumiére rouge, intesitée forte, ondule
# TORCH1 - Lumiére rouge, intesitée moyenne, ondule By Jim
# TORCH2 - Lumiére rouge, intesitée forte
# TORCH3 - Lumiére bleu, intesitée moyenne, ondule By Jim
# TORCH4 - Lumiére bleu, intesitée petite, ondule By Jim
# TORCH5 - Lumiére rouge, intesitée petite, ondule By Jim
# TORCH6 - Lumiére bleu, intesitée forte, ondule By Jim
# TORCH7 - Lumiére verte, intesitée moyenne, ondule By Jim
# TORCH8 - Lumiére verte, intesitée petite, ondule By Jim
# TORCH9 - Lumiére verte, intesitée forte, ondule By Jim
#==============================================================================
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 = 100 #origine 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 == ["TORCH1"]
               type = "TORCH1"
               light_effects = Light_Effect.new(event,type)
               light_effects.light.zoom_x = 3
               light_effects.light.zoom_y = 3
               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 = 3
               light_effects.light.zoom_y = 3
               light_effects.light.opacity = 150
               @light_effects.push(light_effects)
            end
            if event.list[i].code == 108 and event.list[i].parameters == ["TORCH4"]
               type = "TORCH4"
               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 == ["TORCH5"]
               type = "TORCH5"
               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 == ["TORCH6"]
               type = "TORCH6"
               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 == ["TORCH7"]
               type = "TORCH7"
               light_effects = Light_Effect.new(event,type)
               light_effects.light.zoom_x = 3
               light_effects.light.zoom_y = 3
               light_effects.light.opacity = 150
               @light_effects.push(light_effects)
            end
            if event.list[i].code == 108 and event.list[i].parameters == ["TORCH8"]
               type = "TORCH8"
               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 == ["TORCH9"]
               type = "TORCH9"
               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.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 "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 "TORCH"
            effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(255,-100,-255, 0)
            effect.light.blend_type = 1
         when "TORCH1"
            effect.light.x = (effect.event.real_x - 490 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 650 - $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 - 490 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 650 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-85,-43,0, 0)
            effect.light.blend_type = 1
         when "TORCH4"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-85,-43,0, 0)
            effect.light.blend_type = 1
         when "TORCH5"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(255,-100,-255, 0)
            effect.light.blend_type = 1
         when "TORCH6"
            effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-85,-43,0, 0)
            effect.light.blend_type = 1
         when "TORCH7"
            effect.light.x = (effect.event.real_x - 490 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 650 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-100,-27,-100, 0)
            effect.light.blend_type = 1
         when "TORCH8"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-100,-27,-100, 0)
            effect.light.blend_type = 1
         when "TORCH9"
            effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20
            effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8
            effect.light.tone = Tone.new(-100,-27,-100, 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.real_x - 400 - $game_map.display_x) / 8
            effect.light.y = (effect.event.real_y - 400 - $game_map.display_y) / 8
         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 "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 - 1400 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH1"
            effect.light.x = (effect.event.real_x - 490 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 650 - $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 - 490 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 650 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH4"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH5"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH6"
            effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH7"
            effect.light.x = (effect.event.real_x - 490 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 650 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH8"
            effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         when "TORCH9"
            effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20 + rand(20) - 10
            effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8 + rand(20) - 10
            effect.light.opacity = rand(30) + 70
         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("halo.png")
      @light.visible = true
      @light.z = 1000
      @event = event
      @type = type
   end
end

Yihaaa !
kordarr
kordarr
Modérateur

Nombre de messages : 1838
Age : 33
Localisation : île de la réunion, Le Tampon.
Distinction : Auto-proclamé sex-symbol de la commu'
Frère jumeau de Jonathan ( Secret Story )
Exhibitionniste en herbe
[Mist' & Coco' Smile]
Fan n°1 de Coco'
Psychopathe en chef
Date d'inscription : 05/11/2008

Système de Lumières Empty Re: Système de Lumières

Mer 15 Avr 2009 - 21:27
...cool, encore plus d'effet lumineux...Je prends, merci
freezia
freezia
Staffeux retraité

Nombre de messages : 1734
Distinction : Elu membre de l'année 2009 haut la main.
Inventeur du Mapping Show.

caricaturatationeur de la comu'
[ Dudu']
Date d'inscription : 18/02/2008

Système de Lumières Empty Re: Système de Lumières

Mer 15 Avr 2009 - 21:31
Ne pas oublier de nommé le fichier lumineux "halo" .
Et de le mettre dans "Pictures" . ( bon à précisé)
J'aurais bien aimé le prendre celui là mais dès que je fais parlé, é ben la lumière s'éteint ...
Naru'
Naru'
Membre

Nombre de messages : 97
Age : 28
Localisation : Dans le nord
Distinction : Voleur de nounours rose
[Coco']
Date d'inscription : 08/03/2009

Système de Lumières Empty Re: Système de Lumières

Ven 24 Avr 2009 - 13:49
Désolé du petit nécro mais qelqu'un pourrait me donner le fichier Halo s'il vous plaît ?

Coco' : C'est pas un nécro' de faire remonter un topic de quelques semaines x)
Keiser
Keiser
Membre

Nombre de messages : 11
Distinction : aucune
Date d'inscription : 24/06/2009

Système de Lumières Empty Re: Système de Lumières

Ven 26 Juin 2009 - 23:25
Merci pour ce script ^^
(par contre est ce qu'il serais possible d'avoir l'image halo en question?)
Darky Face
Darky Face
Membre

Nombre de messages : 741
Age : 27
Localisation : Dans un tigre.
Distinction : Champion mondial paralympique au 100 m. roulettes
Grosse CMB (Grosse Contusion des Membres, Ballot)
Adepte de Chatroulette.
Adjuvant-chef du club masochiste de la commu'.
Date d'inscription : 22/07/2008

Système de Lumières Empty Re: Système de Lumières

Sam 27 Juin 2009 - 4:06
Tiens, il y a des nouvelles couleurs, est-ce que je me trompe?
Bah, merci du partage, ça va sûrement me servir un de ces jours.
Dudu'
Dudu'
Staffeux retraité

Nombre de messages : 2060
Age : 33
Distinction : Apprenti KGB-boy en avenir
[Coco' Smile]
Hamsterphile de service ^^
[Balby' le Fake]
Grand prof de la MA
[Skillo]
Ce grand programmateur, mon coeur, ma vie ! [Hamu']
Date d'inscription : 22/06/2009

Système de Lumières Empty Re: Système de Lumières

Lun 29 Juin 2009 - 17:48
merçi pour se script il est super!
Contenu sponsorisé

Système de Lumières Empty Re: Système de Lumières

Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum