Yanfly Steal Skill description issue

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
This one is annoying me. I've played aroud a lot trying to fix it but looks like I'm a bit rusty at RMVX ACE after my intermission.

I'm using Yanfly Skill Steal and, as you can see, the text shows up all messed up in the help window for some reason.

I'll post the script here as its link is off.

#==============================================================================
#
# ▼ Yanfly Engine Ace - Skill Steal v1.00
# -- Last Updated: 2011.12.10
# -- Level: Normal
# -- Requires: n/a
#
#==============================================================================

$imported = {} if $imported.nil?
$imported["YEA-SkillSteal"] = true

#==============================================================================
# ▼ Updates
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# 2011.12.10 - Started Script and Finished.
#
#==============================================================================
# ▼ Introduction
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script enables items and skills to have skill stealing properties. When
# an actor uses that said item or skill on an enemy and the enemy has skills
# that can be stolen, that actor will learn all of the skills the enemy has to
# provide. This skill stealing system is madeakin to the Final Fantasy X's
# Lancet skill from Kimahri.
#
#==============================================================================
# ▼ Instructions
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
#
# -----------------------------------------------------------------------------
# Skill Notetags - These notetags go in the skills notebox in the database.
# -----------------------------------------------------------------------------
# <skill steal>
# If this skill targets an enemy, the actor who uses it will learn all of the
# stealable skills the enemy knows in its action list.
#
# <stealable skill>
# A skill with this notetag can be stolen from enemies if it is listed within
# the enemy's action list.
#
# -----------------------------------------------------------------------------
# Item Notetags - These notetags go in the items notebox in the database.
# -----------------------------------------------------------------------------
# <skill steal>
# If this item targets an enemy, the actor who uses it will learn all of the
# stealable skills the enemy knows in its action list.
#
#==============================================================================
# ▼ Compatibility
# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
# it will run with RPG Maker VX without adjusting.
#
#==============================================================================

module YEA
  module SKILL_STEAL
    
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # - Battlelog Settings -
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    # These are the various battlelog settings made for skill stealing. Change
    # the text and message duration for a successful skill stealing.
    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    MSG_SKILL_STEAL = "%s learns %s from %s!" # Text for successful steal.
    MSG_DURATION    = 4                       # Lower number = shorter duration.
    
  end # SKILL_STEAL
end # YEA

#==============================================================================
# ▼ Editting anything past this point may potentially result in causing
# computer damage, incontinence, explosion of user's head, coma, death, and/or
# halitosis so edit at your own risk.
#==============================================================================

module YEA
  module REGEXP
  module USABLEITEM
    
    SKILL_STEAL     = /<(?:SKILL_STEAL|skill steal)>/i
    STEALABLE_SKILL = /<(?:STEALABLE_SKILL|stealable skill)>/i
    
  end # USABLEITEM
  end # REGEXP
end # YEA

#==============================================================================
# ■ DataManager
#==============================================================================

module DataManager
 
  #--------------------------------------------------------------------------
  # alias method: load_database
  #--------------------------------------------------------------------------
  class <<self; alias load_database_ss load_database; end
  def self.load_database
    load_database_ss
    load_notetags_ss
  end
 
  #--------------------------------------------------------------------------
  # new method: load_notetags_ss
  #--------------------------------------------------------------------------
  def self.load_notetags_ss
    groups = [$data_skills, $data_items]
    for group in groups
      for obj in group
        next if obj.nil?
        obj.load_notetags_ss
      end
    end
  end
 
end # DataManager

#==============================================================================
# ■ RPG::UsableItem
#==============================================================================

class RPG::UsableItem < RPG::BaseItem
 
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :skill_steal
  attr_accessor :stealable_skill
 
  #--------------------------------------------------------------------------
  # common cache: load_notetags_ss
  #--------------------------------------------------------------------------
  def load_notetags_ss
    #---
    self.note.split(/[\r\n]+/).each { |line|
      case line
      #---
      when YEA::REGEXP::USABLEITEM::SKILL_STEAL
        @skill_steal = true
      when YEA::REGEXP::USABLEITEM::STEALABLE_SKILL
        next unless self.is_a?(RPG::Skill)
        @stealable_skill = true
      #---
      end
    } # self.note.split
    #---
  end
 
