Enemy description script that functions with MOG scripts

Discussion in 'RGSS3 Script Requests' started by Shytoad, Jun 8, 2019.

  1. Shytoad

    Shytoad May never find a good Avatar Member

    Messages:
    13
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    I used a script to give enemies descriptions by pressing shift while targetting them, but i started using these scripts upload_2019-6-7_10-52-43.png and once I enabled them, they stopped working. Can somebody make a modified version of the Scan Enemy Script that functions with those other scripts?
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,644
    Likes Received:
    6,584
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    please give links to the website(s) where you got the other scripts - no one can write a compatibility fix without checking all involved scripts.
     
    #2
  3. Shytoad

    Shytoad May never find a good Avatar Member

    Messages:
    13
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    sorry, here are the links to the moghunter scripts

    https://atelierrgss.wordpress.com/rgss3-chain-commands-m/

    https://atelierrgss.wordpress.com/rgss3-battle-hud-ex/

    https://atelierrgss.wordpress.com/rgss3-actor-picture-cm/

    https://atelierrgss.wordpress.com/rgss3-atb-meter/

    https://atelierrgss.wordpress.com/rgss3-active-time-battle/
     
    #3
  4. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,741
    Likes Received:
    381
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Its the ATB that the script is not compatible with.
    Use Yanfly's Enemy Target Info. It works. You just need to add in a z value to the window (it gets hidden by MOG's ATB script)
    Line 742 add in
    self.z = 290
     
    #4
  5. Shytoad

    Shytoad May never find a good Avatar Member

    Messages:
    13
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    Can you write things in the enemy's notes and have them appear?
     
    #5
  6. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,741
    Likes Received:
    381
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    Working on it. Got it mostly working.
     
    Last edited: Jun 8, 2019
    #6
    Shytoad likes this.
  7. Shytoad

    Shytoad May never find a good Avatar Member

    Messages:
    13
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMVXA
    Thanks!
     
    #7
  8. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,741
    Likes Received:
    381
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    I'm stuck.
    Are there any other scripter's out there that can finish this.
    * Updated - Still not working. Need help
    Code:
    #==============================================================================
    #
    # ▼ Yanfly Engine Ace - Enemy Target Info v1.02.1 addon
    # -- Last Updated: 2012.01.01
    # -- Level: Normal
    # -- Requires: YEA - Ace Battle Engine v1.10+.
    # -- addon by Roninator2
    #==============================================================================
    ###--------------------------------------------------------------------------###
    #      Instructions:                                                           #
    #  Place this script in the "Materials" section of the scripts above main.     #
    ###-----                                                                -----###
    #      Enemy Tags:                                                             #
    #  <enemy_bio>  -and-  </enemy_bio>                                            #
    #    Sets the text between these tags to the bio description for the enemy.    #
    #    This automatically formats allowing you to type the entire bio in a       #
    #    single line in the notebox and then showing it over the required lines    #
    #    on the scan screen.                                                       #
    #  USAGE:                                                                      #
    #    <enemy bio>                                                               #
    #    Enemy bio goes here.  You can type it all on one line.                    #
    #    Or you can use more than one line.                                        #
    #    </enemy bio>                                                              #
    ###--------------------------------------------------------------------------###
    
    class Window_EnemyBio < Window_Selectable
    
      def initialize
        w = Graphics.width
        h = fitting_height(3)
        super(0, 0, w, h)
        self.z = 290
        update
      end
     
      def update
        super
        return unless self.visible
        refresh
      end
    
      def refresh
        contents.clear
        r2_draw_enemy_note(0,0,Graphics.width,fitting_height(3),enemy)
      end
     
      def notes
        enemy.enemy_desc_scan
      end
     
      def r2_draw_enemy_note(x,y,width,height,enemy)
        contents.font.size = 20
        notes.each do |line|
          draw_text(x, y, contents.width, line_height, line)
          y += line_height
        end
      end
    
      def enemy
        $game_troop.alive_members[@index].enemy
      end
     
      def contents_height
        height - standard_padding * 2
      end
    
      def update_cursor
      end
     
    end
    
    class RPG::Enemy < RPG::BaseItem
    
      def enemy_desc_scan
        make_enemy_desc_scan if @enemy_desc_scan.nil?
        return @enemy_desc_scan
      end
    
      def make_enemy_desc_scan
        @enemy_desc_scan = []
        results = self.note.scan(/<enemy[-_ ]*bio>(.*?)<\/enemy[-_ ]*bio>/imx)
        results.each do |res|
          res[0].strip.split("\r\n").each do |line|
          @enemy_desc_scan.push("#{line}")
          end
        end
      end
     
    end
    
    class Scene_Battle < Scene_Base
     
      #--------------------------------------------------------------------------
      # alias method: create_all_windows
      #--------------------------------------------------------------------------
      alias r2_scene_battle_create_all_windows_eti create_all_windows
      def create_all_windows
        r2_scene_battle_create_all_windows_eti
        create_bio_window
      end
     
      def create_bio_window
        @enemy_bio = Window_EnemyBio.new
        @enemy_bio.hide
      end
    
      alias r2_show_comparison_windows  show_comparison_windows
      def show_comparison_windows
        r2_show_comparison_windows
        @enemy_bio.show
      end
     
      alias r2_hide_comparison_windows  hide_comparison_windows
      def hide_comparison_windows
        r2_hide_comparison_windows
        @enemy_bio.hide
      end
     
    end
    
    ###--------------------------------------------------------------------------###
    #  End of script.                                                              #
    ###--------------------------------------------------------------------------###

    I used a few lines from the CP Enemy Scan script and Yanfly's script.

    The issue is that the bio info does not update when changing targets. It grabs the first enemy and displays that.
    I tried to use other methods of grabbing the text but it didn't work so that's why CP's code is in there.
     
    Last edited: Jun 10, 2019
    #8

Share This Page