Страница 33 из 147 ПерваяПервая ... 2331323334354383133 ... ПоследняяПоследняя
Показано с 321 по 330 из 1470

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

  1. #321
    Пользователь Аватар для Lainu
    Информация о пользователе
    Регистрация
    01.05.2011
    Сообщений
    78
    Записей в дневнике
    9
    Репутация: 10 Добавить или отнять репутацию

    По умолчанию

    Andrew
    1)это в опциях с группой противников? Appear Halfway?
    Тогда... другая проблема. Дело в том что у меня стоит боевка Rye.jp's CBS Starter Pack 0.6 и там есть такая фишка как отображение жизней противников во время боя. В итоге.. выходит что-то типа такого 0о

    *тупо не знаю что с этим делать*
    2)Буду очень благодарен.

  2. #322
    Маститый Аватар для Andrew
    Информация о пользователе
    Регистрация
    08.02.2011
    Адрес
    Беларусь, Витебск
    Сообщений
    1,049
    Записей в дневнике
    3
    Репутация: 30 Добавить или отнять репутацию

    По умолчанию

    1) Могу убрать(или сам убери)
    2) Почти сделал, осталось только интеллект уменьшить.
    P.S. У тебя какой то текст странный.
    Поставь это и с текстом будет всё норм.
    class Font
    @@default_size = 17
    @@default_font = "Arial"
    @@default_bold = true
    end
    Или
    class Font
    @@default_font = "Arial"
    end
    Последний раз редактировалось Andrew; 02.05.2011 в 10:00.


  3. #323
    Маститый Аватар для Andrew
    Информация о пользователе
    Регистрация
    08.02.2011
    Адрес
    Беларусь, Витебск
    Сообщений
    1,049
    Записей в дневнике
    3
    Репутация: 30 Добавить или отнять репутацию

    По умолчанию

    Код:
    #==============================================================================
    # ** Scene_Battle (part 3)
    #------------------------------------------------------------------------------
    #  This class performs battle screen processing.
    #==============================================================================
    
    class Scene_Battle
       def main
        # Initialize each kind of temporary battle data
        $game_temp.in_battle = true
        $game_temp.battle_turn = 0
        $game_temp.battle_event_flags.clear
        $game_temp.battle_abort = false
        $game_temp.battle_main_phase = false
        $game_temp.battleback_name = $game_map.battleback_name
        $game_temp.forcing_battler = nil
        # Initialize battle event interpreter
        $game_system.battle_interpreter.setup(nil, 0)
        # Prepare troop
        @troop_id = $game_temp.battle_troop_id
        $game_troop.setup(@troop_id)
        # Make actor command window
        s1 = $data_system.words.attack
        s2 = $data_system.words.skill
        s3 = $data_system.words.guard
        s4 = "Отдых"
        s5 = $data_system.words.item
        @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s4])
        @actor_command_window.y = 136
        @actor_command_window.back_opacity = 160
        @actor_command_window.active = false
        @actor_command_window.visible = false
        # Make other windows
        @party_command_window = Window_PartyCommand.new
        @help_window = Window_Help.new
        @help_window.back_opacity = 160
        @help_window.visible = false
        @status_window = Window_BattleStatus.new
        @message_window = Window_Message.new
        # Make sprite set
        @spriteset = Spriteset_Battle.new
        # Initialize wait count
        @wait_count = 0
        # Execute transition
        if $data_system.battle_transition == ""
          Graphics.transition(20)
        else
          Graphics.transition(40, "Graphics/Transitions/" +
            $data_system.battle_transition)
        end
        # Start pre-battle phase
        start_phase1
        # Main loop
        loop do
          # Update game screen
          Graphics.update
          # Update input information
          Input.update
          # Frame update
          update
          # Abort loop if screen is changed
          if $scene != self
            break
          end
        end
        # Refresh map
        $game_map.refresh
        # Prepare for transition
        Graphics.freeze
        # Dispose of windows
        @actor_command_window.dispose
        @party_command_window.dispose
        @help_window.dispose
        @status_window.dispose
        @message_window.dispose
        if @skill_window != nil
          @skill_window.dispose
        end
        if @item_window != nil
          @item_window.dispose
        end
        if @result_window != nil
          @result_window.dispose
        end
        # Dispose of sprite set
        @spriteset.dispose
        # If switching to title screen
        if $scene.is_a?(Scene_Title)
          # Fade out screen
          Graphics.transition
          Graphics.freeze
        end
        # If switching from battle test to any screen other than game over screen
        if $BTEST and not $scene.is_a?(Scene_Gameover)
          $scene = nil
        end
      end
      #--------------------------------------------------------------------------
      # * Determine Battle Win/Loss Results
      #--------------------------------------------------------------------------
      def judge
        # If all dead determinant is true, or number of members in party is 0
        if $game_party.all_dead? or $game_party.actors.size == 0
          # If possible to lose
          if $game_temp.battle_can_lose
            # Return to BGM before battle starts
            $game_system.bgm_play($game_temp.map_bgm)
            # Battle ends
            battle_end(2)
            # Return true
            return true
          end
          # Set game over flag
          $game_temp.gameover = true
          # Return true
          return true
        end
        # Return false if even 1 enemy exists
        for enemy in $game_troop.enemies
          if enemy.exist?
            return false
          end
        end
        # Start after battle phase (win)
        start_phase5
        # Return true
        return true
      end
      #--------------------------------------------------------------------------
      # * Battle Ends
      #     result : results (0:win 1:lose 2:escape)
      #--------------------------------------------------------------------------
      def battle_end(result)
        # Clear in battle flag
        $game_temp.in_battle = false
        # Clear entire party actions flag
        $game_party.clear_actions
        # Remove battle states
        for actor in $game_party.actors
          actor.remove_states_battle
        end
        # Clear enemies
        $game_troop.enemies.clear
        # Call battle callback
        if $game_temp.battle_proc != nil
          $game_temp.battle_proc.call(result)
          $game_temp.battle_proc = nil
        end
        # Switch to map screen
        $scene = Scene_Map.new
      end
      #--------------------------------------------------------------------------
      # * Battle Event Setup
      #--------------------------------------------------------------------------
      def setup_battle_event
        # If battle event is running
        if $game_system.battle_interpreter.running?
          return
        end
        # Search for all battle event pages
        for index in 0...$data_troops[@troop_id].pages.size
          # Get event pages
          page = $data_troops[@troop_id].pages[index]
          # Make event conditions possible for reference with c
          c = page.condition
          # Go to next page if no conditions are appointed
          unless c.turn_valid or c.enemy_valid or
                 c.actor_valid or c.switch_valid
            next
          end
          # Go to next page if action has been completed
          if $game_temp.battle_event_flags[index]
            next
          end
          # Confirm turn conditions
          if c.turn_valid
            n = $game_temp.battle_turn
            a = c.turn_a
            b = c.turn_b
            if (b == 0 and n != a) or
               (b > 0 and (n < 1 or n < a or n % b != a % b))
              next
            end
          end
          # Confirm enemy conditions
          if c.enemy_valid
            enemy = $game_troop.enemies[c.enemy_index]
            if enemy == nil or enemy.hp * 100.0 / enemy.maxhp > c.enemy_hp
              next
            end
          end
          # Confirm actor conditions
          if c.actor_valid
            actor = $game_actors[c.actor_id]
            if actor == nil or actor.hp * 100.0 / actor.maxhp > c.actor_hp
              next
            end
          end
          # Confirm switch conditions
          if c.switch_valid
            if $game_switches[c.switch_id] == false
              next
            end
          end
          # Set up event
          $game_system.battle_interpreter.setup(page.list, 0)
          # If this page span is [battle] or [turn]
          if page.span <= 1
            # Set action completed flag
            $game_temp.battle_event_flags[index] = true
          end
          return
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update
      #--------------------------------------------------------------------------
      def update
        # If battle event is running
        if $game_system.battle_interpreter.running?
          # Update interpreter
          $game_system.battle_interpreter.update
          # If a battler which is forcing actions doesn't exist
          if $game_temp.forcing_battler == nil
            # If battle event has finished running
            unless $game_system.battle_interpreter.running?
              # Rerun battle event set up if battle continues
              unless judge
                setup_battle_event
              end
            end
            # If not after battle phase
            if @phase != 5
              # Refresh status window
              @status_window.refresh
            end
          end
        end
        # Update system (timer) and screen
        $game_system.update
        $game_screen.update
        # If timer has reached 0
        if $game_system.timer_working and $game_system.timer == 0
          # Abort battle
          $game_temp.battle_abort = true
        end
        # Update windows
        @help_window.update
        @party_command_window.update
        @actor_command_window.update
        @status_window.update
        @message_window.update
        # Update sprite set
        @spriteset.update
        # If transition is processing
        if $game_temp.transition_processing
          # Clear transition processing flag
          $game_temp.transition_processing = false
          # Execute transition
          if $game_temp.transition_name == ""
            Graphics.transition(20)
          else
            Graphics.transition(40, "Graphics/Transitions/" +
              $game_temp.transition_name)
          end
        end
        # If message window is showing
        if $game_temp.message_window_showing
          return
        end
        # If effect is showing
        if @spriteset.effect?
          return
        end
        # If game over
        if $game_temp.gameover
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If returning to title screen
        if $game_temp.to_title
          # Switch to title screen
          $scene = Scene_Title.new
          return
        end
        # If battle is aborted
        if $game_temp.battle_abort
          # Return to BGM used before battle started
          $game_system.bgm_play($game_temp.map_bgm)
          # Battle ends
          battle_end(1)
          return
        end
        # If waiting
        if @wait_count > 0
          # Decrease wait count
          @wait_count -= 1
          return
        end
        # If battler forcing an action doesn't exist,
        # and battle event is running
        if $game_temp.forcing_battler == nil and
           $game_system.battle_interpreter.running?
          return
        end
        # Branch according to phase
        case @phase
        when 1  # pre-battle phase
          update_phase1
        when 2  # party command phase
          update_phase2
        when 3  # actor command phase
          update_phase3
        when 4  # main phase
          update_phase4
        when 5  # after battle phase
          update_phase5
        end
      end
      #--------------------------------------------------------------------------
      # * Frame Update (actor command phase : basic command)
      #--------------------------------------------------------------------------
      def update_phase3_basic_command
        # If B button was pressed
        if Input.trigger?(Input::B)
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # Go to command input for previous actor
          phase3_prior_actor
          return
        end
        # If C button was pressed
        if Input.trigger?(Input::C)
          # Branch by actor command window cursor position
          case @actor_command_window.index
          when 0  # attack
            # Play decision SE
            $game_system.se_play($data_system.decision_se)
            # Set action
            @active_battler.current_action.kind = 0
            @active_battler.current_action.basic = 0
            # Start enemy selection
            start_enemy_select
          when 1  # skill
            # Play decision SE
            $game_system.se_play($data_system.decision_se)
            # Set action
            @active_battler.current_action.kind = 1
            # Start skill selection
            start_skill_select
          when 2  # guard
            # Play decision SE
            $game_system.se_play($data_system.decision_se)
            # Set action
            @active_battler.current_action.kind = 0
            @active_battler.current_action.basic = 1
            # Go to command input for next actor
            phase3_next_actor
          when 3  # отдых
            # Play decision SE
            $game_system.se_play($data_system.decision_se)
            # Set action
            @active_battler.sp += 80 + (@active_battler.level * 4)
            @active_battler.str -= ((@active_battler.str/100)*25)
            @active_battler.dex -= ((@active_battler.dex/100)*25)
            @active_battler.agi -= ((@active_battler.agi/100)*25)
            @active_battler.int -= ((@active_battler.int/100)*25)
            p @active_battler.int
            p @active_battler.agi
            p @active_battler.dex
            p @active_battler.str
            @active_battler.current_action.kind = 3
            @active_battler.current_action.basic = 1
            # Go to command input for next actor
            phase3_next_actor
          when 4  # item
            # Play decision SE
            $game_system.se_play($data_system.decision_se)
            # Set action
            @active_battler.current_action.kind = 2
            # Start item selection
            start_item_select
          end
          return
        end
      end
    end
    Проверь уменьшение характеристик.(Нет возможности проверить)
    Вот эти строки отвечают за изменения(чтобы ты сам мог подправить).
    Код:
            @active_battler.sp += 80 + (@active_battler.level * 4)
            @active_battler.str -= ((@active_battler.str/100)*25)
            @active_battler.dex -= ((@active_battler.dex/100)*25)
            @active_battler.agi -= ((@active_battler.agi/100)*25)
            @active_battler.int -= ((@active_battler.int/100)*25)
    Последний раз редактировалось Andrew; 02.05.2011 в 10:22.


  4. #324
    Пользователь Аватар для Lainu
    Информация о пользователе
    Регистрация
    01.05.2011
    Сообщений
    78
    Записей в дневнике
    9
    Репутация: 10 Добавить или отнять репутацию

    По умолчанию

    1) Да сам скрипт очень хотелось бы оставить... может только доработать слегка.
    Вот я тут поглядел скрипт.. понимаю я его довольно поверхностно, но...
    class Window_EnemyHP < Window_Base

    def initialize
    super(0, 0, 640, 480)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.opacity = 0
    @old_hp = []
    refresh
    end

    def refresh
    self.contents.clear
    for i in 0...$game_troop.enemies.size
    @enemy = $game_troop.enemies[i]
    @old_hp[i] = @enemy.hp
    unless @enemy.hp == 0
    self.contents.font.size = 15
    self.contents.font.bold = true
    self.contents.font.color = Color.new(0,0,0)
    self.contents.draw_text(1, i * 32 + 36, 100, 32, @enemy.name)
    self.contents.draw_text(-1, i * 32 + 36, 100, 32, @enemy.name)
    self.contents.draw_text(1, i * 32 + 38, 100, 32, @enemy.name)
    self.contents.draw_text(-1, i * 32 + 38, 100, 32, @enemy.name)
    self.contents.font.color = normal_color
    self.contents.draw_text(0, i * 32 + 37, 100, 32, @enemy.name)
    draw_slant_bar(0, i*32 + 60, @enemy.hp, @enemy.maxhp, 50)
    end

    end
    end
    def update
    for i in 0...$game_troop.enemies.size
    enemy = $game_troop.enemies[i]
    if enemy.hp != @old_hp[i]
    refresh
    end
    end
    end
    end

    class Scene_Battle

    alias raz_update_phase5 update_phase5
    alias raz_update_phase4_step1 update_phase4_step1
    alias raz_update_phase4_step5 update_phase4_step5
    alias raz_enemy_hp_main main

    def main
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    @enemy_window = Window_EnemyHP.new
    @enemy_window.z = 95
    raz_enemy_hp_main
    @enemy_window.dispose
    end

    def update_phase5
    # If wait count is larger than 0
    if @phase5_wait_count > 0
    # Decrease wait count
    @phase5_wait_count -= 1
    # If wait count reaches 0
    if @phase5_wait_count == 0
    @enemy_window.visible = false
    # Show result window
    @result_window.visible = true
    # Clear main phase flag
    $game_temp.battle_main_phase = false
    # Refresh status window
    @status_window.refresh
    @enemy_window.refresh
    end
    return
    end
    raz_update_phase5
    end

    def update_phase4_step1
    raz_update_phase4_step1
    @enemy_window.refresh
    end

    def update_phase4_step5
    # Hide help window
    @help_window.visible = false
    # Refresh status window
    @status_window.refresh
    @enemy_window.refresh
    raz_update_phase4_step5
    end
    end
    Я так понимаю что то, что выделено жирным - исключение для определенной ситуации, при которой шкала жизней перестает отображаться. Можно как-нибудь сделать такое-же исключение чтобы точно так-же не отображались жизни у скрытых врагов? Что для этого необходимо поставить вместо @enemy.hp == 0 ?

    2)Радует. Очень.
    Жду и надеюсь на успех.

    3)И опять идиотский вопрос нуба...
    а куда именно нужно эти строки добавить?

  5. #325
    Пользователь Аватар для Lainu
    Информация о пользователе
    Регистрация
    01.05.2011
    Сообщений
    78
    Записей в дневнике
    9
    Репутация: 10 Добавить или отнять репутацию

    По умолчанию

    п.с. Спасибо за скрипт. Буду сейчас с ним эксперементировать ^^

  6. #326
    Маститый Аватар для Andrew
    Информация о пользователе
    Регистрация
    08.02.2011
    Адрес
    Беларусь, Витебск
    Сообщений
    1,049
    Записей в дневнике
    3
    Репутация: 30 Добавить или отнять репутацию

    По умолчанию

    3)а куда именно нужно эти строки добавить?
    В новый раздел/вкладку(как новый скрипт)
    2)он может не работать.
    1) сначала скрипт отдыха закончу


  7. #327
    Маститый Аватар для Andrew
    Информация о пользователе
    Регистрация
    08.02.2011
    Адрес
    Беларусь, Витебск
    Сообщений
    1,049
    Записей в дневнике
    3
    Репутация: 30 Добавить или отнять репутацию

    По умолчанию

    Скрипт пока не рабочий). Только ману увеличивает. Корооче багов море. Подожди минут 15


  8. #328
    Маститый Аватар для Andrew
    Информация о пользователе
    Регистрация
    08.02.2011
    Адрес
    Беларусь, Витебск
    Сообщений
    1,049
    Записей в дневнике
    3
    Репутация: 30 Добавить или отнять репутацию

    По умолчанию

    Давай просто уменьшение на 25?(не процентов)


  9. #329
    Пользователь Аватар для Lainu
    Информация о пользователе
    Регистрация
    01.05.2011
    Сообщений
    78
    Записей в дневнике
    9
    Репутация: 10 Добавить или отнять репутацию

    По умолчанию

    Окей. Пусть будет так)

  10. #330
    Бывалый Аватар для Dark32
    Информация о пользователе
    Регистрация
    30.12.2008
    Адрес
    Арзамас
    Сообщений
    640
    Записей в дневнике
    2
    Репутация: 20 Добавить или отнять репутацию

    По умолчанию

    Цитата Сообщение от Lainu Посмотреть сообщение
    ...Что для этого необходимо поставить вместо @enemy.hp == 0 ?...
    не вместо а вместе. Нужна проверка на скрытность - @enemy.hidden
    PHP код:
    <...>
     
    unless @enemy.hp == and @enemy.hidden 
    <...> 
    примерно так
    Нужна помощь в скриптах? Запутался? Голова не варит?
    Читал это и это тоже? Не помогло? Тогда тебе сюда!
    Спойлер •••:
    Цитата Сообщение от Реймон
    В мире нет вещей которые нельзя решить с помощью сладостей
    Цитата Сообщение от Ундер
    Ночью можно обойтись и без сладостей...

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

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

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

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

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

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

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

Ваши права

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