Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 KSkillMsg
#1
KSkillMsg
VX + ACE

by Kyonides

Introduction

Do you want to replace the default message for the Escape skill? Thinking
Or any other skill? Confused
Now you can do it by using special note tags! Grinning
Happy with a sweat Please read the instructions already embedded in the script before asking questions here.

VX Script

Code:
# * KSkillMsg VX * #
#  Scripter : Kyonides Arkanthes
#  2023-09-19

# * How to Use * #
# Option 1: Place 1 or more notetags in a given Skill's Note Box.
# Option 2: Set a custom "string" to the ESCAPE_START Constant below.

# - Example of a Note Tag for Actors - Skill can be cast individually - #
#<message: actor 1 leaves at once.>

# - Example of a Note Tag for Enemies - #
#<message: enemy 1 chickens out.>

# - ESCAPE_START Constant's Default Value - #
# Below you will find the expression %s included in the string.
# It is used as a placeholder for the party's name.
# ESCAPE_START = "%s runs away from danger."

module KSkillMsg
  ESCAPE_START = "%s runs away from danger."
  REGEX_ACTOR = /<message: (actor) (\d+) ([^>]+)>/i
  REGEX_ENEMY = /<message: (enemy) (\d+) ([^>]+)>/i
  def self.process_msg(subject, item, default_line)
    regex = subject.is_a?(Game_Enemy)? REGEX_ENEMY : REGEX_ACTOR
    item.note[regex]
    ($1.nil? or subject.id != $2.to_i)? default_line : " " + $3
  end
end

class Game_Enemy
  def id
    @enemy_id
  end
end

class Scene_Battle
  def process_escape
    @info_viewport.visible = false
    @message_window.visible = true
    text = rand(100) < 50 ? Vocab::EscapeStart : KSkillMsg::ESCAPE_START
    text = sprintf(text, $game_party.name)
    $game_message.texts.push(text)
    if $game_troop.preemptive
      success = true
    else
      success = (rand(100) < @escape_ratio)
    end
    Sound.play_escape
    if success
      wait_for_message
      battle_end(1)
    else
      @escape_ratio += 10
      $game_message.texts.push('\.' + Vocab::EscapeFailure)
      wait_for_message
      $game_party.clear_actions
      start_main
    end
  end

  def alternate_display_use_item(skill)
    line = KSkillMsg.process_msg(@active_battler, skill, skill.message1)
    @message_window.add_instant_text(@active_battler.name + line)
    return if skill.message2.empty?
    wait(10)
    @message_window.add_instant_text(skill.message2)
  end

  def execute_action_skill
    skill = @active_battler.action.skill
    alternate_display_use_item(skill)
    targets = @active_battler.action.make_targets
    display_animation(targets, skill.animation_id)
    @active_battler.mp -= @active_battler.calc_mp_cost(skill)
    $game_temp.common_event_id = skill.common_event_id
    for target in targets
      target.skill_effect(@active_battler, skill)
      display_action_effects(target, skill)
    end
  end
end

VX ACE Script

Code:
# * KSkillMsg ACE * #
#  Scripter : Kyonides Arkanthes
#  2023-09-19

# * How to Use * #
# Option 1: Place 1 or more notetags in a given Skill's Note Box.
# Option 2: Set a custom "string" to the ESCAPE_START Constant below.

# - Example of a Note Tag for Actors - Skill can be cast individually - #
#<message: actor 1 leaves at once.>

# - Example of a Note Tag for Enemies - #
#<message: enemy 1 chickens out.>

# - ESCAPE_START Constant's Default Value - #
# Below you will find the expression %s included in the string.
# It is used as a placeholder for the party's name.
# ESCAPE_START = "%s runs away from danger."

module KSkillMsg
  ESCAPE_START = "%s runs away from danger."
  REGEX_ACTOR = /<message: (actor) (\d+) ([^>]+)>/i
  REGEX_ENEMY = /<message: (enemy) (\d+) ([^>]+)>/i
  def self.process_msg(subject, item, default_line)
    regex = subject.is_a?(Game_Enemy)? REGEX_ENEMY : REGEX_ACTOR
    item.note[regex]
    ($1.nil? or subject.id != $2.to_i)? default_line : " " + $3
  end
end

module BattleManager
  def self.process_escape
    text = rand(100) < 50 ? Vocab::EscapeStart : KSkillMsg::ESCAPE_START
    text = sprintf(text, $game_party.name)
    $game_message.add(text)
    success = @preemptive ? true : (rand < @escape_ratio)
    Sound.play_escape
    if success
      process_abort
    else
      @escape_ratio += 0.1
      $game_message.add('\.' + Vocab::EscapeFailure)
      $game_party.clear_actions
    end
    wait_for_message
    return success
  end
end

class Game_Enemy
  def id
    @enemy_id
  end
end

class Window_BattleLog
  alias :kyon_escape_msg_win_btl_log_disp_use_itm :display_use_item
  def display_use_item(subject, item)
    return alternate_display_use_item(subject, item) if item.is_a?(RPG::Skill)
    kyon_escape_msg_win_btl_log_disp_use_itm(subject, item)
  end

  def alternate_display_use_item(subject, item)
    line = KSkillMsg.process_msg(subject, item, item.message1)
    add_text(subject.name + line)
    return if item.message2.empty?
    wait
    add_text(item.message2)
  end
end


Terms & Conditions

Free for use in ANY game. Gamer
Due credit is mandatory. Serious
The script is distributed AS IS. Happy with a sweat
That's it! Tongue sticking out
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#2
A Not Really Unexpected Update But Definitely an Useful One!

From now on, RMVX has been become the second port of this family of scripts! Grinning

Both versions allow you to change ANY SKILL's first message based on a very special note tag you can type right into your note box. Winking

For Actors:

Code:
<message: actor 1 leaves at once.>

For Enemies:

Code:
<message: enemy 1 chickens out.>

Have a Nice String Replacement Day! Laughing
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }




Users browsing this thread: