Bem-vindo, visitante!
 Login:  Senha:
Para refletir: "Roubar ideias de uma pessoa é plágio. Roubar de várias, é pesquisa." - Skeepy

Autor Tópico: Sistema de Iluminação  (Lido 3822 vezes)

0 Membros e 1 Visitante estão vendo este tópico.

FaeL

  • Visitante
Sistema de Iluminação
« em: 02 de Novembro de 2008, 13:11:35 »
Pontuação: 5
Light Effects VX
Feito por Kylock e Near Fantastica

Introdução
Adiciona um Belo Efeito de Luz,Ideal para Fogueiras e Luminarias

Modo de Usar
Spoiler(Clique para mostrar/esconder)
Copie essa imagem e coloque na pasta Pictures


e Depois adicione um comentário escrito LIGHT aonde vc quizer que apareça a luz

Screenshot
Spoiler(Clique para mostrar/esconder)

Script

Código: [Selecionar]
#==============================================================================
# ¦ Light Effects VX 1.1
#     5.21.2008
#------------------------------------------------------------------------------
#  Script by: Kylock (originally for RMXP by Near Fantastica)
#==============================================================================
#   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
#==============================================================================
# ? 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.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 - 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
      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 - 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
      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 = 1000
    @event = event
    @type = type
  end
end
« Última modificação: 22 de Abril de 2009, 21:11:48 por Sesshoumaru »

Raposa Sabia

  • Membro
  • *
  • Mensagens: 141
  • Reputação: 0
  • Offline
  • Welcome back Stranger!
Re: Sistema de Iluminação
« Resposta #1 em: 21 de Janeiro de 2010, 20:27:18 »
Pontuação: 0
Funciona para XP também?
''Ser forte para ser útil''
__________________________________________
''Se um peixe vive a vida toda nesse rio ele sabe o destino do rio?Não!Só que ele corre, corre fora de seu controle, ele pode seguir para onde ele corre mas não pode ver o fim, não pode imaginar o oceano.''
                                                  Mestre Jeong Jeong 

xXangeloXx

  • Membro
  • *
  • Mensagens: 379
  • Reputação: 15
  • Offline
  • Trabalhando num novo projeto
Re: Sistema de Iluminação
« Resposta #2 em: 21 de Janeiro de 2010, 22:56:51 »
Pontuação: 0
Esse script é muito bom eu estou utilizando ele no meu projeto simplesmente perfeito, vlw :palmas:
Novo projeto inicicado:
Status: Trabalhando
Fase do desenvolvimento: Brainstorming

Sidhenidon

  • Membro
  • *
  • Mensagens: 620
  • Reputação: 106
  • Offline
Re: Sistema de Iluminação
« Resposta #3 em: 21 de Janeiro de 2010, 23:03:34 »
Pontuação: 2
Não funciona em XP, mas tomei a liberdade de converter para o XP a versão 2.0 desse Light Effects:

Código: [Selecionar]
#==============================================================================
#========================== Light Effects XP 2.0 ==============================
#------------------------------------------------------------------------------
#  Script de: Kylock (originalmente para RMXP por Near Fantastica)
#  Tradução por Equipe Gemstone
#  Novos modos de luz da versão 2.0 por Kbça
#==============================================================================
#   Para fazer com que um evento brilhe, escreva um Comentário: com qualquer um
#                dos modos de luz suportados abaixo.
#=============================== Versões ======================================
# 1.0 - Lançamento original
# 1.1 - Novos modos de luz adicionados: LIGHT2, TORCH, TORCH2.
#     - Mudou o modo de blend do sprite para Adicionar (parece um pouco melhor).
#     - Luzes de fogo agora estão com tonalidade vermelha.
# 2.0 - Novos modos de luz adicionados: (by Kbça)
#       XENON, BLOOD, GREEN, WHITE, CYAN, PINK e YELLOW
#============================= Modos de Luz ====================================
#   GROUND - Médio alcance e luz branca.
#   FIRE   - Luz vermelha que oscila levemente.
#   LIGHT  - Alcance curto e luz branca.
#   LIGHT2 - Longo alcance e luz branca.
#   TORCH  - Grande luz vermelha com muita oscilação.
#   TORCH2 - Grande luz vermelha que oscila levemente.
#   XENON  - Alcançe médio, luz azul imitando Xenon.
#   BLOOD  - Luz vermelho-sangue de alcançe médio, ideal para jogos de terror!
#   GREEN  - Luz verde de médio alcançe.
#   WHITE  - Luz branca de médio alcançe, porém mais forte que GROUND e LIGHT.
#   CYAN   - Alcançe médio, cor verde piscina e um tanto forte.
#   PINK   - Cor rosa, de médio alcançe.
#   YELLOW - Luz forte de médio alcançe de cor amarela.
#==============================================================================

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
        if event.list[i].code == 108 and event.list[i].parameters == ["XENON"]
          type = "XENON"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["BLOOD"]
          type = "BLOOD"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["GREEN"]
          type = "GREEN"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 150
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["WHITE"]
          type = "WHITE"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 180
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["CYAN"]
          type = "CYAN"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 180
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["PINK"]
          type = "PINK"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 180
          @light_effects.push(light_effects)
        end
        if event.list[i].code == 108 and event.list[i].parameters == ["YELLOW"]
          type = "YELLOW"
          light_effects = Light_Effect.new(event,type)
          light_effects.light.zoom_x = 2
          light_effects.light.zoom_y = 2
          light_effects.light.opacity = 180
          @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 - 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 "XENON"
        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(-200,-200,255,   0)
        effect.light.blend_type = 1
      when "BLOOD"
        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,-230,-230,   0)
        effect.light.blend_type = 1
      when "GREEN"
        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(-150,255,-150,   0)
        effect.light.blend_type = 1
      when "WHITE"
        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,   0)
        effect.light.blend_type = 1
      when "CYAN"
        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,0,0,   0)
        effect.light.blend_type = 1
      when "PINK"
        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(0,-255,0,   0)
        effect.light.blend_type = 1
      when "YELLOW"
        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(0,0,-255,   0)
        effect.light.blend_type = 1
      end
    end
  end
  def update_light_effects
    if $game_switches[13]# Controle de luz (nome do switch)
      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 - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "FIRE"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82 + rand(6) - 3
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82 + 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 - $game_map.display_x) / 4 -82 - 20
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "TORCH"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82 - 20 + rand(20) - 10
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 + rand(20) - 10
        effect.light.opacity = rand(30) + 70
      when "TORCH2"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82 - 20
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
        effect.light.opacity = rand(10) + 90
      when "XENON"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "BLOOD"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "GREEN"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "WHITE"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "CYAN"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "PINK"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      when "YELLOW"
        effect.light.x = (effect.event.real_x - $game_map.display_x) / 4 -82
        effect.light.y = (effect.event.real_y - $game_map.display_y) / 4 -82
      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 = RPG::Cache.picture("le.png")
    @light.visible = true
    @light.z = 1000
    @event = event
    @type = type
  end
end

Makous

  • Membro
  • *
  • Mensagens: 118
  • Reputação: 1
  • Offline
  • Evite acidentes, faça de propósito!
  • (Banido)
Re: Sistema de Iluminação
« Resposta #4 em: 23 de Janeiro de 2010, 14:57:46 »
Pontuação: 0
Gostei deixa mais realista...Vlw!
Irritado por perder uma discussão que eu estava tendo comigo mesmo, disse para mim: Ah, vá ver se eu estou na esquina. Eu fui, e eu estava.

Gabriel Toschi

  • Membro Honorário
  • *
  • Mensagens: 1538
  • Reputação: 141
  • Offline
  • http://itoschi.com
Re: Sistema de Iluminação
« Resposta #5 em: 23 de Janeiro de 2010, 22:45:43 »
Pontuação: 0
Só com um comentário? Legal! Vou usar!
Mais, onde eu coloco o script? Alguém pode me dizer?

Skeepy

  • Membro
  • *
  • Mensagens: 618
  • Reputação: 11
  • Offline
Re: Sistema de Iluminação
« Resposta #6 em: 23 de Janeiro de 2010, 23:05:42 »
Pontuação: 0
Só com um comentário? Legal! Vou usar!
Mais, onde eu coloco o script? Alguém pode me dizer?
Perto do botão de som, no progama..

@topic:
Otimo sistema, boa fael.
# voltei, saudade da mrm. *_*

Contatos
Email: anderson-ro-oliveira1234@hotmail.com
Twitter:  @anderson1257

Makous

  • Membro
  • *
  • Mensagens: 118
  • Reputação: 1
  • Offline
  • Evite acidentes, faça de propósito!
  • (Banido)
Re: Sistema de Iluminação
« Resposta #7 em: 24 de Janeiro de 2010, 14:13:55 »
Pontuação: 0
Só com um comentário? Legal! Vou usar!
Mais, onde eu coloco o script? Alguém pode me dizer?
Aperte f11 e abra o editor de scripts...Clique com o botão direito e inserir vai abrir um a mais coloque o nome e copie e cole o script.
Irritado por perder uma discussão que eu estava tendo comigo mesmo, disse para mim: Ah, vá ver se eu estou na esquina. Eu fui, e eu estava.

Zeeshan

  • Membro
  • *
  • Mensagens: 16
  • Reputação: 21
  • Offline
Re: Sistema de Iluminação
« Resposta #8 em: 16 de Agosto de 2011, 13:29:44 »
Pontuação: 0

Auteur : Kylock, BulletXt et Garruk (Zeeshan)

Description du script

- Ce script ajoute des effets de lumières sur vos maps.
- Vous avez 26 choix au lieu de 8. ^^
- Possibilité d'éteindre les lumières à l'aide d'un interrupteur
-Compatible avec le script jour et nuit de KGC   


Código: [Selecionar]
=begin
                              Light Effects Version Ultime by Garruk

Version: 0.1
Author: BulletXt (bulletxt@gmail.com) Kylock and Garruk allias Zeeshan
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 - Le moyen stabilise la lumière blanche.
 GROUND2 - Lumière blanche moyenne avec éclat léger.
 GROUND3 - Petite lumière rouge stable.
 GROUND4 - Le moyen stabilise le feu vert.
 GROUND5 - Le moyen stabilise la lumière de blue
 GROUND6- Le moyen stabilise la lumière de violet
GROUND7-Le moyen stabilise la lumière de jaune.
 
 FIRE - Lumière rouge, intensité forte
 LIGHT - Lumière standard, intensitée petite
# LIGHT2 - Lumière standard, intensitée moyenne
# LIGHT3 - Lumière standard, intensitée forte
 TORCH - X-Large lumière rouge avec un lourd éclat.
 TORCH2 - X-Large lumière rouge avec un éclat d'habileté.
 TORCH3 - Grande lumière blanche avec un éclat léger.
 TORCH4 - Lumière Rouge moyenne.
 
 # TORCH1B - Lumiére bleu, intesitée petite, ondule
# TORCH2B - Lumiére bleu, intesitée moyenne, ondule
# TORCH3B - Lumiére bleu, intesitée forte, ondule
# TORCH1V - Lumiére verte, intesitée petite, ondule
# TORCH2V - Lumiére verte, intesitée forte, ondule
# LIGHT1B - Lumière bleu, intensitée petite
# LIGHT2B - Lumière bleu, intensitée moyenne
# LIGHT1V - Lumière verte, intensitée petite
# LIGHT2V - Lumière verte, intensitée moyenne
# OMBRE - Lumière noir
 
Cette partie permet d'éteindre les lumières à l'aide des interrupteurs.
Chaque interrupteur permet d'éteindre un groupe de lumière comme les LIGHT par exemple
Vous pouvez changer l'ID de l'interrupteur comme bon vous sembles
Bref amusez-vous à éteindre/allumer les lumière de votre projet pour créer des scénes surpuissantes
Modification by CloudStrife (le faux

=end

#ID de l'interrupteur qui permet d'éteindre les lumières de mode de FIRE
#Ne marche seulement pour allumer et éteindre le mode : FIRE
FIRE = 87
#Pareil pour le mode LIGHT
#Eteins et allume les lumière avec les commentaires: LIGHT, LIGHT2, LIGHT3
LIGHT = 86
#On fini avec les GROUND
#Donc: GROUND, GROUND2, GROUND3, GROUND4, GROUND5
GROUND = 85
#Ma après les GROUND il reste les TORCH
#applies to light mode: TORCH, TORCH2, TORCH3 et les autres qui ne sont pas cités
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 = 999

=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 == ["TORCH4"]
                  type = "TORCH4"
                  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 == ["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
               if event.list[i].code == 108 and event.list[i].parameters == ["GROUND6"]
                  type = "GROUND6"
                  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 == ["GROUND7"]
                  type = "GROUND7"
                  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 == ["TORCH1B"]
type = "TORCH1B"
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 == ["TORCH2B"]
type = "TORCH2B"
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 == ["TORCH3B"]
type = "TORCH3B"
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 == ["TORCH1V"]
type = "TORCH1V"
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 == ["TORCH2V"]
type = "TORCH2V"
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 == ["TORCH1VIO"]
type = "TORCH1VIO"
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 == ["LIGHT1B"]
type = "LIGHT1B"
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 == ["LIGHT2B"]
type = "LIGHT2B"
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 == ["LIGHT1V"]
type = "LIGHT1V"
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 == ["LIGHT2V"]
type = "LIGHT2V"
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 == ["LIGHT2VV"]
type = "LIGHT2VV"
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 == ["OMBRE"]
type = "OMBRE"
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
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 "TORCH4"
         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 "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
        when "GROUND6"
         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(85,-255,85, 255)
         effect.light.blend_type = 1
              when "GROUND7"
         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   
         
         #"Tone" indique la couleur

when "TORCH1B"
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,-60,200, 0)
effect.light.blend_type = 1
when "TORCH2B"
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,-60,200, 0)
effect.light.blend_type = 1
when "TORCH3B"
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,-60,200, 0)
effect.light.blend_type = 1
when "TORCH1V"
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,100,-100, 0)
effect.light.blend_type = 1
when "TORCH2V"
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,100,-100, 0)
effect.light.blend_type = 1
when "TORCH1VIO"
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(80,-100,80, 0)
effect.light.blend_type = 1



when "LIGHT1B"
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.tone = Tone.new(-150,-150,300, 0)
effect.light.blend_type = 1
when "LIGHT2B"
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(-150,-150,300, 0)

effect.light.blend_type = 1
when "LIGHT1V"
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.tone = Tone.new(-150,300,-150, 0)
effect.light.blend_type = 1
when "LIGHT2V"
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(-150,300,-100, 0)
effect.light.blend_type = 1
when "LIGHT2VV"
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(-150,300,10, 0)
effect.light.blend_type = 1
when "OMBRE"
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,-255,-255, -255)
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.type != "GROUND6" && effect.type != "GROUND7"
      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.type != "GROUND6" && effect.type != "GROUND7"
      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.type != "TORCH4"
      effect.light.visible = false
    end
  else
    for effect in @light_effects
      next if effect.type != "TORCH" && effect.type != "TORCH2" && effect.type != "TORCH3"&& effect.type != "TORCH4"
      effect.light.visible = true
    end
  end
 
  # handle TORCH
  if $game_switches[TORCH]
    for effect in @light_effects
      next if effect.type != "TORCH1B" && effect.type != "TORCH2B" && effect.type != "TORCH3B"&& effect.type != "TORCH1V"
      effect.light.visible = false
    end
  else
    for effect in @light_effects
      next if effect.type != "TORCH1B" && effect.type != "TORCH2B" && effect.type != "TORCH3B"&& effect.type != "TORCH1V"
      effect.light.visible = true
    end
  end
 
  # handle TORCH
  if $game_switches[TORCH]
    for effect in @light_effects
      next if effect.type != "TORCH2V" && effect.type != "LIGHT1B" && effect.type != "LIGHT2B"&& effect.type != "LIGHT1V"
      effect.light.visible = false
    end
  else
    for effect in @light_effects
      next if effect.type != "TORCH2V" && effect.type != "LIGHT1B" && effect.type != "LIGHT2B"&& effect.type != "LIGHT1V"
      effect.light.visible = true
    end
  end
 
  # handle TORCH
  if $game_switches[TORCH]
    for effect in @light_effects
      next if effect.type != "LIGHT2V" && effect.type != "OMBRE"
      effect.light.visible = false
    end
  else
    for effect in @light_effects
      next if effect.type != "LIGHT2V" && effect.type != "OMBRE"
      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"TORCH4"
      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 "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
   when "GROUND6"
         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 "GROUND7"
         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 "TORCH1B"
effect.light.x = (effect.event.real_x - -10 - $game_map.display_x) / 8 - 20 + rand(6) - 3
effect.light.y = (effect.event.real_y - 100 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.opacity = rand(30) + 70
when "TORCH2B"
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 "TORCH3B"
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 "TORCH1V"
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 "TORCH2V"
effect.light.x = (effect.event.real_x - 1200 - $game_map.display_x) / 8 - 20+ + rand(6) - 3
effect.light.y = (effect.event.real_y - 1400 - $game_map.display_y) / 8 + rand(6) - 3
effect.light.opacity = rand(30) + 70
when "TORCH1VIO"
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 "LIGHT1B"
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 "LIGHT2B"
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
when "LIGHT1V"
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 "LIGHT2V"
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
when "LIGHT2VV"
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
when "OMBRE"
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     
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 = 1000
@event = event
@type = type
end
end
[/spoiler]

lucio936

  • Membro
  • *
  • Mensagens: 38
  • Reputação: 6
  • Offline
Re: Sistema de Iluminação
« Resposta #9 em: 08 de Setembro de 2011, 08:49:38 »
Pontuação: 0
Muito show!!!!!


Tiaguu!!

  • Membro
  • *
  • Mensagens: 18
  • Reputação: 0
  • Offline
Re: Sistema de Iluminação
« Resposta #10 em: 09 de Setembro de 2011, 20:45:05 »
Pontuação: 0
Como deixar a tela escura ?

Dakr

  • Membro
  • *
  • Mensagens: 353
  • Reputação: 52
  • Offline
  • Qual a diferença entre berinjela e beterraba?
Re: Sistema de Iluminação
« Resposta #11 em: 09 de Setembro de 2011, 23:13:54 »
Pontuação: 0
Isso me lembrou muito o Thomas Edison VX!

Muito legal, parabéns!



@Tiaguu!!: Você pode usar o Fade Out e Fade In, pode colocar alguma picture ou Cor da Tela na segunda Página.
« Última modificação: 09 de Setembro de 2011, 23:14:10 por Dakr »

Quer conhecer o melhor jogo de terror sendo produzido em RPG Maker VX? Quer jogar a DEMO? Clique na Bar:

 

Tópicos Relacionados

  Assunto / Iniciado por Respostas Última mensagem
40 Respostas
6311 Visualizações
Última mensagem 26 de Novembro de 2012, 09:06:28
por fypmap
1 Respostas
619 Visualizações
Última mensagem 03 de Junho de 2010, 21:52:23
por faybler
2 Respostas
852 Visualizações
Última mensagem 11 de Dezembro de 2010, 16:56:35
por massakmkz
6 Respostas
310 Visualizações
Última mensagem 20 de Junho de 2011, 14:20:08
por Hilton