end # RPG::UsableItem

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler < Game_BattlerBase
 
  #--------------------------------------------------------------------------
  # alias method: item_user_effect
  #--------------------------------------------------------------------------
  alias game_battler_item_user_effect_ss item_user_effect
  def item_user_effect(user, item)
    game_battler_item_user_effect_ss(user, item)
    item_skill_steal_effect(user, item)
  end
 
  #--------------------------------------------------------------------------
  # new method: item_skill_steal_effect
  #--------------------------------------------------------------------------
  def item_skill_steal_effect(user, item)
    return unless item.skill_steal
    return unless user.actor?
    return if self.actor?
    for skill in stealable_skills
      next if user.skill_learn?(skill)
      @result.success = true
      break
    end
  end
 
end # Game_Battler

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
 
  #--------------------------------------------------------------------------
  # stealable_skills
  #--------------------------------------------------------------------------
  def stealable_skills
    array = []
    for action in enemy.actions
      skill = $data_skills[action.skill_id]
      array.push(skill) if skill.stealable_skill
    end
    return array
  end
 
end # Game_Enemy

#==============================================================================
# ■ Scene_Battle
#==============================================================================

class Scene_Battle < Scene_Base
 
  #--------------------------------------------------------------------------
  # alias method: apply_item_effects
  #--------------------------------------------------------------------------
  alias scene_battle_apply_item_effects_ss apply_item_effects
  def apply_item_effects(target, item)
    scene_battle_apply_item_effects_ss(target, item)
    apply_skill_steal(target, item)
  end
 
  #--------------------------------------------------------------------------
  # new method: apply_skill_steal
  #--------------------------------------------------------------------------
  def apply_skill_steal(target, item)
    return unless item.skill_steal
    return if target.actor?
    return unless @subject.actor?
    for skill in target.stealable_skills
      next if @subject.skill_learn?(skill)
      @subject.learn_skill(skill.id)
      string = YEA::SKILL_STEAL::MSG_SKILL_STEAL
      skill_text = sprintf("\\i[%d]%s", skill.icon_index, skill.name)
      text = sprintf(string, @subject.name, skill_text, target.name)
      @log_window.add_text(text)
      YEA::SKILL_STEAL::MSG_DURATION.times do @log_window.wait end
      @log_window.back_one
    end
  end
 
end # Scene_Battle

#==============================================================================
#
# ▼ End of File
#
#==============================================================================


I just want to know to fix this text to show properly. I've tried to rewrite the message code myself but it was a disaster.

If anyone is up for help, It would be apreciated!

Thanks.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
that question is about a certain custom script, that should go into it's own thread... XD


PS: Where did you get the idea of \i? the default escape codes doesn't have that... and the steal script doesn't seem to have it either
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I have split this into its own thread. Requests for help with scripts don't fall into the "questions that don't deserve their own thread" class, as they usually involve quite a bit of Q&A and discussion to resolve.


The \I[id] code is used in the RTP's Scene_Window class to add icons to text. But the text MUST be drawn by a method that calls draw_text_ex rather than draw_text.


I suspect the Yanfly steal script is not the problem here. You've got something else happening that is changing the default behaviour of the battle scene - your message is being shown in the help window rather than the battle log. And it may be that the help window uses draw_text and the battle log uses draw_text_ex. You can't just change the call around either, because they don't pass the same arguments.


Can you state what other battle related scripts you're using (and provide links)?
 

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
Damn! I messed up again! Didnt know it needed its own thread! Sorry guys!

Well, I know the issue is related to the other scripts I'm using but this one is the only the message corrupts like that!

Besides http://ffdiscovery.wikia.com                                    '>http://ffdiscovery.wikia.com                                     ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ABOUT                                                                     ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script changes the default window opacities and positioning in       ║
# ║ battle, as well as adds the option to make changes to how text displays   ║
# ║ in battle. It is fully compatible with Mr. Bubble's Generic Gauges        ║
# ║ script (version 1.00).                                                    ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ FEATURES                                                                  ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║  ► Change opacity of any window in battle.                                ║
# ║  ► Change X/Y position of any window in battle.                           ║
# ║  ► Change width/height of any window in battle.                           ║
# ║  ► Change font color, size, style and positioning of any text in battle.  ║
# ║  ► Choose between static windows or animating windows.                    ║
# ║  ► Allows an image to be used for the background of Window_BattleStatus.  ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ CHANGE LOG                                                                ║
# ╠═════════════════════════════════════════════════════════════════╤═════════╣
# ║ ■ December 12, 2012 : Added various font options.               │ (v1.01) ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ December 05, 2012 : Initial release.                          │ (v1.00) ║
# ╠═════════════════════════════════════════════════════════════════╧═════════╣
# ║ NEXT VERSION                                                              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ■ Script completed!                                                       ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ OVERWRITTEN METHODS                                                       ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║   This script overwrites a few methods in various default scripts.        ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_BattleStatus < Window_Selectable                           ║
# ║    ► def initialize                                                       ║
# ║    ► def draw_basic_area                                                  ║
# ║    ► def draw_gauge_area_with_tp                                          ║
# ║    ► def draw_gauge_area_without_tp                                       ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_BattleSkill < Window_SkillList                             ║
# ║    ► def initialize                                                       ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_BattleItem < Window_ItemList                               ║
# ║    ► def initialize                                                       ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ NEW METHODS                                                               ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║   There are several new methods introduced in this script.                ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_Base < Window                                              ║
# ║    ► def actor_name_font_size                                             ║
# ║    ► def actor_hp_font_size                                               ║
# ║    ► def actor_mp_font_size                                               ║
# ║    ► def actor_tp_font_size                                               ║
# ║    ► def actor_hp_digit_size                                              ║
# ║    ► def actor_mp_digit_size                                              ║
# ║    ► def actor_tp_digit_size                                              ║
# ║    ► def draw_actor_battle_hp                                             ║
# ║    ► def draw_actor_battle_mp                                             ║  
# ║    ► def draw_actor_battle_tp                                             ║\
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ INSTRUCTIONS                                                              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║   Paste this script ABOVE Main and BELOW Scene_Battle.                    ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ IMPORT SETTING                                                            ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
$imported = {} if $imported.nil? # Do not remove.
$imported["WC-CustomBattleHUD"] = true # Do not remove.
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ CUSTOMIZATION MODULE                                                      ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
module COOLIE # Do not remove.
  module HUD # Do not remove.
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ WINDOW OPACITY SETTINGS                                                   ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
   BATTLESTATUS_OPACITY       = 255  # Set opacity of Window_BattleStatus
   BATTLESTATUS_BACK_OPACITY  = 255   # Set back opacity of Window_BattleStatus
   
   PARTY_COMMAND_OPACITY      = 255  # Set opacity of Window_PartyCommand
   PARTY_COMMAND_BACK_OPACITY = 255  # Set back opacity of Window_PartyCommand
   
   COMMAND_OPACITY            = 255  # Set opacity of Window_ActorCommand
   COMMAND_BACK_OPACITY       = 255  # Set back opacity of Window_ActorCommand
   
   SKILL_WINDOW_OPACITY       = 255  # Set opacity of Window_BattleSkill
   SKILL_WINDOW_BACK_OPACITY  = 255  # Set back opacity of Window_BattleSkill
   
   ITEM_WINDOW_OPACITY        = 255  # Set opacity of Window_BattleItem
   ITEM_WINDOW_BACK_OPACITY   = 255  # Set back opacity of Window_BattleItem
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ WINDOW POSITIONING SETTINGS                                               ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
   BATTLESTATUS_X             = 0    # Set X coordinate of Window_BattleStatus
   BATTLESTATUS_Y             = 0    # Set Y coordinate of Window_BattleStatus
   
   SKILL_WINDOW_X             = 0    # Set X coordinate of Window_BattleSkill
   SKILL_WINDOW_Y             = 0    # Set Y coordinate of Window_BattleSkill
   
   ITEM_WINDOW_X              = 0    # Set X coordinate of Window_BattleItem
   ITEM_WINDOW_Y              = 0    # Set Y coordinate of Window_BattleItem
   
   HELP_WINDOW_X              = 0    # Set X coordinate of Window_Help
   HELP_WINDOW_Y              = 0    # Set Y coordinate of Window_Help
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ WINDOW TEXT SETTINGS                                                      ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
   VOCAB_NAME_SIZE            = 18   # Set the font size for Actor name text.
   VOCAB_HP_SIZE              = 12   # Set the font size for Actor "HP" text.
   VOCAB_MP_SIZE              = 12   # Set the font size for Actor "MP" text.
   VOCAB_TP_SIZE              = 12   # Set the font size for Actor "TP" text.
   
   HP_DIGITS_SIZE             = 14   # Set the font size for Actor HP digits.
   MP_DIGITS_SIZE             = 14   # Set the font size for Actor MP digits.
   TP_DIGITS_SIZE             = 14   # Set the font size for Actor TP digits.
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ END OF MODULE                                                             ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  end # Do not remove.
end # Do not remove.
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Window_Base                                                               ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
class Window_Base < Window
  #--------------------------------------------------------------------------
  # * New method: Actor Name Font Size
  #--------------------------------------------------------------------------
  def actor_name_font_size
    contents.font.size = COOLIE::HUD::VOCAB_NAME_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor HP Font Size
  #--------------------------------------------------------------------------
  def actor_hp_font_size
    contents.font.size = COOLIE::HUD::VOCAB_HP_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor MP Font Size
  #--------------------------------------------------------------------------
  def actor_mp_font_size
    contents.font.size = COOLIE::HUD::VOCAB_MP_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor TP Font Size
  #--------------------------------------------------------------------------
  def actor_tp_font_size
    contents.font.size = COOLIE::HUD::VOCAB_TP_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor HP Digit Size
  #--------------------------------------------------------------------------
  def actor_hp_digit_size
    contents.font.size = COOLIE::HUD::HP_DIGITS_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor MP Digit Size
  #--------------------------------------------------------------------------
  def actor_mp_digit_size
    contents.font.size = COOLIE::HUD::MP_DIGITS_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Actor TP Digit Size
  #--------------------------------------------------------------------------
  def actor_tp_digit_size
    contents.font.size = COOLIE::HUD::TP_DIGITS_SIZE
  end
  #--------------------------------------------------------------------------
  # * New method: Draw Battle HP
  #--------------------------------------------------------------------------
  def draw_actor_battle_hp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.hp_rate, hp_gauge_color1, hp_gauge_color2)
    change_color(system_color)
    actor_hp_font_size
    draw_text(x, y, 30, line_height, Vocab::hp_a)
    actor_hp_digit_size
    draw_current_and_max_values(x, y, width, actor.hp, actor.mhp,
      hp_color(actor), normal_color)
    reset_font_settings
  end
  #--------------------------------------------------------------------------
  # * New method: Draw Battle MP
  #--------------------------------------------------------------------------
  def draw_actor_battle_mp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.mp_rate, mp_gauge_color1, mp_gauge_color2)
    change_color(system_color)
    actor_mp_font_size
    draw_text(x, y, 30, line_height, Vocab::mp_a)
    actor_mp_digit_size
    draw_current_and_max_values(x, y, width, actor.mp, actor.mmp,
      mp_color(actor), normal_color)
    reset_font_settings
  end
  #--------------------------------------------------------------------------
  # * New method: Draw Battle TP
  #--------------------------------------------------------------------------
  def draw_actor_battle_tp(actor, x, y, width = 124)
    draw_gauge(x, y, width, actor.tp_rate, tp_gauge_color1, tp_gauge_color2)
    change_color(system_color)
    actor_tp_font_size
    draw_text(x, y, 48, line_height, Vocab::tp_a)
    change_color(tp_color(actor))
    actor_tp_digit_size
    draw_text(x + width - 42, y, 42, line_height, "", 2) #actor.tp.to_i, 2)
    reset_font_settings
  end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Window_BattleStatus                                                       ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
class Window_BattleStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0,0, window_width, window_height)
    refresh
    self.opacity = COOLIE::HUD::BATTLESTATUS_OPACITY
    self.back_opacity = COOLIE::HUD::BATTLESTATUS_BACK_OPACITY
    self.openness = 0
  end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Window_BattleSkill                                                        ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
class Window_BattleSkill < Window_SkillList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(128, Graphics.height - 120, Graphics.width - 128, 120)
    #super(0, y, Graphics.width, info_viewport.rect.y - y)
    self.visible = false
    self.opacity = COOLIE::HUD::SKILL_WINDOW_OPACITY
    self.back_opacity = COOLIE::HUD::SKILL_WINDOW_BACK_OPACITY
    @help_window = help_window
    @info_viewport = info_viewport
  end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Window_BattleItem                                                         ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
class Window_BattleItem < Window_ItemList
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     info_viewport : Viewport for displaying information
  #--------------------------------------------------------------------------
  def initialize(help_window, info_viewport)
    y = help_window.height
    super(128, Graphics.height - 120, Graphics.width - 128, 120)
    #super(0, y, Graphics.width, info_viewport.rect.y - y)
    self.visible = false
    self.opacity = COOLIE::HUD::ITEM_WINDOW_OPACITY
    self.back_opacity = COOLIE::HUD::ITEM_WINDOW_BACK_OPACITY
    @help_window = help_window
    @info_viewport = info_viewport
  end
end

class Scene_Battle < Scene_Base
  #--------------------------------------------------------------------------
  # * Create Help Window
  #--------------------------------------------------------------------------
  def create_help_window
    @help_window = Window_Help.new
    @help_window.visible = false
    @help_window.y = Graphics.height - 343 - 72
  end
end

Final Fantasy Battle Log

# ╔══════════════════════════════════════════════════════╤═══════╤════════════╗
# ║ Final Fantasy Style Battle Log                       │ v1.02 │ (12/05/12) ║
# ╠══════════════════════════════════════════════════════╧═══════╧════════════╣
# ║ Author  : William Couillard                                               ║
# ║ Thanks  : Swish & Keith Brewer                                            ║
# ║ E-Mail  : cooliebk18@yahoo.com                                            ║
# ║ Website : http://ffdiscovery.wikia.com                                    ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ABOUT                                                                     ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ This script changes the behavior of the battle log window to act as the   ║
# ║ Battle Log window in a Final Fantasy game would.                          ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ FEATURES                                                                  ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ► Removes the black background behind the Battle Log window.              ║
# ║ ► Changes the window to be opaque, and centers the text within the        ║
# ║   window.                                                                 ║
# ║ ► Ability to disable certain skills from showing up in the Battle Log     ║
# ║   window (i.e. normal attacks, defending, hidden skills).                 ║
# ║ ► Options added to change the window width and window alignment of the    ║
# ║   Battle Log.                                                             ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ KNOWN ISSUES                                                              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ► When states are applied or removed, the Battle Log text is cleared      ║
# ║   prematurely.                                                            ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ CHANGE LOG                                                                ║
# ╠═════════════════════════════════════════════════════════════════╤═════════╣
# ║ ■ December 12, 2012 : Font options added.                       │ (v1.02) ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ December 06, 2012 : Width and Window alignment options added. │ (v1.01) ║
# ║                       Show Name option added.                   │         ║
# ╟─────────────────────────────────────────────────────────────────┼─────────╢
# ║ ■ December 05, 2012 : Initial release.                          │ (v1.00) ║
# ╠═════════════════════════════════════════════════════════════════╧═════════╣
# ║ NEXT VERSION                                                              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ ■ Update to display Item and Skill Icons in BattleLog Window.             ║
# ║ ■ Update to toggle Item and Skill Icons in BattleLog Window.              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ OVERWRITTEN METHODS                                                       ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║   This script overwrites a few methods in various default scripts.        ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_BattleLog < Window_Selectable                              ║
# ║    ► def initialize                                                       ║
# ║    ► def window_width                                                     ║
# ║    ► def max_line_number                                                  ║
# ║    ► def clear                                                            ║
# ║    ► def refresh                                                          ║
# ║    ► def back_opacity                                                     ║
# ║    ► def draw_line                                                        ║
# ║    ► def display_use_item                                                 ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ NEW METHODS                                                               ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║   There are several new methods introduced in this script.                ║
# ╟───────────────────────────────────────────────────────────────────────────╢
# ║ ■ class Window_BattleLog < Window_Selectable                              ║
# ║    ► def window_left_position                                             ║
# ║    ► def window_center_position                                           ║
# ║    ► def window_right_position                                            ║
# ║    ► def y_offset                                                         ║
# ║    ► def wait_for_frames                                                  ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ INSTRUCTIONS                                                              ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ Simply paste this script anywhere above the Main Process script and below ║
# ║ Window_BattleLog.                                                         ║
# ║                                                                           ║
# ║ NOTE: When setting the "use" message in the database for a skill, it is   ║
# ║       important to remember that the Actor name or Enemy name is OMITTED. ║
# ║       It's usually a good idea just to input the skill's name in the      ║
# ║       "use" message dialogue box.                                         ║
# ║                                                                           ║
# ║ Example: "Fire" instead of "casts Fire!"                                  ║
# ╠═══════════════════════════════════════════════════════════════════════════╣
# ║ IMPORT SETTING                                                            ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
$imported = {} if $imported.nil?             # Do not edit
$imported["WC-FFStyleBattleLog_1.02"] = true # Do not edit
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ CUSTOMIZATION MODULE                                                      ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
module COOLIE
  module LOG
    SHOW_NAMES      = false # Show actor or enemy name prior to skill message?
    MAX_LINE_NUMBER = 1     # Maximum number of lines in Battle Log [default: 1]
                            # NOTE: This will increase the height of the window.
    OPACITY         = 255   # Opacity of Battle Log Window [default: 255]
    BACK_OPACITY    = 255   # Back opacity of Battle Log Window [default: 255]
    BATTLELOG_WIDTH = 400   # Width of the Battle Log Window. [default: 544]
    WINDOW_Y        = 4     # Y position of the Battle Log Window [default: 4]
    WINDOW_ALIGN    = 1     # 0: Left, 1: Center, 2: Right [default: 1]
    TEXT_ALIGN      = 1     # 0: Left, 1: Center, 2: Right [default: 1]
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ SKILL IGNORE: Skill IDs in this array will not bring up the Battle Log.   ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
    IGNORE_SKILLS   = [
                         1, # Actor Normal Attack
                         2, # Defend
                         127, # Actor Normal Attack (Drain)
                         128, # Actor Normal Attack (Mini Status)
                         129, # Actor Normal Attack (Heal Rod)
                       130, # Enemy Normal Attack
                       536, # Burning Tackle
                       552, # Poison Punch
                       ]
  end
