Страница 81 из 147 ПерваяПервая ... 3171798081828391131 ... ПоследняяПоследняя
Показано с 801 по 810 из 1470

Тема: Помощь с скриптами (RGSS)

  1. #801

  2. #802

    По умолчанию

    Ну так у тебя скрипт этот не вставлен совсем в проект.
    Создай категорию в Редакторе скриптов перед твоим 1.

    Имя: MOG_Chain_Commands
    Код:
    #===============================================================================
    # +++ MOG - Chain Commands (v1.4) +++
    #===============================================================================
    # By Moghunter                                                                
    # http://www.atelier-rgss.com                      
    #===============================================================================
    # Sistema de sequência de botões para ativar switchs. 
    # 
    # Serão necessárias as seguintes imagens. (Graphics/System)
    #
    # Chain_Cursor.png
    # Chain_Command.png
    # Chain_Layout.png
    # Chain_Timer_Layout.png
    # Chain_Timer_Meter.png
    #
    #===============================================================================
    #
    # Para ativar o script use o comando abaixo.  (*Call Script)
    #
    # chain_commands(ID)
    #
    # ID - Id da switch.
    #
    #===============================================================================
    
    #==============================================================================
    # ● Histórico (Version History)
    #==============================================================================
    # v 1.4 - Correção do crash aleatório.
    # v 1.3 - Melhoria no sistema de dispose
    # v 1.2 - Melhoria na codificação e correção de alguns glitches.
    # v 1.1 - Animação de fade ao sair da cena de chain.
    #       - Opção de definir a prioridade da hud na tela.
    #==============================================================================
    
    module MOG_CHAIN_COMMANDS 
     #==============================================================================
     # CHAIN_COMMAND = { SWITCH_ID => [COMMAND] }
     #
     # SWITCH_ID = ID da switch 
     # COMMANDS = Defina aqui a sequência de botões. 
     #            (Para fazer a sequência use os comandos abaixo)   
     #  
     # "Down" ,"Up" ,"Left" ,"Right" ,"Shift" ,"D" ,"S" ,"A" ,"Z" ,"X" ,"Q" ,"W"
     # 
     # Exemplo de utilização
     #
     # CHAIN_SWITCH_COMMAND = { 
     # 25=>["Down","D","S","Right"],
     # 59=>["Down","Up","Left","Right","Shift","D","S","A","Z","X","Q","W"],
     # 80=>["Shift","D"]
     # } 
     #==============================================================================
     CHAIN_SWITCH_COMMAND = {
     5=>["X","Right","Left","Z","Z"], 
     6=>["Left","Right","Left","Right","Left","Right","Q","Z","Up","A","S",
          "Down","D","Z","Right","Up","Up","Z","W","Left","Down","D","A","W"],
     8=>["Up","Down","Left","Right","Z"]}
     #Duração para colocar os comandos. (A duração é multiplicado pela quantidade
     #de comandos) *60 = 1 sec
     CHAIN_INPUT_DURATION = 30 
     #Som ao acertar. 
     CHAIN_RIGHT_SE = "Chime1"
     #Som ao errar.
     CHAIN_WRONG_SE = "Buzzer1"
     #Switch que ativa o modo automático.
     CHAIN_AUTOMATIC_MODE_SWITCH_ID = 20
     #Definição da prioridade da hud na tela
     CHAIN_HUD_Z = 300
    end
    
    
    #===============================================================================
    # ■ Chain Commands
    #===============================================================================
    class Chain_Commands 
       include MOG_CHAIN_COMMANDS 
     #--------------------------------------------------------------------------
     # ● Initialize
     #--------------------------------------------------------------------------       
      def initialize
          @action_id = $game_temp.chain_switch_id
          @chain_command = CHAIN_SWITCH_COMMAND[@action_id]
          @chain_command = ["?"] if @chain_command == nil  
          duration = [[CHAIN_INPUT_DURATION, 1].max, 9999].min
          @timer_max = duration * @chain_command.size
          @timer = @timer_max
          @slide_time = [[60 / duration, 10].max, 60].min
          @change_time = 0
          if $game_switches[CHAIN_AUTOMATIC_MODE_SWITCH_ID] 
             @auto = true
          else
             @auto = false
          end
          @com = 0  
      end    
      
     #--------------------------------------------------------------------------
     # ● Main
     #--------------------------------------------------------------------------     
     def main
         dispose
         @background_sprite = Sprite.new
         @background_sprite.bitmap = SceneManager.background_bitmap2
         create_chain_command
         create_cusrsor
         create_layout
         create_meter
         create_text
         create_number 
         Graphics.transition
         loop do
              Graphics.update
               Input.update
               update
               break if SceneManager.scene != self
         end
         dispose
     end  
          
     #--------------------------------------------------------------------------
     # ● Create Cursor
     #--------------------------------------------------------------------------             
     def create_cusrsor
         @fy_time = 0
         @fy = 0
         @com_index = 0
         @cursor = Sprite.new
         @cursor.bitmap = Cache.system("Chain_Cursor")
         @cursor.z = 4 + CHAIN_HUD_Z
         @cursor_space = ((@bitmap_cw + 5) * @chain_command.size) / 2
         if @chain_command.size <= 20
            @cursor.x = (544 / 2) - @cursor_space + @cursor_space * @com_index 
         else   
            @cursor.x = (544 / 2)
         end  
         @cursor.y = (416 / 2) + 30    
     end 
     
     #--------------------------------------------------------------------------
     # ● Create Chain Command
     #--------------------------------------------------------------------------       
     def create_chain_command
         @image = Cache.system("Chain_Command")     
         width_max = ((@image.width / 13) + 5) * @chain_command.size
         @bitmap = Bitmap.new(width_max,@image.height * 2)
         @bitmap_cw = @image.width / 13
         @bitmap_ch = @image.height  
         index = 0
         for i in @chain_command
             command_list_check(i) 
             bitmap_src_rect = Rect.new(@com * @bitmap_cw, 0, @bitmap_cw, @bitmap_ch)
             if index == 0
                @bitmap.blt(index * (@bitmap_cw + 5) , 0, @image, bitmap_src_rect)
             else
                @bitmap.blt(index * (@bitmap_cw + 5) , @bitmap_ch, @image, bitmap_src_rect)
             end
             index += 1
         end
         @sprite = Sprite.new
         @sprite.bitmap = @bitmap
         if @chain_command.size <= 15
            @sprite.x = (544 / 2) - ((@bitmap_cw + 5) * @chain_command.size) / 2
            @new_x = 0
         else   
            @sprite.x = (544 / 2)
            @new_x = @sprite.x 
         end   
         @sprite.y = (416 / 2) + 30  - @bitmap_ch  - 15
         @sprite.z = 3 + CHAIN_HUD_Z
         @sprite.zoom_x = 1.5
         @sprite.zoom_y = 1.5
     end
     
     #--------------------------------------------------------------------------
     # * create_layout
     #--------------------------------------------------------------------------  
     def create_layout
         @back = Plane.new
         @back.bitmap = Cache.system("Chain_Layout")
         @back.z = 0
         @layout = Sprite.new
         @layout.bitmap = Cache.system("Chain_Timer_Layout")
         @layout.z = 1 + CHAIN_HUD_Z
         @layout.x = 160
         @layout.y = 150
      end
    
     #--------------------------------------------------------------------------
     # * create_meter
     #--------------------------------------------------------------------------  
     def create_meter
         @meter_flow = 0
         @meter_image = Cache.system("Chain_Timer_Meter")
         @meter_bitmap = Bitmap.new(@meter_image.width,@meter_image.height)
         @meter_range = @meter_image.width / 3
         @meter_width = @meter_range * @timer / @timer_max
         @meter_height = @meter_image.height
         @meter_src_rect = Rect.new(@meter_range, 0, @meter_width, @meter_height)
         @meter_bitmap.blt(0,0, @meter_image, @meter_src_rect) 
         @meter_sprite = Sprite.new
         @meter_sprite.bitmap = @meter_bitmap
         @meter_sprite.z = 2 + CHAIN_HUD_Z
         @meter_sprite.x = 220
         @meter_sprite.y = 159
         update_flow
     end  
     
     #--------------------------------------------------------------------------
     # ● Create Text
     #--------------------------------------------------------------------------        
     def create_text 
         @text = Sprite.new
         @text.bitmap = Bitmap.new(200,32)
         @text.z = 2 + CHAIN_HUD_Z
         @text.bitmap.font.name = "Georgia"
         @text.bitmap.font.size = 25
         @text.bitmap.font.bold = true
         @text.bitmap.font.italic = true
         @text.bitmap.font.color.set(255, 255, 255,220)
         @text.x = 230
         @text.y = 100
     end
     
     #--------------------------------------------------------------------------
     # ● Create Number
     #--------------------------------------------------------------------------        
     def create_number 
         @combo = 0
         @number = Sprite.new
         @number.bitmap = Bitmap.new(200,64)
         @number.z = 2 + CHAIN_HUD_Z
         @number.bitmap.font.name = "Arial"
         @number.bitmap.font.size = 24
         @number.bitmap.font.bold = true
         @number.bitmap.font.color.set(0, 255, 255,200)
         @number.bitmap.draw_text(0, 0, 200, 32, "Ready",1)         
         @number.x = 30
         @number.y = 100
     end 
     
     #--------------------------------------------------------------------------
     # ● Pre Dispose
     #--------------------------------------------------------------------------       
     def exit
         loop do 
             Graphics.update
             @sprite.x += 5 
             @layout.x -= 5
             @meter_sprite.x -= 5
             @text.x -= 2
             @text.opacity -= 5
             @sprite.opacity -= 5
             @layout.opacity -= 5
             @meter_sprite.opacity -= 5 
             @number.opacity -= 5
             @back.opacity -= 5
             @cursor.visible = false    
             break if @sprite.opacity == 0
         end
         SceneManager.call(Scene_Map)
     end
       
     #--------------------------------------------------------------------------
     # ● Dispose
     #--------------------------------------------------------------------------      
     def dispose
         return if @layout == nil
         Graphics.freeze
         @background_sprite.bitmap.dispose
         @background_sprite.dispose
         @bitmap.dispose
         @sprite.bitmap.dispose
         @sprite.dispose
         @cursor.bitmap.dispose
         @cursor.dispose  
         @meter_image.dispose
         @meter_bitmap.dispose
         @meter_sprite.bitmap.dispose
         @meter_sprite.dispose
         @layout.bitmap.dispose  
         @layout.dispose
         @layout = nil
         @back.bitmap.dispose
         @back.dispose
         @text.bitmap.dispose
         @text.dispose
         @number.bitmap.dispose
         @number.dispose
         @image.dispose 
     end
     
     #--------------------------------------------------------------------------
     # ● Update
     #--------------------------------------------------------------------------      
     def update
         update_command
         update_cursor_slide
         update_flow
         update_change_time
     end
     
     #--------------------------------------------------------------------------
     # ● Change_Time
     #--------------------------------------------------------------------------        
     def update_change_time
         return unless @auto
         @change_time += 1
         check_command(-1) if @change_time >= CHAIN_INPUT_DURATION - 1
     end
     
     #--------------------------------------------------------------------------
     # ● Update Flow
     #--------------------------------------------------------------------------       
     def update_flow
         @timer -= 1
         @meter_sprite.bitmap.clear
         @meter_width = @meter_range * @timer / @timer_max
         @meter_src_rect = Rect.new(@meter_flow, 0, @meter_width, @meter_height)
         @meter_bitmap.blt(0,0, @meter_image, @meter_src_rect)  
         @meter_flow += 20 
         @meter_flow = 0 if @meter_flow >= @meter_image.width - @meter_range       
         wrong_command if @timer == 0 and @auto == false
      end  
       
     #--------------------------------------------------------------------------
     # ● Update Command
     #--------------------------------------------------------------------------       
     def update_command
         return if @auto
         if Input.trigger?(Input::X)
            check_command(0)
         elsif Input.trigger?(Input::Z)  
            check_command(1)
         elsif Input.trigger?(Input::Y)  
            check_command(2)
         elsif Input.trigger?(Input::A)    
            check_command(3)
         elsif Input.trigger?(Input::C)           
            check_command(4)
         elsif Input.trigger?(Input::B)        
            check_command(5)
         elsif Input.trigger?(Input::L)        
            check_command(6)
         elsif Input.trigger?(Input::R)        
            check_command(7)        
         elsif Input.trigger?(Input::RIGHT)      
            check_command(8)
         elsif Input.trigger?(Input::LEFT)
            check_command(9)
         elsif Input.trigger?(Input::DOWN)
            check_command(10)
         elsif Input.trigger?(Input::UP)  
            check_command(11)
         end   
     end  
       
     #--------------------------------------------------------------------------
     # ● command_list_check
     #--------------------------------------------------------------------------       
     def command_list_check(command) 
         case command
             when "A"
                @com = 0  
             when "D"
                @com = 1  
             when "S"
                @com = 2
             when "Shift"
                @com = 3
             when "Z" 
                @com = 4
             when "X"
                @com = 5
             when "Q"
                @com = 6
             when "W"
                @com = 7            
             when "Right"
                @com = 8
             when "Left"
                @com = 9
             when "Down"
                @com = 10
             when "Up"  
                @com = 11
             else   
                @com = 12           
         end 
     end   
     
     #--------------------------------------------------------------------------
     # ● check_command
     #--------------------------------------------------------------------------            
     def check_command(com)
         index = 0
         if com != -1
            right_input = false
            for i in @chain_command
               if index == @com_index
                  command_list_check(i) 
                  right_input = true if @com == com
               end  
              index += 1  
           end  
         else  
           command_list_check(@com_index)
           @change_time = 0
           right_input = true
         end  
         if right_input 
            refresh_number
            next_command
         else  
            wrong_command
         end  
     end  
       
     #--------------------------------------------------------------------------
     # ● Next Command
     #--------------------------------------------------------------------------            
     def next_command   
         @com_index += 1   
         Audio.se_play("Audio/SE/" + CHAIN_RIGHT_SE, 100, 100)
         if @com_index == @chain_command.size
            $game_switches[@action_id] = true
            exit
            $game_map.need_refresh = true
         end  
         refresh_command 
         refresh_text(0) 
     end     
     
     #--------------------------------------------------------------------------
     # ● wrong_command
     #--------------------------------------------------------------------------              
     def wrong_command
         Audio.se_play("Audio/SE/" + CHAIN_WRONG_SE, 100, 100)
         refresh_text(1)
         exit
         $game_player.jump(0,0)
     end
       
     #--------------------------------------------------------------------------
     # ● Refresh Command
     #--------------------------------------------------------------------------                
     def refresh_command
         @sprite.bitmap.clear
         index = 0
         for i in @chain_command
             command_list_check(i) 
             bitmap_src_rect = Rect.new(@com * @bitmap_cw, 0, @bitmap_cw, @bitmap_ch)
             if @com_index == index
                @bitmap.blt(index * (@bitmap_cw + 5) , 0, @image, bitmap_src_rect)
             else
                @bitmap.blt(index * (@bitmap_cw + 5) , @bitmap_ch, @image, bitmap_src_rect)
             end
             index += 1
           end
         if @chain_command.size > 15  
            @new_x = (544 / 2) - ((@bitmap_cw + 5) * @com_index)
         else   
            @cursor.x = (544 / 2) - @cursor_space + ((@bitmap_cw + 5) * @com_index)
         end
     end  
     
     #--------------------------------------------------------------------------
     # ● Refresh Text
     #--------------------------------------------------------------------------               
     def refresh_text(type)
         @text.bitmap.clear
         if type == 0
            if @com_index == @chain_command.size
               @text.bitmap.font.color.set(55, 255, 55,220)
               @text.bitmap.draw_text(0, 0, 200, 32, "Perfect!",1)              
            else  
               @text.bitmap.font.color.set(55, 155, 255,220)
               @text.bitmap.draw_text(0, 0, 200, 32, "Success!",1)              
            end
         else
            @text.bitmap.font.color.set(255, 155, 55,220)
            if @timer == 0
               @text.bitmap.draw_text(0, 0, 200, 32, "Time Limit!",1)  
            else  
               @text.bitmap.draw_text(0, 0, 200, 32, "Fail!",1)   
            end
         end  
         @text.x = 230   
         @text.opacity = 255 
     end
     
     #--------------------------------------------------------------------------
     # ● Refresh Number
     #--------------------------------------------------------------------------               
     def refresh_number
         @combo += 1
         @number.bitmap.clear
         @number.bitmap.font.size = 34
         @number.bitmap.draw_text(0, 0, 200, 32, @combo.to_s,1)          
         @number.opacity = 255 
         @number.zoom_x = 2
         @number.zoom_y = 2
     end 
     
     #--------------------------------------------------------------------------
     # ● Update Cursor Slide
     #--------------------------------------------------------------------------           
     def update_cursor_slide    
         @sprite.zoom_x -= 0.1 if @sprite.zoom_x > 1
         @sprite.zoom_y -= 0.1 if @sprite.zoom_y > 1
         @text.x -= 2 if @text.x > 210 
         @text.opacity -= 5 if @text.opacity > 0
         @sprite.x -= @slide_time if @sprite.x > @new_x and @chain_command.size > 15
         if @number.zoom_x > 1
            @number.zoom_x -= 0.1
            @number.zoom_y -= 0.1
         end
         if @fy_time > 15
            @fy += 1
         elsif @fy_time > 0
            @fy -= 1
         else   
            @fy = 0
            @fy_time = 30
         end  
         @fy_time -= 1 
         @cursor.oy = @fy     
     end  
    end
    
    #==============================================================================
    # ■ Game Temp
    #==============================================================================
    class Game_Temp
    
     attr_accessor :chain_switch_id
     
     #--------------------------------------------------------------------------
     # ● Initialize
     #--------------------------------------------------------------------------         
      alias mog_chain_commands_initialize initialize
      def initialize
          @chain_switch_id = 0
          mog_chain_commands_initialize
      end  
        
    end
    
    #==============================================================================
    # ■ Game_Interpreter
    #==============================================================================
    class Game_Interpreter
      
     #--------------------------------------------------------------------------
     # ● Chain Commands
     #--------------------------------------------------------------------------           
      def chain_commands(switch_id = 0)
          return if switch_id <= 0
          $game_temp.chain_switch_id = switch_id
          SceneManager.call(Chain_Commands)
          wait(1)
      end
      
    end
    
    #===============================================================================
    # ■ SceneManager
    #===============================================================================
    class << SceneManager
      @background_bitmap2 = nil
      
      #--------------------------------------------------------------------------
      # ● Snapshot For Background2
      #--------------------------------------------------------------------------
      def snapshot_for_background2
          @background_bitmap2.dispose if @background_bitmap2
          @background_bitmap2 = Graphics.snap_to_bitmap
      end
      
      #--------------------------------------------------------------------------
      # ● Background Bitmap2
      #--------------------------------------------------------------------------
      def background_bitmap2
          @background_bitmap2
      end
      
    end
    
    #===============================================================================
    # ■ Scene Map
    #===============================================================================
    class Scene_Map < Scene_Base
      
      #--------------------------------------------------------------------------
      # ● Terminate
      #--------------------------------------------------------------------------  
      alias mog_chain_commands_terminate terminate
      def terminate
          SceneManager.snapshot_for_background2
          mog_chain_commands_terminate      
      end
      
    end  
    
    $mog_rgss3_chain_commands = true


    Dropbox — бесплатное хранилище файлов с прямыми ссылками.

    Humble Bundle — игры, подборки и наборы со скидками.

  3. #803
    Пользователь Аватар для E-10000-g
    Информация о пользователе
    Регистрация
    10.07.2012
    Сообщений
    39
    Репутация: 0 Добавить или отнять репутацию

    По умолчанию

    Спасибо, помогло.

  4. #804
    Местный Аватар для silverlexx
    Информация о пользователе
    Регистрация
    25.07.2011
    Адрес
    Украина, г. Харьков
    Сообщений
    215
    Записей в дневнике
    2
    Репутация: 19 Добавить или отнять репутацию

    По умолчанию

    Всем привет. Решил освоить два скрипта в Асе и возникли 2 нубских вопроса:
    1) Куда нужно положить новый шрифт, что бы игра могла его подхватить?
    2) В круговом меню можно убрать окно с информацией о локации в которой находишься?

    Подробнее + решенные проблемы.
    Использую скрипты:
    1) Титульного экрана v1.1
    Скрипт #1 Сейфер Kr сайт: http://rpgvxa.3nx.ru/
    Позволяет выбирать шрифт, цвет, размер и расположение Названия на титульном листе. + мелкие настройки. У меня проблема с добавлением шрифта. Не разу таким не занимался, а подробной инструкции не встречал.
    2) Ring Menu by Syvkal
    Version 1.0
    Была проблема с переводом слова "Load" в База данных/термины, но нашел решение этой проблемы в скрипте, строка:

    Vocab::Load = "Загрузить"

    Можно задать любое значение.
    Так же не знал куда разместить изображения иконок для кругового меню.
    Решение: Проект\Graphics\Pictures\
    Притом нужно сохранять Иконки с английскими названиями и копии с русскими. Это обусловлено использованием русифицированного мейкера. Возможно можно было внести изменение в скрипте, но я решил таким способом.
    Последний раз редактировалось silverlexx; 11.10.2012 в 14:37.
    "Не можешь писать - не пиши. Можешь писать - не пиши. А вот если не можешь не писать - тогда пиши, что ж с тобой делать. Может тогда что-то путное выйдет."

  5. #805
    Местный Аватар для silverlexx
    Информация о пользователе
    Регистрация
    25.07.2011
    Адрес
    Украина, г. Харьков
    Сообщений
    215
    Записей в дневнике
    2
    Репутация: 19 Добавить или отнять репутацию

    По умолчанию

    Часть вопросов решил сам, остальное оставил, но наверное стоит теперь это перенести из скриптов в общие вопросы.
    Последний раз редактировалось silverlexx; 11.10.2012 в 13:11.
    "Не можешь писать - не пиши. Можешь писать - не пиши. А вот если не можешь не писать - тогда пиши, что ж с тобой делать. Может тогда что-то путное выйдет."

  6. #806

    По умолчанию

    Цитата Сообщение от silverlexx Посмотреть сообщение
    Часть вопросов решил сам, остальное оставил, но наверное стоит теперь это перенести из скриптов в общие вопросы.
    Ты бы отредактировал свое сообщение и написал те вопросы, которые решил и как, плюс точные названия скриптов (на английском я полагаю).
    Таким образом в поиске можно было бы найти их, если кто-то столкнется.


    Dropbox — бесплатное хранилище файлов с прямыми ссылками.

    Humble Bundle — игры, подборки и наборы со скидками.

  7. #807
    Новичок Аватар для Король-Бог
    Информация о пользователе
    Регистрация
    09.11.2012
    Сообщений
    13
    Записей в дневнике
    1
    Репутация: 5 Добавить или отнять репутацию

    По умолчанию

    Эм, работаю на VX Ace...
    Друзья мои, возможно ли сделать так, чтобы при появлении фразы "Battle!" еще и проигрывался определенный звук?
    Спойлер Script:
    Код:
    #==============================================================================
    # 
    # ▼ YSA Battle Add-On: Battle Start Phrase
    # -- Last Updated: 2011.12.19
    # -- Level: Easy
    # -- Requires: none
    # 
    #==============================================================================
    
    $imported = {} if $imported.nil?
    $imported["YSA-BattleStartPhrase"] = true
    
    #==============================================================================
    # ▼ Updates
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # 2011.12.19 - Started Script and Finished.
    # 
    #==============================================================================
    # ▼ Introduction
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script will show a phrase when battle start, like "BATTLE START!!!".
    # 
    #==============================================================================
    # ▼ Instructions
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # To install this script, open up your script editor and copy/paste this script
    # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
    # 
    #==============================================================================
    # ▼ Compatibility
    # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
    # it will run with RPG Maker VX without adjusting.
    # 
    #==============================================================================
    
    #==============================================================================
    # ▼ Editting anything past this point may potentially result in causing
    # computer damage, incontinence, explosion of user's head, coma, death, and/or
    # halitosis so edit at your own risk.
    #==============================================================================
    
    module YSA
      module BATTLE_VISUAL
        
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # - Battle Start Text -
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        # This section will contain configuration of Battle Start Text.
        #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
        BATTLE_START_TEXT = "Battle!"
        BATTLE_START_TEXT_FONT = "Bleeding Cowboys"
        BATTLE_START_TEXT_SIZE = 80
        BATTLE_START_TEXT_COLOR = [255, 255, 255] # R, G, B
        BATTLE_START_TEXT_DURATION = 60 # Frames, must be larger than 20 frames
        
      end
    end
    
    #==============================================================================
    # ■ Spriteset_Battle
    #==============================================================================
    
    class Spriteset_Battle
      
      #--------------------------------------------------------------------------
      # public instance variables
      #--------------------------------------------------------------------------
      attr_accessor :viewportBSS
      
      #--------------------------------------------------------------------------
      # alias method: create_viewports
      #--------------------------------------------------------------------------
      alias bss_create_viewports create_viewports
      def create_viewports
        bss_create_viewports
        @viewportBSS = Viewport.new
        @viewportBSS.z = 200
      end
    end
    
    #==============================================================================
    # ■ Sprite_Battle_Start
    #==============================================================================
    
    class Sprite_Battle_Start < Sprite_Base
      
      #--------------------------------------------------------------------------
      # initialize
      #--------------------------------------------------------------------------
      def initialize(viewport)
        super(viewport)
        self.y = Graphics.height / 2
        self.opacity = 255 - 5 * (YSA::BATTLE_VISUAL::BATTLE_START_TEXT_DURATION / 2)
        @frame = 0
        refresh
      end
      
      #--------------------------------------------------------------------------
      # refresh
      #--------------------------------------------------------------------------
      def refresh
        bitmap = Bitmap.new(Graphics.width, YSA::BATTLE_VISUAL::BATTLE_START_TEXT_SIZE)
        bitmap.font.name = YSA::BATTLE_VISUAL::BATTLE_START_TEXT_FONT
        bitmap.font.size = YSA::BATTLE_VISUAL::BATTLE_START_TEXT_SIZE
        bitmap.font.bold = true
        bitmap.font.out_color.set(0, 0, 0, 255)
        color = YSA::BATTLE_VISUAL::BATTLE_START_TEXT_COLOR
        bitmap.font.color.set(color[0], color[1], color[2])
        text = YSA::BATTLE_VISUAL::BATTLE_START_TEXT
        bitmap.draw_text(0, 0, Graphics.width, YSA::BATTLE_VISUAL::BATTLE_START_TEXT_SIZE, text, 1)
        self.y -= YSA::BATTLE_VISUAL::BATTLE_START_TEXT_SIZE
        self.bitmap = bitmap    
        self.zoom_x = self.zoom_y = 3.0
      end
      
      #--------------------------------------------------------------------------
      # update
      #--------------------------------------------------------------------------
      def update
        @frame += 1
        if self.opacity < 255
          self.opacity += 5
          if self.zoom_x > 1.0
            self.zoom_x -= 0.2
            self.zoom_y -= 0.2
          end
        end
        if @frame >= YSA::BATTLE_VISUAL::BATTLE_START_TEXT_DURATION
          self.x += 32
        end
        self.dispose if self.x >= Graphics.width
      end
      
    end # Sprite_Battle_Start
    
    #==============================================================================
    # ■ Scene_Battle
    #==============================================================================
    
    class Scene_Battle < Scene_Base
      
      #--------------------------------------------------------------------------
      # public instance variables
      #--------------------------------------------------------------------------
      attr_accessor :spriteset unless $imported["YEA-BattleEngine"]
      
      #--------------------------------------------------------------------------
      # alias method: update_basic
      #--------------------------------------------------------------------------
      alias update_basic_battle_start_sprite update_basic
      def update_basic
        update_basic_battle_start_sprite
        @bs_sprite.update if @bs_sprite != nil
        @bs_sprite = nil if @bs_sprite != nil && @bs_sprite.disposed?
      end
      
      #--------------------------------------------------------------------------
      # alias method: battle_start
      #--------------------------------------------------------------------------
      alias battle_start_show_sprite battle_start
      def battle_start
        @bs_sprite = Sprite_Battle_Start.new(SceneManager.scene.spriteset.viewportBSS)
        abs_wait(YSA::BATTLE_VISUAL::BATTLE_START_TEXT_DURATION + Graphics.width / 32)
        battle_start_show_sprite
      end
      
    end # Scene_Battle
    
    #==============================================================================
    # 
    # ▼ End of File
    # 
    #==============================================================================

  8. #808
    Хранитель Аватар для Темный
    Информация о пользователе
    Регистрация
    13.05.2011
    Сообщений
    2,449
    Записей в дневнике
    20
    Репутация: 50 Добавить или отнять репутацию

    По умолчанию

    Интересно Скриптеры на форуме живы?
    Есть вот такой вопрос. Есть скрипт показа жизни врагов простенький но
    в нем есть один раздражающий момент((


    надо убрать белую стрелку.

    вот скрипт:

    #================================================= ===========================
    #Enemy HUD
    #By Ventwig
    #Version 1.4 - July 29 2012
    #For RPGMaker VX Ace
    #================================================= ===========================
    # Here's another window-ish thing to show HP
    # Thanks Shaz for helping me out with this one
    # Thanks ItsKouta for showing me a horrible bug!
    # Thanks to #tag-this for helping with the hide numbers option!
    # Thanks Helladen for pointing out a small error!
    # Thanks Ulises for helping with the hurdle of not having RMVXA with me!
    #================================================= ============================
    # Description:
    # This code shows the name and HP for up to 8 enemies at once.
    # Plug'N'Play and the HP bar updates after every hit/kill.
    # You can also set it so the numbers are hidden! Oooh!
    # Options to scan enemies, show MP, or states will be added.
    #================================================= =============================
    # Compatability:
    # alias-es Game_Enemy and Scene_Battle
    # Works with Neo Gauge Ultimate Ace (Recommended)
    #================================================= ==============================
    # Instructions: Put in materials, above main. Almost Plug and Play
    # Put above Neo Gauge Ultimate Ace if used
    #================================================= =============================
    # Please give Credit to Ventwig if you would like to use one of my scripts
    # in a NON-COMMERCIAL project.
    # Please ask for permission if you would like to use it in a commercial game.
    # You may not re-distribute any of my scripts or claim as your own.
    # You may not release edits without permission, combatability patches are okay.
    #================================================= ==============================
    module EHUD
    #t/f - choose whether or not to make the background appear.
    WINDOW_BACK = false
    #Number, choose how long to wait between attacks (to let the player look
    #at the HP bars. Recommended 4-6
    WINDOW_WAIT = 5
    #Chooses the Y value of the window. Recommended 20.
    WINDOW_Y = 60

    #Decides whether or not to show the HP numbers/etc/etc.
    #0 means normal (HP name, current and max hp)
    #1 means hidden max hp
    #2 means just the bar and the word hp
    DRAW_HP_NUMBERS = 0
    #Selects whether or not you have Neo Gauge Ultimate Ace.
    #If the above is set to [[true]], this doesnt matter, if it's false,
    #make sure you have it right!!!
    NEO_ULTIMATE_ACE = false

    ################################################## #########################
    #Boss Gauges - Setup info
    #================================================= =========================
    #In version 1.2, there is now the option to draw longer gauges so bosses look
    #Way cooler (And it works).
    #Now, to set up a boss, you need to make sure the boss is
    #THE FIRST ENEMY IN THE TROOP. If not, then there won't be a boss gauge.
    #
    #Next, please note that if you want to draw the boss gauge, you have to make
    #Sure that the troop only has 5 enemies, counting the boss.
    #So a Demon and 4 spiders is allowed, but not a Demon and 6 spiders.
    #
    #Also, you can put multiple bosses in one troop but a gauge will only be
    #drawn for the first one, even when it's killed.
    #================================================= ==========================
    #Now, to set up bosses, make it like the example below
    #BOSS_ENEMY[Enemyid for the boss] = true
    #TRUE IS REQUIRED FOR IT TO WORK
    #
    #Don't worry, you don't need to put false for non-bosses.
    #Have Fun!
    ################################################## ##########################

    #How long the boss gauge should be. Def: 475
    BOSS_GAUGE = 200

    #Sets enemies to draw the boss gauges!
    BOSS_ENEMY = [34] #Do not touch
    #BOSS_ENEMY[Enemyid for the boss] = true
    BOSS_ENEMY[1,34] = true

    end

    class Game_Enemy < Game_Battler
    #--------------------------------------------------------------------------
    # * Method Aliases
    #--------------------------------------------------------------------------
    alias shaz_enemyhud_initialize initialize
    #--------------------------------------------------------------------------
    # * Public Instance Variables
    #--------------------------------------------------------------------------
    attr_accessor ld_hp # hp on last hud refresh
    attr_accessor ld_mp # mp on last hud refresh
    #--------------------------------------------------------------------------
    # * Object Initialization
    #--------------------------------------------------------------------------
    def initialize(index, enemy_id)
    shaz_enemyhud_initialize(index, enemy_id)
    @old_hp = mhp
    @old_mp = mmp
    end
    end

    class Window_Enemy_Hud < Window_Base

    ################################################## #################
    #Sets up what appears in the HUD
    #Questions names and HUD, then displays them
    ################################################## ###############
    #Set up the window's start-up
    def initialize
    #Draws window
    super(0,EHUD::WINDOW_Y,545,120)
    if EHUD::WINDOW_BACK == false
    self.opacity = 0
    end
    self.z = 0
    @x, @y = 5, 50
    troop_fix
    if EHUD::BOSS_ENEMY[@enemy1.enemy_id] != nil and EHUD::BOSS_ENEMY[@enemy1.enemy_id] == true
    @boss_troop = true
    @boss_enemy = @enemy1
    else
    @boss_troop = false
    @boss_enemy = nil
    end
    enemy_hud
    refresh
    end



    if EHUD:RAW_HP_NUMBERS == 1
    if EHUD::NEO_ULTIMATE_ACE == false
    def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    change_color(hp_color(actor))
    draw_text(x, y, width, line_height, actor.hp)
    change_color(system_color)
    end
    else
    def draw_actor_hp(actor, x, y, width = 124)
    gwidth = width * actor.hp / actor.mhp
    cg = neo_gauge_back_color
    c1, c2, c3 = cg[0], cg[1], cg[2]
    draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
    HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
    (1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
    draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
    HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
    width, 30)
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    change_color(hp_color(actor))
    draw_text(x, y, width, line_height, actor.hp)
    change_color(system_color)

    end
    end
    end

    if EHUD:RAW_HP_NUMBERS == 2
    if EHUD::NEO_ULTIMATE_ACE == false
    def draw_actor_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    end
    else
    def draw_actor_hp(actor, x, y, width = 124)
    gwidth = width * actor.hp / actor.mhp
    cg = neo_gauge_back_color
    c1, c2, c3 = cg[0], cg[1], cg[2]
    draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
    HPMP_GAUGE_Y_PLUS, width, HPMP_GAUGE_HEIGHT, c1, c2, c3)
    (1..3).each {|i| eval("c#{i} = HP_GCOLOR_#{i}")}
    draw_neo_gauge(x + HPMP_GAUGE_X_PLUS, y + line_height - 8 +
    HPMP_GAUGE_Y_PLUS, gwidth, HPMP_GAUGE_HEIGHT, c1, c2, c3, false, false,
    width, 30)
    end
    end
    end


    def troop_fix
    if $game_troop.alive_members.size > 0
    @enemy1 = $game_troop.alive_members[0]
    end
    if $game_troop.alive_members.size > 1
    @enemy2 = $game_troop.alive_members[1]
    end
    if $game_troop.alive_members.size > 2
    @enemy3 = $game_troop.alive_members[2]
    end
    if $game_troop.alive_members.size > 3
    @enemy4 = $game_troop.alive_members[3]
    end
    if $game_troop.alive_members.size > 4
    @enemy5 = $game_troop.alive_members[4]
    end
    if $game_troop.alive_members.size > 5
    @enemy6 = $game_troop.alive_members[5]
    end
    if $game_troop.alive_members.size > 6
    @enemy7 = $game_troop.alive_members[6]
    end
    if $game_troop.alive_members.size > 7
    @enemy8 = $game_troop.alive_members[7]
    end
    end

    def enemy_hud
    troop_fix
    if $game_troop.alive_members.size > 0
    if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
    draw_actor_name(@enemy1,10,0)
    draw_actor_hp(@enemy1,10,20,width=EHUD::BOSS_GAUGE )
    else
    draw_actor_name(@enemy1,10,0)
    draw_actor_hp(@enemy1,10,20,width=96)
    end
    end
    if $game_troop.alive_members.size > 1
    if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
    draw_actor_name(@enemy2,10,50)
    draw_actor_hp(@enemy2,10,70,width=96)
    else
    draw_actor_name(@enemy2,10+125,0)
    draw_actor_hp(@enemy2,10+125,20,width=96)
    end
    end
    if $game_troop.alive_members.size > 2
    if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
    draw_actor_name(@enemy3,10+125,50)
    draw_actor_hp(@enemy3,10+125,70,width=96)
    else
    draw_actor_name(@enemy3,10+250,0)
    draw_actor_hp(@enemy3,10+250,20,width=96)
    end
    end
    if $game_troop.alive_members.size > 3
    if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
    draw_actor_name(@enemy4,10+250,50)
    draw_actor_hp(@enemy4,10+250,70,width=96)
    else
    draw_actor_name(@enemy4,10+375,0)
    draw_actor_hp(@enemy4,10+375,20,width=96)
    end
    end
    if $game_troop.alive_members.size > 4
    if @boss_troop == true and @boss_enemy.enemy_id == @enemy1.enemy_id
    draw_actor_name(@enemy5,10+375,50)
    draw_actor_hp(@enemy5,10+375,70,width=96)
    else
    draw_actor_name(@enemy5,10,50)
    draw_actor_hp(@enemy5,10,70,width=96)
    end
    end
    if $game_troop.alive_members.size > 5
    if @boss_troop == false
    draw_actor_name(@enemy6,10+125,50)
    draw_actor_hp(@enemy6,10+125,70,width=96)
    end
    end
    if $game_troop.alive_members.size > 6
    if @boss_troop == false
    draw_actor_name(@enemy7,10+250,50)
    draw_actor_hp(@enemy7,10+250,70,width=96)
    end
    end
    if $game_troop.alive_members.size > 7
    if @boss_troop == false
    draw_actor_name(@enemy8,10+375,50)
    draw_actor_hp(@enemy8,10+375,70,width=96)
    end
    end
    end

    def refresh
    contents.clear
    enemy_hud
    @old_size = $game_troop.alive_members.size
    if @old_size < 5 and @boss_troop == false
    self.height = 80
    end
    end

    def update
    # assume no refresh needed
    refresh_okay = false

    # loop through remaining enemies one at a time - each enemy is put into the temporary variable called 'enemy'
    $game_troop.alive_members.each do |enemy|
    # have the hp or mp changed since last time?
    if enemy.hp != enemy.old_hp || enemy.mp != enemy.old_mp
    # we do need to update the hud
    refresh_okay = true
    # and replace the old values with the current values
    enemy.old_hp = enemy.hp
    enemy.old_mp = enemy.mp
    end
    end

    if $game_troop.alive_members.size != @old_size
    refresh_okay = true
    end
    if @boss_enemy != nil
    if @enemy1.enemy_id == @boss_enemy.enemy_id
    @boss_troop = true
    else
    @boss_troop = false
    end
    end

    if refresh_okay
    refresh
    end
    end

    end

    class Window_BattleLog
    alias enemy_hud_battle_log_wait wait_and_clear
    def wait_and_clear
    wait while @num_wait < EHUD::WINDOW_WAIT if line_number > 0
    clear
    end
    end

    #Show the window on the map
    class Scene_Battle < Scene_Base
    alias original_create_all_windows create_all_windows
    def create_all_windows
    original_create_all_windows
    create_enemy_hud_window
    end
    def create_enemy_hud_window
    @enemy_hud_window = Window_Enemy_Hud.new
    end
    end
    ################################################## #######################
    #End Of Script #
    ################################################## #######################



  9. #809
    eXe
    Гость Аватар для eXe

    По умолчанию

    Смени WINDOW_BACK = falce => WINDOW_BACK = true, и будет тебе счастье!

  10. #810
    eXe
    Гость Аватар для eXe

    По умолчанию

    И WINDOW_Y = 0

Страница 81 из 147 ПерваяПервая ... 3171798081828391131 ... ПоследняяПоследняя

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 2 (пользователей: 0 , гостей: 2)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Помощь с скриптами (RGSS)