Ergebnis 1 bis 4 von 4

Thema: Skript Fehlermeldung

Baum-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1

    Skript Fehlermeldung

    Ich habe ein ATB Skript eingefügt, nur steht dann immer folgende Fehlermeldung:

    Script ´ATB KS´ line 22: TypeError occured.

    undefined superclass ´Scene_Base´


    Script:

    Code:
    #==============================================================================
    # ** ActiveTimeBattles V1.0
    # von hellMinor (24.12.2008)
    #------------------------------------------------------------------------------
    # http://www.rpg-studio.de/http://www.rpg-studio.de/itzamna/node/238
    # http://rpgvx.net/index.php?show=wrapper&ID=7&sourceID=22
    #==============================================================================
    
    #==============================================================================
    #  hellMinor's Active-Time-Battles
    #
    #  Version : 1.0 - 02.04.08
    #  Created by : hellMinor
    #  Do NOT redistribute without my permission
    #  Description : This script changes the standard Battle-System to an
    #                Active-Time-Battle-System based on the agility of the
    #                character
    #  Notes :       This script uses my CustomBattleScreen with some changes
    #
    #==============================================================================
    #==============================================================================
    class Scene_Battle < Scene_Base
    #==============================================================================  
      def start
        super
        $game_temp.in_battle = true
        @actor_wait = [0,0,0,0,0,0,0,0,0,0,0,0]
        @bar_add = [0,0,0,0,0,0,0,0,0,0,0,0]
        $bar_values = [0,0,0,0,0,0,0,0,0,0,0,0]
        @spriteset = Spriteset_Battle.new
        @message_window = Window_BattleMessage.new
        @action_battlers = []
        create_info_viewport
        @info_viewport.visible = true
      end
    #------------------------------------------------------------------------------  
      def next_actor
    # zurücksetzen
        for enemy in $game_troop.members
          enemy.action.clear
        end
        
        @wert = 300
        @index = 0
        
        if @actor_index == $game_party.members.size-1
          start_main
          return
        end
        
    # player_wait_max = Frameausgleich*(MaxSekunden*(Skalierung-(Player_AGI/Max_AGI)))
    # player_bar_add  = GaugeGröße / player_wait_max    
        
        for i in 0..$game_party.members.size-1
          if @actor_wait[i] == 0 or @actor_wait[i] == nil
            @actor_wait[i] = 60*(3.0*(1.0-($game_party.members[i].agi/1000.0)))
            @bar_add[i] = 120.0/@actor_wait[i]
          end
        end
        
        for i in 0..$game_troop.members.size-1
          if @actor_wait[i+4] == 0 or @actor_wait[i+4] == nil
            @actor_wait[i+4] = 60*(5.0*(1.0-($game_troop.members[i].agi/1000.0)))
            @bar_add[i+4] = 120.0/@actor_wait[i+4]     
          end
        end
    
    #kleinsten agi wert raussuchen und den nächsten actor festlegen
        for i in 0..@actor_wait.length-1
          if @actor_wait[i] < @wert && @actor_wait[i] > 0
            @wert = @actor_wait[i]
            if i < $game_party.members.size
              @active_battler = $game_party.members[i]
              @index = i
            else
              @active_battler = $game_troop.members[i-4]
              @index = i
            end
          end
        end
    
    # redrawschleife bis actor an der reihe
        for i in 0..@wert
          wait(1)
          for j in 0..$game_party.members.size-1
            $bar_values[j] += @bar_add[j]
          end
          @status_window.refresh
        end
    
    # neue werte berechnen + korrekturwert bei gleicher zahl    
        for i in 0..@actor_wait.size-1
          if i == @index
            @actor_wait[i] -= @wert
          else
            @actor_wait[i] -= @wert-0.001
          end
        end
        
        if @active_battler.inputable?
          if @active_battler.actor?
            @status_window.index = @index
            $bar_values[@index] = 0
            if @autobattle || @active_battler.auto_battle
              @active_battler.make_action
              start_main
            else
              start_actor_command_selection
            end
          else
            @active_battler.make_action
            start_main
          end
        else
          if @active_battler.actor?
            $bar_values[@index] = 0
          end
          next_actor
        end
      end
    #------------------------------------------------------------------------------  
      def update_actor_command_selection
        if Input.trigger?(Input::B)
          Sound.play_cancel
        elsif Input.trigger?(Input::C)
          case @actor_command_window.index
          when 0  # 攻撃
            Sound.play_decision
            @active_battler.action.set_attack
            start_target_enemy_selection
          when 1  # スキル
            Sound.play_decision
            start_skill_selection
          when 2  # 防御
            Sound.play_decision
            @active_battler.action.set_guard
            start_main
          when 3  # アイテム
            Sound.play_decision
            start_item_selection
          end
        end
      end
    #------------------------------------------------------------------------------ 
      def start_target_enemy_selection
        @target_enemy_window = Window_TargetEnemy.new
        @target_enemy_window.y = 193
        @info_viewport.rect.x += @target_enemy_window.width
        @info_viewport.ox += @target_enemy_window.width
        @actor_command_window.active = false
      end
    #------------------------------------------------------------------------------ 
      def update_target_enemy_selection
        @target_enemy_window.update
        if Input.trigger?(Input::B)
          Sound.play_cancel
          end_target_enemy_selection
        elsif Input.trigger?(Input::C)
          Sound.play_decision
          @active_battler.action.target_index = @target_enemy_window.enemy.index
          end_target_enemy_selection
          end_skill_selection
          end_item_selection
          start_main
        end
      end
    #------------------------------------------------------------------------------  
      def update_target_actor_selection
        @target_actor_window.update
        if Input.trigger?(Input::B)
          Sound.play_cancel
          end_target_actor_selection
        elsif Input.trigger?(Input::C)
          Sound.play_decision
          @active_battler.action.target_index = @target_actor_window.index
          end_target_actor_selection
          end_skill_selection
          end_item_selection
          start_main
        end
      end
    #------------------------------------------------------------------------------  
        def determine_skill
        @active_battler.action.set_skill(@skill.id)
        @skill_window.active = false
        if @skill.need_selection?
          if @skill.for_opponent?
            start_target_enemy_selection
          else
            start_target_actor_selection
          end
        else
          end_skill_selection
          start_main
        end
      end
    #------------------------------------------------------------------------------  
      def determine_item
        @active_battler.action.set_item(@item.id)
        @item_window.active = false
        if @item.need_selection?
          if @item.for_opponent?
            start_target_enemy_selection
          else
            start_target_actor_selection
          end
        else
          end_item_selection
          start_main
        end
      end
    #------------------------------------------------------------------------------  
      def start_main
        $game_troop.increase_turn
        @info_viewport.visible = true
        @info_viewport.ox = 0
        @message_window.visible = true
        @actor_command_window.visible = false
        @party_command_window.active = false
        @actor_command_window.active = false
        @status_window.index = @actor_index = -1
        @active_battler = nil
        @message_window.clear
        make_action_orders
        wait(20)
      end
    #------------------------------------------------------------------------------
      def create_info_viewport
        @info_viewport = Viewport.new(0, 0, 544, 480)
        @info_viewport.z = 100
        @status_window = Window_BattleStatus.new
        @party_command_window = Window_PartyCommand.new
        @actor_command_window = Window_ActorCommand.new
        @status_window.viewport = @info_viewport
        @party_command_window.viewport = @info_viewport
        @actor_command_window.viewport = @info_viewport
        @party_command_window.x = 159
        @party_command_window.y = 360
        @status_window.x = 0
        @actor_command_window.x = 159
        @actor_command_window.y = 360
        @actor_command_window.visible = false
        @info_viewport.visible = false
      end
    #------------------------------------------------------------------------------  
      def update_info_viewport
        @party_command_window.update
        @actor_command_window.update
        @status_window.update
        if @party_command_window.active
          @party_command_window.visible = true
          @actor_command_window.visible = false
        elsif @actor_command_window.active
          @actor_command_window.visible = true
          @party_command_window.visible = false
        end
      end
    #------------------------------------------------------------------------------  
      def start_party_command_selection
        if $game_temp.in_battle
          @status_window.refresh
          @status_window.index = @actor_index = -1
          @active_battler = nil
          @info_viewport.visible = true
          @message_window.visible = false
          @party_command_window.active = true
          @party_command_window.index = 0
          @actor_command_window.active = false
          $game_party.clear_actions
          if $game_troop.surprise or not $game_party.inputable?
            start_main
          end
          if @autobattle
            next_actor
          end
        end
      end
    #------------------------------------------------------------------------------ 
      def update_party_command_selection
        if Input.trigger?(Input::C)
          case @party_command_window.index
          when 0  # 戦う
            @party_command_window.visible = false
            Sound.play_decision
            @status_window.index = @actor_index = -1
            next_actor
          when 1  # 戦う
            Sound.play_decision
            @status_window.index = @actor_index = -1
            @party_command_window.active = false
            @party_command_window.visible = false
            @autobattle = true
            next_actor
          when 2  # 逃げる
            if $game_troop.can_escape == false
              Sound.play_buzzer
              return
            end
            Sound.play_decision
            process_escape
          end
        end
      end
    #------------------------------------------------------------------------------  
      def start_skill_selection
        @help_window = Window_Help.new
        @skill_window = Window_Skill.new(0, 55, 544, 306, @active_battler)
        @skill_window.help_window = @help_window
        @actor_command_window.active = false
      end
    #------------------------------------------------------------------------------
      def start_item_selection
        @help_window = Window_Help.new
        @item_window = Window_Item.new(0, 55, 544, 306)
        @item_window.help_window = @help_window
        @actor_command_window.active = false
      end
    #------------------------------------------------------------------------------ 
      def process_victory
        @info_viewport.visible = true
        @message_window.visible = true
        RPG::BGM.stop
        $game_system.battle_end_me.play
        unless $BTEST
          $game_temp.map_bgm.play
          $game_temp.map_bgs.play
        end
        display_exp_and_gold
        display_drop_items
        display_level_up
        battle_end(0)
      end
    #------------------------------------------------------------------------------
      def process_defeat
        @info_viewport.visible = true
        @message_window.visible = true
        text = sprintf(Vocab::Defeat, $game_party.name)
        $game_message.texts.push(text)
        wait_for_message
        battle_end(2)
      end
    
    end
    
    #==============================================================================
    #  CustomBattleScreen
    #  Version : 0.2 - Customized
    #  Created by : hellMinor
    #==============================================================================
    #==============================================================================
    class Window_BattleStatus < Window_Selectable
    #==============================================================================
      def initialize
        super(0, 0, 160, 416)
        refresh
        self.active = false
      end
    #------------------------------------------------------------------------------
      def item_rect(index)
        rect = Rect.new(0, 0, 0, 0)
        rect.width = 126
        rect.height = 96
        rect.y = index / @column_max * 96
        return rect
      end
    #------------------------------------------------------------------------------
      def draw_item(index)
        rect = item_rect(index)
        self.contents.clear_rect(rect)
        self.contents.font.color = normal_color
        actor = $game_party.members[index]
        draw_atb_gauge(index, 3, rect.y+10)
        draw_actor_name(actor, 3, rect.y)    
        draw_actor_state(actor, 35, rect.y+20, 48)
        draw_actor_graphic(actor,18,rect.y+55)
        draw_actor_mp(actor, 35, rect.y+45, 88)
        draw_actor_hp(actor, 3, rect.y+65, 120)
      end
    #------------------------------------------------------------------------------  
      def draw_actor_name(actor, x, y)
        self.contents.font.color = hp_color(actor)
        self.contents.draw_text(x, y, 120, WLH, actor.name, 1)
      end
    #------------------------------------------------------------------------------  
      def draw_atb_gauge(index,x, y, width = 120)
        if $bar_values[index] == nil
          $bar_values[index] = 0
        end
        if $bar_values[index] >= 120
          gc1 = hp_gauge_color1
          gc2 = hp_gauge_color2
        else
          gc1 = mp_gauge_color1
          gc2 = mp_gauge_color2
        end
        self.contents.fill_rect(x, y, 120, 5, gauge_back_color)
        self.contents.gradient_fill_rect(x, y, $bar_values[index], 5, gc1, gc2)
      end
    
    end
    #==============================================================================
    class Window_PartyCommand < Window_Command
    #==============================================================================  
      def initialize
        s1 = Vocab::fight
        s2 = "Auto-Fight"
        s3 = Vocab::hehe:scape
        super(385, [s1, s2, s3], 3, 1)
        draw_item(0, true)
        draw_item(1, true)
        draw_item(2, $game_troop.can_escape)
        self.active = false
      end
    #------------------------------------------------------------------------------  
      def draw_item(index, enabled = true)
        rect = item_rect(index)
        rect.x += 4
        rect.width -= 8
        self.contents.clear_rect(rect)
        self.contents.font.color = normal_color
        self.contents.font.color.alpha = enabled ? 255 : 128
        self.contents.draw_text(rect, @commands[index], 1)
      end
    
    end
    #==============================================================================
    class Window_ActorCommand < Window_Command
    #==============================================================================  
      def initialize
        super(385, [], 4, 1)
        self.active = false
      end
    #------------------------------------------------------------------------------
      def setup(actor)
        s1 = Vocab::attack
        s2 = Vocab::skill
        s3 = Vocab::guard
        s4 = Vocab::item
        if actor.class.skill_name_valid
          s2 = actor.class.skill_name
        end
          @commands = [s1,s2, s3, s4]
          @item_max = 4
        refresh
        self.index = 0
      end
    #------------------------------------------------------------------------------
      def draw_item(index, enabled = true)
        rect = item_rect(index)
        rect.x += 4
        rect.width -= 8
        self.contents.clear_rect(rect)
        self.contents.font.color = normal_color
        self.contents.font.color.alpha = enabled ? 255 : 128
        self.contents.draw_text(rect, @commands[index], 1)
      end
      
    end
    #==============================================================================
    class Window_TargetEnemy < Window_Command
    #==============================================================================
      def initialize
        commands = []
        @enemies = []
        for enemy in $game_troop.members
          next unless enemy.exist?
          commands.push(enemy.name)
          @enemies.push(enemy)
        end
        super(160, commands, 1, 8)
      end
    #------------------------------------------------------------------------------ 
      def draw_item(index, enabled = true)
        rect = item_rect(index)
        rect.x += 4
        rect.width -= 8
        self.contents.clear_rect(rect)
        self.contents.font.color = normal_color
        self.contents.font.color.alpha = enabled ? 255 : 128
        self.contents.draw_text(rect, @commands[index], 1)
      end
      
    end
    #==============================================================================
    class Window_BattleMessage < Window_Message
    #==============================================================================
      def initialize
        super(159,288,385,128)
        self.openness = 255
        @lines = []
        refresh
      end
      
    end
    #==============================================================================
    class Window_Message < Window_Selectable
    #==============================================================================
      def initialize(x = 0,y = 288,w = 544,h = 128)
        super(x,y,w,h)
        self.z = 200
        self.active = false
        self.index = -1
        self.openness = 0
        @opening = false            # ウィンドウのオープン中フラグ
        @closing = false            # ウィンドウのクローズ中フラグ
        @text = nil                 # 表示すべき残りの文章
        @contents_x = 0             # 次の文字を描画する X 座標
        @contents_y = 0             # 次の文字を描画する Y 座標
        @line_count = 0             # 現在までに描画した行数
        @wait_count = 0             # ウェイトカウント
        @background = 0             # 背景タイプ
        @position = 2               # 表示位置
        @show_fast = false          # 早送りフラグ
        @line_show_fast = false     # 行単位早送りフラグ
        @pause_skip = false         # 入力待ち省略フラグ
        create_gold_window
        create_number_input_window
        create_back_sprite
      end
    
    end

    Geändert von Zeythier (03.06.2009 um 19:38 Uhr)

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •