Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


+7
Daniel Carvalho
jiraya
Vxxx12
Nanzin
wallace123
Reborn
Satheios
11 participantes

    Script de Light Effects (muito bom!)

    Satheios
    Satheios
    Aldeia Friend
    Aldeia Friend


    Medalhas : Script de Light Effects (muito bom!) Trophy12Script de Light Effects (muito bom!) IlSfE
    Mensagens : 1248
    Créditos : 306

    Script de Light Effects (muito bom!) Empty Script de Light Effects (muito bom!)

    Mensagem por Satheios Sex Jan 13, 2012 4:29 pm


    Introdução

    Olá, eu procurei no forum aqui e nao achei, só achei o lampião customizável.

    O que ele faz

    Ele cria uma "luz" no evento desejado, pra dar o efeito de luminosidade numa lampada, etc.

    Script

    Código:
    #==============================================================================
    #========================== Light Effects XP 2.1 ==============================
    #------------------------------------------------------------------------------
    #  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
    #  Disponibilizado por Massakmkz
    #==============================================================================
    #  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
    # 2.1 - Alguns bugs concertados: (by Massakmkz)
    #============================= 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
        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 / 1 * $game_map.display_x) + (effect.event.x * 32) - 15
            effect.light.y = (-0.25 / 1 * $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

    Imagens:
    Spoiler:

    Eu mesmo fiz esse mapa xD
    Notem nas velas na parede.. Estão luminosas

    Como usar:

    Apenas cole o script acima do main.
    E adicione a imagem abaixo na pasta pictures do seu projeto com o nome de le.png
    Crie um evento com um comentário.. FIRE e talz, tem as instruções no script.

    Script de Light Effects (muito bom!) 66163800

    Créditos
    # 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
    # Disponibilizado por Massakmkz
    Vinks por disponibilizar aqui.




    Última edição por Vinks em Sex Jan 13, 2012 4:41 pm, editado 1 vez(es)


    _________________



    Ninguém pode ser perfeito, mas todos podem ser melhores.
    Visite o meu projeto, Tales of a Kingdom e prepare-se para um novo mundo!




    Thuskie gosta desta mensagem

    Reborn
    Reborn
    Experiente
    Experiente


    Mensagens : 500
    Créditos : 28

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Reborn Sex Jan 13, 2012 4:34 pm

    Ta faltando os créditos:
    # 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
    # Disponibilizado por Massakmkz

    Achei um muito melhor... haeuhaeuheuheaue, só que qualquer um pode achar ;P Só procurar... Mas esse também é bom...


    _________________
    Que o pão de queijo esteja com vocês, até!
    wallace123
    wallace123
    Aldeia Friend
    Aldeia Friend


    Medalhas : Script de Light Effects (muito bom!) 94JxvScript de Light Effects (muito bom!) ICU4UuCrHDm5AScript de Light Effects (muito bom!) Ibnth6gSDk98m7Script de Light Effects (muito bom!) ZgLkiRU
    Mensagens : 1161
    Créditos : 38

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por wallace123 Sex Jan 13, 2012 4:38 pm

    hm... gostei vou usar no meu projeto !

    +1 créd

    Ah você esqueceu dos créditos...
    mesmo havendo os créditos no script tem que haver também no tópico Successful.

    EDIT : na msm hora que eu vou postar outro cara posta Fury


    _________________
    https://www.facebook.com/wallace.o.b
    Curta, interaja, compartilhe. :)
    Satheios
    Satheios
    Aldeia Friend
    Aldeia Friend


    Medalhas : Script de Light Effects (muito bom!) Trophy12Script de Light Effects (muito bom!) IlSfE
    Mensagens : 1248
    Créditos : 306

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Satheios Sex Jan 13, 2012 4:42 pm

    wallace123 escreveu:hm... gostei vou usar no meu projeto !

    +1 créd

    Ah você esqueceu dos créditos...
    mesmo havendo os créditos no script tem que haver também no tópico Successful.

    EDIT : na msm hora que eu vou postar outro cara posta Fury

    Cade meu créd? Zoa xD
    Ahm, eu coloquei os créditos antes dos dois postarem .. Eu tinha esquecido msm xD


    _________________



    Ninguém pode ser perfeito, mas todos podem ser melhores.
    Visite o meu projeto, Tales of a Kingdom e prepare-se para um novo mundo!




    Nanzin
    Nanzin
    Membro de Honra
    Membro de Honra


    Mensagens : 1550
    Créditos : 252

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Nanzin Sex Jan 13, 2012 4:55 pm

    Beeem antiguinho esse script em xD

    obrigado por postar + 1


    _________________
    Script de Light Effects (muito bom!) Npvo

    Para Aqueles que gostam de Min e de meu Trabalho;
    Upem Meu Pet nao custa nda!!


    Pet:
    Vxxx12
    Vxxx12
    Semi-Experiente
    Semi-Experiente


    Mensagens : 131
    Créditos : 5

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Vxxx12 Sáb maio 12, 2012 4:01 pm

    Mal por ressusitar o topico, mas é que tem um bug, a imagem da luz nn fica no evento, ela fica na tela e nao no mapa, quando eu ando a imagem anda junto com a tela. Alguem sabe como concertar? Eu nn mexi no script, deixei ele do jeito q ta, e no evento eu escrevi FIRE em comentario. Tem algo q coloquei errado?


    _________________
    Script de Light Effects (muito bom!) FJ8Rp19
    jiraya
    jiraya
    Membro Ativo
    Membro Ativo


    Mensagens : 293
    Créditos : 26

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por jiraya Seg maio 21, 2012 12:18 pm

    Me ajudou muito obrigdo!


    _________________
    [roll="Ataque nível 1"]

    Se escrevam no meu Canal no Youtube:  Eberton Munhoz
           
    Daniel Carvalho
    Daniel Carvalho
    Ocasional
    Ocasional


    Mensagens : 231
    Créditos : 19

    Ficha do personagem
    Nível: 1
    Experiência:
    Script de Light Effects (muito bom!) Left_bar_bleue0/50Script de Light Effects (muito bom!) Empty_bar_bleue  (0/50)
    Vida:
    Script de Light Effects (muito bom!) Left_bar_bleue30/30Script de Light Effects (muito bom!) Empty_bar_bleue  (30/30)

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Daniel Carvalho Ter maio 22, 2012 1:04 am

    Muito bom! perfeito gostei de mais (:

    +1 cred
    Kirito
    Kirito
    Iniciante
    Iniciante


    Mensagens : 48
    Créditos : 1

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Kirito Dom Set 09, 2012 1:51 pm

    Tem como integra-lo ao sistema de dia e noite? É que tipo, eu queria que só acendesse quando chegasse uma certa hora que no caso seria 18(é p/ NPm4)... tem como ele ativar apenas quando der o horário e depois desativar sozinho?


    _________________
    Script de Light Effects (muito bom!) U8NqxScript de Light Effects (muito bom!) TUI0gScript de Light Effects (muito bom!) 94IB2Script de Light Effects (muito bom!) GCXUUScript de Light Effects (muito bom!) VzJL6Script de Light Effects (muito bom!) LYDNEScript de Light Effects (muito bom!) KySneScript de Light Effects (muito bom!) QG0MZ
    Samuka_Maker
    Samuka_Maker
    Aldeia Friend
    Aldeia Friend


    Medalhas : Script de Light Effects (muito bom!) WBLhI
    Mensagens : 1204
    Créditos : 127

    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Samuka_Maker Dom Set 09, 2012 1:54 pm

    Cara não re-viva tópicos

    ele é sim compativel com dia e noite

    e para isso se não me engano estude sobre envio de packets


    _________________

    Life rpg maker, suporte para criacao de jgoos online eoffline, link do forum:(v2.0)
    http://liferpgmakerv2.forumais.com/

    Script de Light Effects (muito bom!) 6f4EA

    Script de Light Effects (muito bom!) Bxvno
    Tópico original/Tópico de Recrutamento

    Conteúdo patrocinado


    Script de Light Effects (muito bom!) Empty Re: Script de Light Effects (muito bom!)

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Ter Mar 19, 2024 1:50 am