end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Window_BattleLog                                                          ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
class Window_BattleLog < Window_Selectable
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Object Initialization                                                     ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def initialize
    case COOLIE::LOG::WINDOW_ALIGN
      when 0 # Left Aligned
        super(window_left_position, y_offset, window_width, window_height)
      when 1 # Center Aligned
        super(window_center_position, y_offset, window_width, window_height)
      when 2 # Right Aligned
        super(window_right_position, y_offset, window_width, window_height)
      end
    self.z = 200
    self.opacity = 0
    @lines = []
    @num_wait = 0
    create_back_bitmap
    create_back_sprite
    refresh
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Window Width                                                          ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def window_width
    return COOLIE::LOG::BATTLELOG_WIDTH
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Window Left Position                                                  ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def window_left_position
    return Graphics.width - Graphics.width
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Window Center Position                                                ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def window_center_position
    return Graphics.width / 2 - COOLIE::LOG::BATTLELOG_WIDTH / 2
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Window Right Position                                                 ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def window_left_position
    return Graphics.width - window_width
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Window Y Offset                                                       ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def y_offset
    return COOLIE::LOG::WINDOW_Y
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Maximum No. of Lines                                                  ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def max_line_number
    return COOLIE::LOG::MAX_LINE_NUMBER
  end  
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Clear                                                                     ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def clear
    @num_wait = 0
    @lines.clear
    self.opacity = 0
    refresh
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Refresh                                                                   ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def refresh
    contents.clear
    @lines.size.times {|i| draw_line(i) }
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Get Background Opacity                                                    ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def back_opacity
    return COOLIE::LOG::BACK_OPACITY
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Wait For Frames                                                           ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def wait_for_frames(frames)
    @num_wait += frames
    @method_wait.call(message_speed) if @method_wait
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ Display Skill/Item Use                                                    ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
  def display_use_item(subject, item)
    if item.is_a?(RPG::Skill)
      for i in 0..COOLIE::LOG::IGNORE_SKILLS.length
        if item.id.to_s == COOLIE::LOG::IGNORE_SKILLS.to_s
          return
        end
      end
    end
    if item.is_a?(RPG::Skill)
      self.opacity = COOLIE::LOG::oPACITY
      if COOLIE::LOG::SHOW_NAMES == true
        draw_text(0, 0, window_width - 12, max_line_number * 24, subject.name + item.message1, COOLIE::LOG::TEXT_ALIGN)
      else
        draw_text(0, 0, window_width - 12, max_line_number * 24, item.message1, COOLIE::LOG::TEXT_ALIGN)
      end
      unless item.message2.empty?
        wait
        draw_text(0, 0, window_width - 12, max_line_number * 24, item.message2, COOLIE::LOG::TEXT_ALIGN)
      end
    else
      self.opacity = COOLIE::LOG::oPACITY
      draw_text(0, 0, window_width - 12, max_line_number * 24, item.name, COOLIE::LOG::TEXT_ALIGN)
    end
    wait_for_frames(30)
  end
# ╔═══════════════════════════════════════════════════════════════════════════╗
# ║ END OF FILE                                                               ║
# ╚═══════════════════════════════════════════════════════════════════════════╝
end
 

About that \i - I have pasted the clear script without any changes of my own.

I'm sorry if it looks very basic, but I got rusty after sometime far from the project.

I will keep analysing the hints u guys gave me and mess around with the script.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
You could also try swapping the order of the scripts. Sometimes it helps.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
That custom battle log doesn't use draw_text_ex. If you scroll to the bottom you see it manually doing draw_text, instead of simply passing it to draw_text_ex for whatever reason.


You'd either have to find a different script, or ask someone to make the required changes to make it proper as an RM window.
 
Last edited by a moderator:

Nugem

The Hobbit
Veteran
Joined
Jun 28, 2013
Messages
93
Reaction score
0
First Language
PT-BR
Primarily Uses
You could also try swapping the order of the scripts. Sometimes it helps.
Yeah, Shaz. I've already tried it. This one is actually one of the last scripts in order, cuz if I put it too early it wont work at all.

Yikes! Sure looks harder than I thought...

Unfortunately this is the only SKILL STEAL (Blue Magic) script that worked for me. I have tried some similars (even Tsukihime's), but for some reason it didnt work. Prolly compatibilty issues with Victor scripts.

I will keep trying but if you could point me the easiest way to fix it or some similar scripts, would be a hella of a help.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top