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

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

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
11,002
Reaction score
8,886
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
Regular
Joined
Nov 17, 2019
Messages
1,752
Reaction score
889
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
Regular
Joined
Nov 17, 2019
Messages
1,752
Reaction score
889
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

Obvious One.gif
Meet my new mascot. He's also a mimic! No prizes for guessing this guy's name, though, haha
BANNER2.png
I put out a new pack and I swear, I did not realize how it looks like the ones on the right are scared/nervous of the one on the left until way after o_O I just wanted to showcase some of them randomly xD
Well, if anyone has a funny, simple, easy RM game they want me to playtest/review, I would love it.
Someone close to me straight up told me they didn't think my relationship with my girlfriend would last. No lead up, very bluntly. Like it's obvious or something. Trying not to let it get to my head, but it's hard.
The distraction would be a life saver.
QuestMZPlugin.png

My first foray into a plugin that I plan to release. Working on something for those who want to set up a Dragon Quest style battle HUD with minimal fuss. Includes the ability to round the battleback corners to fit your windowskin and, of course, front-view animations.

QuestMZPLugin_CustomWindow.png
Do you ever wonder where the heck everyone is going at 9:00 at night? Like... guys, go home! Get some sleep! Me? Oh, I'm out to get pizza 'cause I decided supper time was 9:30 tonight.

Forum statistics

Threads
134,756
Messages
1,250,345
Members
177,516
Latest member
uglychristmassweaterbio
Top