Войти на сайт

Авторизация, ждите ...
×
Правила раздела:
1 Задавайте конкретные вопросы. Для болтовни есть свободный раздел.
2 По возможности давайте конкретные ответы.
3 Один вопрос=одна тема. Если хотите задать ещё вопрос, то начинайте новую тему.
4 Название темы должно составлять сам вопрос, и быть максимально конкретным. Рекомендуется начинать тему словами "Как", "Что", "Почему". А первый пост повторяет вопрос и даёт расширенные сведения.
5 Рекомендуется указывать версию мейкера (2000, 2003, RMXP, RMVX, ACE, IGM, и.т.д.. Это важно, и всё равно ведь спросят.
6 Темы "Пара вопросов", "Помогите", и подобные им - самый лёгкий путь к бану.
7 Поиск находится вверху справа.
А. Названия подразделов этого раздела уточняются. Советы принимаются.

ТЕМА: Выполнение скрипта после события

Выполнение скрипта после события 9 года 3 мес. назад #76920

  • darkwork
  • darkwork аватар
  • Вне сайта
  • Заблокирован
  • Factory of Evil
  • Сообщений: 244
  • Спасибо получено: 127
Доброго времени суток всем! Делал вступительный ролик в проекте и заметил что во время прокрутки заставок на движке окно худа со здоровьем и маной не пропадает что естественно отвлекает играющего от действия в заставке. Можно ли сделать так чтобы окно худа с показателями гг появлялось только после игрового ролика.
вот скрипт если понадобится:
#==============================================================================
# ¦ Angelo Vertical HUD v1.2
#------------------------------------------------------------------------------
# ?Created by Brandon ***  *** Plug N' Play!
#==============================================================================
 
#------------------------------------------------------------------------------
# Ў Customization Options
#----------------------------#-------------------------------------------------
#   ? HUD_VISIBLE_SWITCH    #
#- - - - - - - - - - - - - #
#  Define the switch that you want to use to turn the HUD 'ON' or 'OFF', by de-
#  fault it's 1. When the switch is turned 'OFF' the HUD will be turned 'ON',
#  and when the switch is turned 'ON' the HUD is turned 'OFF'.
#------------------------------#-----------------------------------------------
#   ? FONT_NAME & FONT_SIZE   #
#- - - - - - - - - - - - - - #
#  In FONTNAME you define the font that you want to use with the HUD information.
#  In FONTSIZE you define the size of the font you've decided in FONTNAME. 
#-------------------#----------------------------------------------------------
#   ? HP_SWITCH    #
#- - - - - - - - -#
#  Define the switch that you want to use to turn the HP Display 'ON' or 'OFF',
#  by default it's 2. When the switch is turned 'OFF' the HP Display will be 
#  turned 'ON', and when the switch is turned 'ON' the HP Display is turned
#  'OFF'.
#-------------------#----------------------------------------------------------
#   ? MP_SWITCH    #
#- - - - - - - - -#
#  Define the switch that you want to use to turn the MP Display 'ON' or 'OFF',
#  by default it's 3. When the switch is turned 'OFF' the MP Display will be 
#  turned 'ON', and when the switch is turned 'ON' the MP Display is turned
#  'OFF'.
#------------------------------#-----------------------------------------------
#   ? WEAPON_AND_NAME_SWITCH  #
#- - - - - - - - - - - - - - #
#  Define the switch that you want to use to turn the Currently Equipped Weapon
#  Display and Actor Name 'ON' or 'OFF', by default it's 4. When the switch is 
#  turned 'OFF' this option will be turned 'ON', and when the switch is  
#  turned 'ON' this option is turned 'OFF'.
#---------------------#--------------------------------------------------------
#   ? R, G, B _BLA   #
#- - - - - - - - - -#
#  Define the amount of each color(Red, Green, Blue) presented in the lighter a-
#  rea of the Back of the HUD. By default it's black which means that R, G and B
#  are setted to '0'.
#---------------------#--------------------------------------------------------
#   ? R, G, B _BDA   #
#- - - - - - - - - -#
#  Define the amount of each color(Red, Green, Blue) presented in the darker a-
#  rea of the Back of the HUD. By default it's black which means that R, G and B
#  are setted to '0'.
#------------------------------------------------------------------------------
# Ў Post Scriptum
#------------------------------------------------------------------------------
#   ? "I want to turn on or off all the HUD or only some part of her at the same time with
#      the same switch, it's possible?"
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
#              Yes, just set the parts you wanted in the same
#              switch as the HUD_VISIBLE_SWITCH.
#------------------------------------------------------------------------------
#   ? "Which values you recommend to use in FONT_SIZE?"
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
#              Use between 8 and 18, or the text will be too
#              small or too bigger. But some times it depends
#              on your FONT_NAME.
#------------------------------------------------------------------------------
#   ? "Which values you recommend to use in R, G, B _BLA and _BDA?"
#- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
#              You MUST use ONLY values between 0 and 255.
#------------------------------------------------------------------------------
 
module ANGELO
 
  HUD_VISIBLE_SWITCH = 1
 
  FONT_NAME = "Times New Roman"
  FONT_SIZE = 16
 
  HP_SWITCH = 2
  MP_SWITCH = 3
  WEAPON_AND_NAME_SWITCH = 4
 
  R_BLA = 0
  G_BLA = 0
  B_BLA = 0
 
  R_BDA = 0
  G_BDA = 0
  B_BDA = 0
 
#=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT
#       * * *  IF YOU ARE USING OTHER ANGELO SCRIPTS, ENABLE THIS  * * *
#=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT=======IMPORTANT
 
  ENABLE_ANGELO_LINK = false
 
end
 
#------------------------------------------------------------------------------
#      !!!!DO NOT EDIT FROM HERE UNLESS YOU KNOW WHAT YOU'RE DOING!!!!
#------------------------------------------------------------------------------
 
include ANGELO
 
class AngeloVHUD < Window_Base
  def initialize
        super(-16, -16, Graphics.width + standard_padding * 3, Graphics.height + standard_padding * 3)
        self.opacity = 0
        $AngeloHUD = true
        refresh
      end
 
  def refresh
    self.contents.clear  
    contents.clear
    draw_angcal_contents
  end
 
  def draw_angcal_contents
    self.contents.clear
    actor = $game_party.members[0]
    @hpr = actor.hp_rate
    @mpr = actor.mp_rate
    @visible_switch = $game_switches[HUD_VISIBLE_SWITCH]
    @mp_switch = $game_switches[MP_SWITCH]
    @hp_switch = $game_switches[HP_SWITCH]
    @weapon_and_name_switch = $game_switches[WEAPON_AND_NAME_SWITCH]
    colorback = Color.new(R_BLA, G_BLA, B_BLA, 150)
    colorback2 = Color.new(R_BDA, G_BDA, B_BDA, 190)
    index = 0
    self.contents.font = Font.new(FONT_NAME, FONT_SIZE)
 
    def draw_vertical(x, y, height, rate, color1, color2)
      fill_h = (height * rate).to_i
      contents.fill_rect(x, y, 6, height, gauge_back_color)
      contents.gradient_fill_rect(x, y, 6, fill_h, color1, color2)
    end
 
    if $game_switches[HUD_VISIBLE_SWITCH] == false
      unless $game_switches[HP_SWITCH] == true
        self.contents.fill_rect(Graphics.width - 32, (standard_padding / 2) + 3, 35, 24, colorback2)
        self.contents.fill_rect(Graphics.width - 32, (standard_padding / 2) + 6, 35, 18, colorback)
        self.contents.fill_rect(Graphics.width - 12, (standard_padding / 2) - 2, 18, Graphics.height / 2, colorback)
        self.contents.fill_rect(Graphics.width - 8, (standard_padding / 2) - 2, 10, Graphics.height / 2, colorback2)
        draw_vertical(Graphics.width - 6, (standard_padding / 2) - 2, Graphics.height / 2, @hpr, hp_gauge_color1, hp_gauge_color2)
        draw_text(Graphics.width - 32, standard_padding / 2, 100, 32, Vocab::hp_a)
      end
 
      unless $game_switches[MP_SWITCH] == true
        self.contents.fill_rect(Graphics.width - 32, Graphics.height - 26, 35, 24, colorback2)
        self.contents.fill_rect(Graphics.width - 32, Graphics.height - 23, 35, 18, colorback)
        self.contents.fill_rect(Graphics.width - 12, (standard_padding / 2) - 2 + (Graphics.height / 2), 18, Graphics.height / 2, colorback)
        self.contents.fill_rect(Graphics.width - 8, (standard_padding / 2) - 2 + (Graphics.height / 2), 10, Graphics.height / 2, colorback2)
        draw_vertical(Graphics.width - 6, (standard_padding / 2) - 2 + (Graphics.height / 2), Graphics.height / 2, @mpr, mp_gauge_color1, mp_gauge_color2)
        draw_text(Graphics.width - 32, Graphics.height - 29, 100, 32, Vocab::mp_a)
      end
 
      unless $game_switches[WEAPON_AND_NAME_SWITCH] == true
        self.contents.fill_rect(-64 + 80, 386, 125, 19, colorback)
        self.contents.fill_rect(-64 + 85, 386, 115, 19, colorback2)
        draw_actor_name(actor,  -40 + 87, 383, 100)
        return unless actor.equips[index]
        draw_icon(actor.equips[index].icon_index, -64 + 87, 382, true)#(actor.equips[index], -64 + 92, 376, true)
      end
    end
 
    def hud_changed
        return (@hpr != $game_party.members[0].hp_rate ||
        @mpr != $game_party.members[0].mp_rate ||
        @visible_switch != $game_switches[HUD_VISIBLE_SWITCH] ||
        @mp_switch != $game_switches[MP_SWITCH] ||
        @hp_switch != $game_switches[HP_SWITCH] ||
        @weapon_and_name_switch != $game_switches[WEAPON_AND_NAME_SWITCH])
      end
    end
 
    def update
        super
        if hud_changed
        refresh
        end
      end
    end
 
 
 
class Scene_Map
      alias hud_angelo_vertical create_all_windows
 
      def create_all_windows
        hud_angelo_vertical
        create_hud_window
      end
 
      def create_hud_window
        @hud = AngeloVHUD.new
        if ENABLE_ANGELO_LINK && $Menu_Angelo == true
         @gold = Window_Gold.new
         @gold.opacity = 0
         @gold.x = 146 - @gold.contents.width - 10
         @gold.y = Graphics.height - 68
        end
      end
    end
Последнее редактирование: 9 года 3 мес. назад от DeadElf79.
Администратор запретил публиковать записи гостям.

Выполнение скрипта после события 9 года 3 мес. назад #76921

  • DeadElf79
  • DeadElf79 аватар
  • Вне сайта
  • Звездный Страж
  • Сообщений: 3147
  • Спасибо получено: 2650
  • Организатор конкурсов3 местоПрограммист RubyПроект месяца 1 местоПисатель 3 местоУчительВетеранПроект месяца 2 место1 место в Готв
Ставишь в HUD_VISIBLE_SWITCH (смотри скрипт) номер переключателя. Когда значение переключателя меняется, то худ появляется/скрывается.
Все настройки детально описаны в инструкции к скрипту, не понимаю, в чем была проблема?
Последнее редактирование: 9 года 3 мес. назад от DeadElf79.
Администратор запретил публиковать записи гостям.
За этот пост поблагодарили: darkwork

Выполнение скрипта после события 9 года 3 мес. назад #76922

  • darkwork
  • darkwork аватар
  • Вне сайта
  • Заблокирован
  • Factory of Evil
  • Сообщений: 244
  • Спасибо получено: 127
Всё получилось. спасибо!
Последнее редактирование: 9 года 3 мес. назад от darkwork. Причина: Получилось исправить самому
Администратор запретил публиковать записи гостям.
Время создания страницы: 0.182 секунд