Enemy command talk scripts

Discussion in 'RGSSx Script Support' started by LvdvE, Jun 1, 2019.

  1. LvdvE

    LvdvE Villager Member

    Messages:
    19
    Likes Received:
    0
    First Language:
    French
    Primarily Uses:
    RMVXA
    I must have trouble expressing it, sorry. For Enemy talk or Enemy interaction there is no problem.
    I wanted to talk about the command accessible in event (4th button of the 1st page) which allows to select a key item. This command is in conflict with "Actor inventory" in the same way as Enemy interaction and its "give" command was.
     
    #21
  2. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,649
    Likes Received:
    365
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Compatibility patch
    Code:
    =begin
    #===============================================================================
     Title: Patch for Advanced Select Item v1.1.1
     Author: V.M of D.T & Roninator2
     Date: Aug 17, 2019
    --------------------------------------------------------------------------------
     ** Terms of Use
     * Free to use in non-commercial & commercial use
     * No real support. The script is provided as-is
    --------------------------------------------------------------------------------
     ** Description
     Compatibility patch for Vlue Advanced Select Item
     and Hime Actor Inventory scripts
     
     Will now select key items from the main actor
     
    =end
    
    class Window_KeyItem
      alias r2_start_adv_sel_924h  start
      def start
        @actor = actor
        r2_start_adv_sel_924h
      end
      alias r2_include_adv_sel_923jf?  include?
      def include?(item,id)
        @actor ? @actor.usable?(item) : false
        r2_include_adv_sel_923jf?(item,id)
      end
      def actor
        @actor
      end
      def make_item_list
        @data = nil
        if !category.nil?
          category.each_index do |id|
            if all_items?(id)
              weapon = @actor.all_items.select {|item| include?(item,id) }
              armor = @actor.all_items.select {|item| include?(item,id) }
              items = @actor.all_items.select {|item| include?(item,id) }
              if @data.nil?
                @data = weapon + armor + items
              else
                if modifier == "&"
                  @data & weapon
                  @data & armor
                  @data & items
                elsif modifier == "|"
                  @data | weapon
                  @data | armor
                  @data | items
                else
                  @data = weapon + armor + items
                end
              end
            else
              items = @actor.all_items.select {|item| include?(item,id) }
              if @data.nil?
                @data = items
              else
                if modifier == "&"
                  @data = @data & items
                elsif modifier == "|"
                  @data = @data | items
                else
                  @data += items
                end
              end
            end
          end
        else
          @data = @actor.all_items.select {|item| include?(item,0) }
        end
      end
    
    end
     
    #22
  3. LvdvE

    LvdvE Villager Member

    Messages:
    19
    Likes Received:
    0
    First Language:
    French
    Primarily Uses:
    RMVXA
    Thanks Roninator !
     
    #23

Share This Page