Skill section: how do I make the skill message specify the target?

BlossomStudios

Villager
Member
Joined
Jan 8, 2023
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm trying to make a skill called Bite, where the message that displays when it is used is, "[User] takes a big bite out of [target]!" But I am very new to RPGMaker and I do not know what I need to type to get it to specify the target's name when the skill is performed in battle.

In my below picture, I am using B as the placeholder in the message.
1674945052455.png

I'm hoping this will be a simple question to answer. Any help is appreciated, thank you! :)
 

ic1025

Veteran
Veteran
Joined
Jan 18, 2023
Messages
33
Reaction score
11
First Language
English
Primarily Uses
N/A
Nvm, my suggestion didn't work
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
7,629
Reaction score
5,398
First Language
English
Primarily Uses
RMMV
You can't just type something, you need a plugin. If you do a Google for it, there are a few posts on here that have provided this functionality.

If you can't find one that does what you want, please provide links to what you tried and how it didn't work for you.
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
882
Reaction score
425
First Language
English
Primarily Uses
RMXP
Ehem, here's my solution to your humble request.
EDIT: I have published the Full version on the corresponding subforum.

JavaScript:
//===========================================
// * KMessageTargetMV.js
//===========================================
/*:
 * @plugindesc This plugin will let you add the enemy's name to a skill's
 * action message by using a tag or wildcard.
 * @author Kyonides Arkanthes
 * @help Date: 2023-01-30
 * # * Free as in beer. * #
 * The regular expression or regex is %e by default.
*/

function KMessageTarget() {
  throw new Error('This is a static class');
}

KMessageTarget.regex = /%e/i;

Window_BattleLog.prototype.displaySkillTargets = function(subject, item, targets) {
  let target = 0;
  let msg = "";
  for (var i = 0; i < targets.length; i++) {
    target = targets[i];
    if (item.message1) {
      msg = subject.name() + item.message1.format(item.name);
      msg = msg.replace(KMessageTarget.regex, target.name());
      this.push('addText', msg);
    }
    if (item.message2) {
      this.push('addText', item.message2.format(item.name));
    }
  }
}

const KMessageTarget_win_btl_log_displayAction = Window_BattleLog.prototype.displayAction;

Window_BattleLog.prototype.displayAction = function(subject, item, targets) {
  if (DataManager.isSkill(item)) {
    this.displaySkillTargets(subject, item, targets);
  } else {
    KMessageTarget_win_btl_log_displayAction.call(subject, item);
  }
};

Window_BattleLog.prototype.startAction = function(subject, action, targets) {
  let item = action.item();
  this.push('performActionStart', subject, action);
  this.push('waitForMovement');
  this.push('performAction', subject, action);
  this.push('showAnimation', subject, targets.clone(), item.animationId);
  this.displayAction(subject, item, targets);
};
 
Last edited:

BlossomStudios

Villager
Member
Joined
Jan 8, 2023
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
Ehem, here's my solution to your humble request.

JavaScript:
//===========================================
// * KMessageTargetMV.js
//===========================================
/*:
 * @plugindesc This plugin will let you add the enemy's name to a skill's
 * action message by using a tag or wildcard.
 * @author Kyonides Arkanthes
 * @help Date: 2023-01-30
 * # * Free as in beer. * #
 * The regular expression or regex is %e by default.
*/

function KMessageTarget() {
  throw new Error('This is a static class');
}

KMessageTarget.regex = /%e/i;

Window_BattleLog.prototype.displaySkillTargets = function(subject, item, targets) {
  let target = 0;
  let msg = "";
  for (var i = 0; i < targets.length; i++) {
    target = targets[i];
    if (item.message1) {
      msg = subject.name() + item.message1.format(item.name);
      msg = msg.replace(KMessageTarget.regex, target.name());
      this.push('addText', msg);
    }
    if (item.message2) {
      this.push('addText', item.message2.format(item.name));
    }
  }
}

const KMessageTarget_win_btl_log_displayAction = Window_BattleLog.prototype.displayAction;

Window_BattleLog.prototype.displayAction = function(subject, item, targets) {
  if (DataManager.isSkill(item)) {
    this.displaySkillTargets(subject, item, targets);
  } else {
    KMessageTarget_win_btl_log_displayAction.call(subject, item);
  }
};

Window_BattleLog.prototype.startAction = function(subject, action, targets) {
  let item = action.item();
  this.push('performActionStart', subject, action);
  this.push('waitForMovement');
  this.push('performAction', subject, action);
  this.push('showAnimation', subject, targets.clone(), item.animationId);
  this.displayAction(subject, item, targets);
};

Oh my goodness, thank you so very much! I just thought there might be something I could type in that I didn't know about--I didn't realize it would require a plugin and definitely didn't expect someone to go so far as to make one to help me. You're very kind; thank you SO much! :D
 

kyonides

Reforged is laughable
Veteran
Joined
Nov 17, 2019
Messages
882
Reaction score
425
First Language
English
Primarily Uses
RMXP
Oh my goodness, thank you so very much! I just thought there might be something I could type in that I didn't know about--I didn't realize it would require a plugin and definitely didn't expect someone to go so far as to make one to help me. You're very kind; thank you SO much! :D
You're partially right, there was the %2 wildcard BUT you still needed a plugin to implement the string replacement process. Anyway, using %a and %e seems to sound more natural to average people IMHO.

Probably, you haven't noticed this, but that version is the Simple one. I've posted the other version , the Full one, on a separate thread in the JS Plugins Releases (MV) subforum.
 

BlossomStudios

Villager
Member
Joined
Jan 8, 2023
Messages
7
Reaction score
0
First Language
English
Primarily Uses
RMMV
You're right; I hadn't noticed. Thanks for letting me know!
 

Latest Threads

Latest Posts

Latest Profile Posts

Learn how to do custom face parts with my latest tutorial!
Generatorpartsfromscratch.png
The Legion
T7T0hR2.gif
Made a title screen, and by ''made'' I ofc mean I slapped a simple title on some cool art I bought xD This side project might be fun.

sIMPLE.png
CDF.png

Trying for a Classical RPG with Pokemon Elements. Capture monsters like Zombies and Harpys and use them on your team.
ow28O4A.png

Astarte in her usual demeanor: mocking people.

Forum statistics

Threads
129,872
Messages
1,205,835
Members
171,048
Latest member
CNighty221
Top