Blizz-ABS Bug and Suggestion Compilation

Started by winkio, April 21, 2010, 03:40:33 am

Previous topic - Next topic

oOEvilmanaOo

One feature that would be really neat is some way to control your summoned monsters/pets. I'm trying to make a FFXI inspired summoner class, but i have no way to control the summons using BABS.

whitespirits

Aoe attack would be good idea, basically attack every enemy in a certain radius

Zexion

can't you already do AoE skills?
Just set an explode type/range to a shooting skill and bam!

whitespirits

Hi i just wana ask if its possible to make a small plugin that allows u to define certain sprites that use attack sprites so not every single 1 has to be changed when u activate multi sprite. I mainly want this for bosses

whitespirits

Hi guys, so being a RMX-OS user, im really wanting a Taunt system in abs, im sure this could be done just making a spell that pulls all monsters to a certain character? just as a basic start off system?

KK20

So I promised to fix the AI Triggers scene up since there were some bugs with it that (surprisingly) no one reported.
Spoiler: ShowHide

#==============================================================================
# Scene_AI_Triggers
#------------------------------------------------------------------------------
#  This class processes handling of the scene where ally action triggers can be
#  set up which is used by the Ally Trigger AI.
#==============================================================================

class Scene_AI_Triggers
 
  #----------------------------------------------------------------------------
  # Initialization
  #  tone  - screen background tone
  #  index - actor party index
  #----------------------------------------------------------------------------
  def initialize(tone = Tone.new(0, 0, 0, 0), index = 0, command_index = 0)
    # data
    @tone, @index, @actor = tone, index, $BlizzABS.battlers[index].battler
    # command window index
    @command_index = command_index
    # status effect names
    @states = [BlizzABS::Cache::WORDNormalState]
    (1...$data_states.size).each {|id| @states.push($data_states[id].name)}
    # get all items possible IDs #kk20
    @items = (1...$data_items.size).find_all {|id|
        $game_party.item_number(id) > 0 && $data_items[id].occasion < 2}
    # get all skill possible IDs #kk20
    @skills = $BlizzABS.util.get_actor_skills(@actor)
  end
  #----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # set screen tint
    @view.tone = @tone
    # create command window
    @command_window = Window_Command.new(160, BlizzABS::Cache::CommandsAITrigger)
    # command window coordinates
    @command_window.x = 480
    # command window initial index
    @command_window.index = @command_index
    # create trigger command window
    @tcommand_window = Window_Command.new(160, BlizzABS::Cache::CommandsTrigger)
    # trigger command window coordinates
    @tcommand_window.x = 480
    @tcommand_window.y = @command_window.height
    # trigger command window no cursor
    @tcommand_window.index = -1
    # trigger command window not active
    @tcommand_window.active = false
    # create name window
    @name_window = Window_Base.new(480, 416, 160, 64)
    # create bitmap
    @name_window.contents = Bitmap.new(@name_window.width - 32,
        @name_window.height - 32)
    # if using Dyna Edition scripts
    if $fontface != nil
      # set font name and size
      @name_window.contents.font.name = $fontface
      @name_window.contents.font.size = $fontsize
    # if using PK Edition 2
    elsif $defaultfonttype != nil
      # set font name and size
      @name_window.contents.font.name = $defaultfonttype
      @name_window.contents.font.size = $defaultfontsize
    end
    # draw actor name
    @name_window.draw_actor_name(@actor, 4, 0)
    # update trigger command display
    check_triggers
    # creat triggers window
    @triggers_window = Window_Triggers.new(@actor)
    # transition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # update the scene
      update
      # stop if frame update
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delete command window
    @command_window.dispose
    # delete trigger command window
    @tcommand_window.dispose
    # delete triggers window
    @triggers_window.dispose
    # delete name window
    @name_window.dispose
    # delete spriteset
    @spriteset.dispose
    # delete viewport
    @view.dispose
  end
  #----------------------------------------------------------------------------
  # check_triggers
  #  Checks unusable commands in the trigger command window.
  #----------------------------------------------------------------------------
  def check_triggers
    # refresh commands
    @tcommand_window.refresh
    # if ordering cannot be done
    if @actor.triggers.size < 2
      # disable ordering commands
      @tcommand_window.disable_item(4) #Move UP
      @tcommand_window.disable_item(5) #Move Down
      # if no triggers
      if @actor.triggers.size == 0
        # disable edit and delete
        @tcommand_window.disable_item(0) #Edit
        @tcommand_window.disable_item(2) #Delete
        @tcommand_window.disable_item(3) #Copy
      end
    end
  end
  #----------------------------------------------------------------------------
  # check_edits
  #  Checks unusable commands in the edit trigger command window.
  #----------------------------------------------------------------------------
  def check_edits
    # refresh commands
    @ecommand_window.refresh
    # if ordering cannot be done
    if @edit_window.trigger.action_type != BlizzABS::TRGSkill &&
        @edit_window.trigger.action_type != BlizzABS::TRGItem
      # disable skill/item selection command
      @ecommand_window.disable_item(5) #Action
    else #kk20
      if @edit_window.trigger.action_type == BlizzABS::TRGSkill
        if @skills.size == 0
          @ecommand_window.disable_item(5)
          @edit_window.trigger.action_type = 0
        end
      else
        if @items.size == 0
          @ecommand_window.disable_item(5)
          @edit_window.trigger.action_type = 0
        end
      end
    end
    # if probability activator
    if @edit_window.trigger.activator == BlizzABS::TRGProbability
      # disable condition selection command
      @ecommand_window.disable_item(1) #Condition
      # disable comparison operator selection command
      @ecommand_window.disable_item(2) #Comparison
      # disable target selection command
      @ecommand_window.disable_item(6) #target type
    end
    # if state condition or location condition
    if @edit_window.trigger.condition == BlizzABS::TRGState ||
        @edit_window.trigger.condition == BlizzABS::TRGLocation
      # disable comparison operator selection command
      @ecommand_window.disable_item(2) #Comparison
    end
  end
  #----------------------------------------------------------------------------
  # update
  #  The update processing method.
  #----------------------------------------------------------------------------
  def update
    # updates path finder
    $BlizzABS.AI.update
    # if command window is active
    if @command_window.active
      # update command
      update_command
    # if trigger command window is active
    elsif @tcommand_window.active
      # update trigger command
      update_trigger_command
    # if triggers window is active
    elsif @triggers_window.active
      # update triggers
      update_triggers
    # if edit command window exists
    elsif @edit_trigger_window != nil
      # update edit trigger
      update_edit_trigger
    # if edit command window exists
    elsif @ecommand_window != nil
      # update edit command
      update_edit_command
    end
  end
  #----------------------------------------------------------------------------
  # update_command
  #  The command window update processing method.
  #----------------------------------------------------------------------------
  def update_command
    # update command window
    @command_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Map.new
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # which option
      case @command_window.index
      when 0 # Triggers
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate command window
        @command_window.active = false
        # activate trigger command window
        @tcommand_window.active = true
        # set cursor
        @tcommand_window.index = 0
      when 1 # Next
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set next index
        @index = (@index + 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Triggers.new(@view.tone, @index, @command_window.index)
      when 2 # Previous
        # play sound
        $game_system.se_play($data_system.decision_se)
        # get all AI actors
        battlers = $BlizzABS.battlers
        # set next index
        @index = (@index + battlers.size - 1) % battlers.size
        # if battler not valid
        while battlers[@index].battler == nil
          # try to find one that is
          @index = (@index + battlers.size - 1) % battlers.size
        end
        # create hotkey assignment scene with the current screen tint
        $scene = Scene_AI_Triggers.new(@view.tone, @index, @command_window.index)
      when 3 # Exit
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create map scene
        $scene = Scene_Map.new
      end
    # if R is pressed
    elsif Input.trigger?(Input::R)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set next index
      @index = (@index + 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Triggers.new(@view.tone, @index, @command_window.index)
    # if L is pressed
    elsif Input.trigger?(Input::L)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # get all AI actors
      battlers = $BlizzABS.battlers
      # set next index
      @index = (@index + battlers.size - 1) % battlers.size
      # if battler not valid
      while battlers[@index].battler == nil
        # try to find one that is
        @index = (@index + battlers.size - 1) % battlers.size
      end
      # create hotkey assignment scene with the current screen tint
      $scene = Scene_AI_Triggers.new(@view.tone, @index, @command_window.index)
    end
  end
  #----------------------------------------------------------------------------
  # update_trigger_command
  #  The trigger command window update processing method.
  #----------------------------------------------------------------------------
  def update_trigger_command
    # update command window
    @tcommand_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # deactivate command window
      @command_window.active = true
      # activate behavior window
      @tcommand_window.active = false
      # set triggers index
      @tcommand_window.index = -1
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # which option
      case @tcommand_window.index
      when 0, 2, 3 #Edit, delete, copy
        # if no triggers
        if @actor.triggers.size == 0
          # play buzzer sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate trigger command window
        @tcommand_window.active = false
        # activate triggers window
        @triggers_window.active = true
        # set cursor
        @triggers_window.index = 0
      when 1 #Add
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate trigger command window
        @tcommand_window.active = false
        # create edit command window
        @ecommand_window = Window_Command.new(160, BlizzABS::Cache::CommandsEdit)
        # set coordinates
        @ecommand_window.x = @tcommand_window.x
        @ecommand_window.y = @tcommand_window.y
        @ecommand_window.z += 100
        # set cursor
        @ecommand_window.index = 0
        # set active
        @ecommand_window.active = true
        # create editing window
        @edit_window = Window_EditTrigger.new
        # check edit window display
        check_edits
      when 4, 5 #Move up/Down
        # if not enough triggers for ordering
        if @actor.triggers.size < 2
          # play buzzer sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate trigger command window
        @tcommand_window.active = false
        # activate triggers window
        @triggers_window.active = true
        # set cursor
        @triggers_window.index = 0
      when 6 #Exit
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate trigger command window
        @tcommand_window.active = false
        # activate command window
        @command_window.active = true
        # set triggers index
        @tcommand_window.index = -1
      end
    end
  end
  #----------------------------------------------------------------------------
  # update_triggers
  #  The triggers window update processing method.
  #----------------------------------------------------------------------------
  def update_triggers
    # update triggers window
    @triggers_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # activate trigger command window
      @tcommand_window.active = true
      # deactivate triggers window
      @triggers_window.active = false
      # remove cursor
      @triggers_window.index = -1
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # update specific action
      case @tcommand_window.index
      when 0
        # play sound
        $game_system.se_play($data_system.decision_se)
        # deactivate trigger command window
        @triggers_window.active = false
        # create edit command window
        @ecommand_window = Window_Command.new(160, BlizzABS::Cache::CommandsEdit)
        # set coordinates
        @ecommand_window.x = @tcommand_window.x
        @ecommand_window.y = @tcommand_window.y
        @ecommand_window.z = @tcommand_window.z + 100
        # set cursor
        @ecommand_window.index = 0
        # set active
        @ecommand_window.active = true
        # create editing window
        @edit_window = Window_EditTrigger.new(
            @actor.triggers[@triggers_window.index].clone)
        # check edit window display
        check_edits
      when 2
        # play sound
        $game_system.se_play($data_system.decision_se)
        # delete that trigger
        @actor.triggers.delete_at(@triggers_window.index)
        # refresh the display
        @triggers_window.refresh
        # refresh trigger command window display
        check_triggers
        # if no more triggers
        if @actor.triggers.size == 0
          # activate trigger command window
          @tcommand_window.active = true
          # deactivate triggers window
          @triggers_window.active = false
          # set cursor
          @triggers_window.index = -1
        # if last item in the list was deleted
        elsif @triggers_window.index == @actor.triggers.size
          # set to new last item
          @triggers_window.index -= 1
        end
      when 3
        # play sound
        $game_system.se_play($data_system.decision_se)
        # copy that trigger
        @actor.triggers.insert(@triggers_window.index,
            @actor.triggers[@triggers_window.index])
        # refresh the display
        @triggers_window.refresh
        # refresh trigger command window display
        check_triggers
      when 4
        # if first item selected
        if @triggers_window.index == 0
          # play buzzer sound
          $game_system.se_play($data_system.buzzer_se)
        else
          # play sound
          $game_system.se_play($data_system.decision_se)
          # swap those triggers
          @actor.triggers[@triggers_window.index],
              @actor.triggers[@triggers_window.index - 1] =
              @actor.triggers[@triggers_window.index - 1],
              @actor.triggers[@triggers_window.index]
          # refresh display
          @triggers_window.draw_item(@triggers_window.index)
          @triggers_window.index -= 1
          @triggers_window.draw_item(@triggers_window.index)
        end
      when 5
        # if last item selected
        if @triggers_window.index == @actor.triggers.size - 1
          # play buzzer sound
          $game_system.se_play($data_system.buzzer_se)
        else
          # play sound
          $game_system.se_play($data_system.decision_se)
          # swap those triggers
          @actor.triggers[@triggers_window.index],
              @actor.triggers[@triggers_window.index + 1] =
              @actor.triggers[@triggers_window.index + 1],
              @actor.triggers[@triggers_window.index]
          # refresh display
          @triggers_window.draw_item(@triggers_window.index)
          @triggers_window.index += 1
          @triggers_window.draw_item(@triggers_window.index)
        end
      end
    end
  end
  #----------------------------------------------------------------------------
  # update_edit_command
  #  The edit command window update processing method.
  #----------------------------------------------------------------------------
  def update_edit_command
    # update triggers window
    @ecommand_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # if adding a new trigger
      if @tcommand_window.index == 1
        # activate trigger command window
        @tcommand_window.active = true
      else
        # activate triggers window
        @triggers_window.active = true
      end
      # delete edit command window
      @ecommand_window.dispose
      # delete edit window
      @edit_window.dispose
      # clear variables
      @ecommand_window = @edit_window = nil
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # update specific action
      case @ecommand_window.index
      when 0 #activator
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(BlizzABS::Cache::TRGActivators,
            @edit_window.trigger.activator)
      when 1 # Condition
        # if probability activator
        if @edit_window.trigger.activator == BlizzABS::TRGProbability
          # play sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # possible commands
        commands = [$data_system.words.hp, $data_system.words.sp,
            BlizzABS::Cache::WORDState]
        # if not activated by party leader
        if @edit_window.trigger.activator != BlizzABS::TRGLeader
          # add location
          commands.push(BlizzABS::Cache::WORDLocation)
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(commands,
            @edit_window.trigger.condition)
      when 2 #comparison
        # if probability activator or state condition or location condition
        if @edit_window.trigger.activator == BlizzABS::TRGProbability ||
            @edit_window.trigger.condition == BlizzABS::TRGState ||
            @edit_window.trigger.condition == BlizzABS::TRGLocation
          # play sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(BlizzABS::Cache::TRGComparators,
            @edit_window.trigger.comparator)
      when 3 #value
        # play sound
        $game_system.se_play($data_system.decision_se)
        # if condition is state
        if @edit_window.trigger.condition == BlizzABS::TRGState
          # create edit trigger window
          create_edit_trigger_window(@states, @edit_window.trigger.value)
        # if location condition
        elsif @edit_window.trigger.condition == BlizzABS::TRGLocation
          # create edit trigger window
          create_edit_trigger_window(BlizzABS::Cache::TRGLocations,
              @edit_window.trigger.value)
        else
          # create a list of states
          @edit_trigger_window = Window_TriggerValue.new(0, 100,
              @edit_window.trigger.value)
        end
      when 4 #action type
        # attack and defend commands by default
        commands = [$data_system.words.attack, $data_system.words.guard]
        # add skill command if any skills available
        commands.push($data_system.words.skill) if @skills.size > 0
        # add item command if any items available
        commands.push($data_system.words.item) if @items.size > 0
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(commands,
            @edit_window.trigger.action_type)
      when 5 # Action
        commands = []
        # if skill action
        if @edit_window.trigger.action_type == BlizzABS::TRGSkill
          # get all skill names
          @skills.each {|id| commands.push($data_skills[id].name)}
          # index for selection
          index = @skills.index(@edit_window.trigger.action_data)
          index = 0 if index.nil? #kk20
        # if item action
        elsif @edit_window.trigger.action_type == BlizzABS::TRGItem
          # get all item names
          @items.each {|id| commands.push($data_items[id].name)}
          # index for selection
          index = @items.index(@edit_window.trigger.action_data)
          index = 0 if index.nil? #kk20
        else
          # play sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(commands, index)
      when 6 #target type
        # if probability activator
        if @edit_window.trigger.activator == BlizzABS::TRGProbability
          # play sound
          $game_system.se_play($data_system.buzzer_se)
          # exit method
          return
        end
        # play sound
        $game_system.se_play($data_system.decision_se)
        # create edit trigger window
        create_edit_trigger_window(BlizzABS::Cache::TRGTargets,
            @edit_window.trigger.target)
      when 7
        # play sound
        $game_system.se_play($data_system.decision_se)
        # if adding new trigger
        if @tcommand_window.index == 1
          # add new trigger
          @actor.triggers.push(@edit_window.trigger)
          # refresh display
          @triggers_window.refresh
          # set index to last position
          @triggers_window.index = @actor.triggers.size - 1
          # set mode to edit
          @tcommand_window.index = 0
          # refresh triggers command window
          check_triggers
        else
          # replace old trigger
          @actor.triggers[@triggers_window.index] = @edit_window.trigger
          # redraw display
          @triggers_window.draw_item(@triggers_window.index)
        end
        # set triggers window active
        @triggers_window.active = true
        # delete edit command window
        @ecommand_window.dispose
        # delete edit window
        @edit_window.dispose
        # clear variables
        @ecommand_window = @edit_window = nil
      when 8
        # play sound
        $game_system.se_play($data_system.decision_se)
        # if adding a new trigger
        if @tcommand_window.index == 1
          # activate trigger command window
          @tcommand_window.active = true
        else
          # activate triggers window
          @triggers_window.active = true
        end
        # delete edit command window
        @ecommand_window.dispose
        # delete edit window
        @edit_window.dispose
        # clear variables
        @ecommand_window = @edit_window = nil
      end
    end
  end
  #----------------------------------------------------------------------------
  # create_edit_trigger_window
  #  commands - window command list
  #  index    - selection index
  #  Creates and sets up an edit trigger window.
  #----------------------------------------------------------------------------
  def create_edit_trigger_window(commands, index = 0)
    # deactivate trigger command window
    @ecommand_window.active = false
    # create edit trigger window
    @edit_trigger_window = Window_Command.new(320, commands)
    # set edit trigger coordinates
    @edit_trigger_window.height = 480 if @edit_trigger_window.height > 480
    @edit_trigger_window.x = 160
    @edit_trigger_window.y = 240 - @edit_trigger_window.height / 2
    @edit_trigger_window.z = @ecommand_window.z + 100
    # set edit trigger window active
    @edit_trigger_window.active = true
    # set edit trigger window cursor
    @edit_trigger_window.index = index
   
    puts index
    puts commands
    puts @edit_trigger_window.oy
    puts '---'
  end
  #----------------------------------------------------------------------------
  # update_edit_trigger
  #  The edit trigger window update processing method.
  #----------------------------------------------------------------------------
  def update_edit_trigger
    # update triggers window
    @edit_trigger_window.update
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # return to edit command window
      return_to_edit_command_window
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # update specific action
      case @ecommand_window.index
      when 0 #activator
        # play sound
        $game_system.se_play($data_system.decision_se)
        # store old activator value
        old = @edit_window.trigger.activator
        # set new value for activator
        @edit_window.trigger.activator = @edit_trigger_window.index
        # if probability activator
        if @edit_window.trigger.activator == BlizzABS::TRGProbability
          # set value to 100 #kk20
          @edit_window.trigger.value = 100 if [BlizzABS::TRGState,BlizzABS::TRGLocation].include?(@edit_window.trigger.condition)
          # set condition to HP
          @edit_window.trigger.condition = BlizzABS::TRGHP
          # set comparison operator to equal
          @edit_window.trigger.comparator = BlizzABS::TRGEqual
          # set target to default
          @edit_window.trigger.target = BlizzABS::TRGTargetDefault
        # if party leader activator and location condition
        elsif @edit_window.trigger.activator == BlizzABS::TRGLeader &&
            @edit_window.trigger.condition == BlizzABS::TRGLocation
          # set condition to HP
          @edit_window.trigger.condition = BlizzABS::TRGHP
        end
        # refresh trigger display #kk20
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 1 #condition
        # save old trigger #kk20
        old = @edit_window.trigger.condition
        # play sound #kk20
        $game_system.se_play($data_system.decision_se)
        # set new value for trigger #kk20
        @edit_window.trigger.condition = @edit_trigger_window.index
        # if state condition
        if @edit_window.trigger.condition == BlizzABS::TRGState
          # set comparison operator to equal
          @edit_window.trigger.comparator = BlizzABS::TRGEqual
          # set state to normal #kk20
          @edit_window.trigger.value = 0 if old != BlizzABS::TRGState
        # if location condition
        elsif @edit_window.trigger.condition == BlizzABS::TRGLocation
          # set comparison operator to equal
          @edit_window.trigger.comparator = BlizzABS::TRGEqual
          # set default value to Closest #kk20
          @edit_window.trigger.value = 0 if old != BlizzABS::TRGLocation
        else #kk20
          # set value to 100 #kk20
          @edit_window.trigger.value = 100 if [BlizzABS::TRGState, BlizzABS::TRGLocation].include?(old)
        end
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 2 #comparison
        # play sound
        $game_system.se_play($data_system.decision_se)
        # set new value for trigger
        @edit_window.trigger.comparator = @edit_trigger_window.index
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 3 #value
        # play sound
        $game_system.se_play($data_system.decision_se)
        # if condition is state or location
        if @edit_window.trigger.condition == BlizzABS::TRGState ||
            @edit_window.trigger.condition == BlizzABS::TRGLocation
          # set to index
          @edit_window.trigger.value = @edit_trigger_window.index
        else
          # set to selected value
          @edit_window.trigger.value = @edit_trigger_window.number
        end
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 4 #action type
        # play sound
        $game_system.se_play($data_system.decision_se)
        # temporary variables
        old, new = @edit_window.trigger.action_type, @edit_trigger_window.index
        # if not skills availabled and selected skill action type
        if @skills.size == 0 && new == BlizzABS::TRGSkill
          # it is actually item action type #kk20
          new = BlizzABS::TRGItem
        end
        # if wasn't skill action type until now
        if old != BlizzABS::TRGSkill && new == BlizzABS::TRGSkill
          # set first available skill
          @edit_window.trigger.action_data = @skills[0]
        # if wasn't item action type until now
        elsif old != BlizzABS::TRGItem && new == BlizzABS::TRGItem
          # set first available item
          @edit_window.trigger.action_data = @items[0]
        end
        # set new value for trigger #kk20
        @edit_window.trigger.action_type = new
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 6 #target type
        # play sound
        $game_system.se_play($data_system.decision_se)
        # set new value for trigger
        @edit_window.trigger.target = @edit_trigger_window.index
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      when 5 #action
        # play sound
        $game_system.se_play($data_system.decision_se)
        # if skill action type
        if @edit_window.trigger.action_type == BlizzABS::TRGSkill
          # set skill ID
          @edit_window.trigger.action_data = @skills[@edit_trigger_window.index]
        # if item action type
        elsif @edit_window.trigger.action_type == BlizzABS::TRGItem
          # set item ID
          @edit_window.trigger.action_data = @items[@edit_trigger_window.index]
        end
        # refresh trigger display
        @edit_window.refresh
        # return to edit command window
        return_to_edit_command_window
      end
    end
  end
  #----------------------------------------------------------------------------
  # return_to_edit_command_window
  #  Sets everything up so the edit command window is active again.
  #----------------------------------------------------------------------------
  def return_to_edit_command_window
    # activate trigger command window
    @ecommand_window.active = true
    # delete edit trigger window
    @edit_trigger_window.dispose
    # clear variables
    @edit_trigger_window = nil
    # check edit window display
    check_edits
  end
 
end


All changes are marked with #kk20. There were instances where the window's refresh method needed to move down more and the changes to the trigger window had to be applied before some logic code. I cleaned up the setting of the values since it got weird if you changed the condition (for example, create a new trigger, change the condition to STATE and set the value to BLINK, then change the condition back to HP and watch the value turn into 16%, which would be Blink's ID). Another bug was if you had a trigger that used an item or skill and you wanted to edit the value of that trigger after you no longer have that item/skill, it would crash. Also, if you were to change the Action Type in this scenario, the cursor would be highlighting an empty command.

Users can replace this entire class inside the Blizz-ABS script themselves or just make a new script anywhere below part 3 (and above Main obviously).





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!