Hi! So when you use a move, the game generally shows a message like "X took Y damage!" I was wondering if through the usage of plugins (or even without them if I've just completely missed something) I could replace and decide which of those messages show on a skill-by-skill basis, or (less likely in my mind) on a type basis?
An example might be if I wanted my "Target gained X MP!" and "Target gained X TP!" to be unique from each other, i.e. "Target gained X MP!" v.s. "Target's TP went up by X!"
I assume I most likely would have to manually change the messages in each attack that targets MP/TP, but I don't know how I would do that, or if I would just be able to change it just by setting a "Gain MP" message and a "Gain TP" message.
Thank you in advance!
Looks like the logic that handles messages for skills is in rpg_windows.js:
Code:
Window_BattleLog.prototype.displayAction = function(subject, item) {
var numMethods = this._methods.length;
if (DataManager.isSkill(item)) {
if (item.message1) {
this.push('addText', subject.name() + item.message1.format(item.name));
}
if (item.message2) {
this.push('addText', item.message2.format(item.name));
}
} else {
this.push('addText', TextManager.useItem.format(subject.name(), item.name));
}
if (this._methods.length === numMethods) {
this.push('wait');
}
};
If you look at $dataSkills, you'll see they have a message1 and message2 property, which is referenced in the conditional block for if (item.message1) and if (item.message2).
The formatting there is hardcoded - subject.name() + item.message1.format(item.name) if it's the first line (in the Maker database window, where it says "(User Name) _____", and then just item.message2.format(item.name), which is the next input line below it.
For a skill-by-skill basis, I might try just leaving the first line blank and making use of the second line.
Alternatively, you could modify the displayAction method with a Plugin to have a conditional that would probably read a note from the skill (via the meta property).
@Zevia the messages they mentioned though are the 1s from the terms-messages which show up after the skill's messages.
user ___ would be the incantation message, followed by the flair message (the 2nd skill's message), followed by the effect message (terms-messages)
and was asking about possibility to have different terms-message on a skill by skill basis.
dont know about if possible for a skill by skill basis but at least can get some more variation then only having 1 terms-message for each skill. even if the plugin from the the link does just pick 1 from the possible messages at random.
Hm. That does allow for randomized variation of the messages, but I'm not really looking for randomization, I want to be able to control the message depending on what the variables in the message are; so if %3 is MP, do one message, and if it's TP, do another. Maybe I can modify with the plugin they sent to make this possible, though.
Hm. That does allow for randomized variation of the messages, but I'm not really looking for randomization, I want to be able to control the message depending on what the variables in the message are; so if %3 is MP, do one message, and if it's TP, do another. Maybe I can modify with the plugin they sent to make this possible, though.
Actually, would that be a possibility? Is there a way I could test what "%3" is inside that plugin? I imagine the altered code would look something like this:
JavaScript:
(function(alias) {
'use strict';
const SPLIT = '|';
TextManager.message = function(messageId) {
let msg = alias.apply(this, arguments) || '';
let arr = msg.split(SPLIT);
let type = "However you would get %3";
switch (type) {
case "MP":
return arr[0] || '';
break;
case "TP":
return arr[1] || '';
break;
}
};
})(TextManager.message);
I had a quick look at the core scripts and I think these are the relevant methods:
JavaScript:
Window_BattleLog.prototype.makeHpDamageText = function(target) {
var result = target.result();
var damage = result.hpDamage;
var isActor = target.isActor();
var fmt;
if (damage > 0 && result.drain) {
fmt = isActor ? TextManager.actorDrain : TextManager.enemyDrain;
return fmt.format(target.name(), TextManager.hp, damage);
} else if (damage > 0) {
fmt = isActor ? TextManager.actorDamage : TextManager.enemyDamage;
return fmt.format(target.name(), damage);
} else if (damage < 0) {
fmt = isActor ? TextManager.actorRecovery : TextManager.enemyRecovery;
return fmt.format(target.name(), TextManager.hp, -damage);
} else {
fmt = isActor ? TextManager.actorNoDamage : TextManager.enemyNoDamage;
return fmt.format(target.name());
}
};
Window_BattleLog.prototype.makeMpDamageText = function(target) {
var result = target.result();
var damage = result.mpDamage;
var isActor = target.isActor();
var fmt;
if (damage > 0 && result.drain) {
fmt = isActor ? TextManager.actorDrain : TextManager.enemyDrain;
return fmt.format(target.name(), TextManager.mp, damage);
} else if (damage > 0) {
fmt = isActor ? TextManager.actorLoss : TextManager.enemyLoss;
return fmt.format(target.name(), TextManager.mp, damage);
} else if (damage < 0) {
fmt = isActor ? TextManager.actorRecovery : TextManager.enemyRecovery;
return fmt.format(target.name(), TextManager.mp, -damage);
} else {
return '';
}
};
Window_BattleLog.prototype.makeTpDamageText = function(target) {
var result = target.result();
var damage = result.tpDamage;
var isActor = target.isActor();
var fmt;
if (damage > 0) {
fmt = isActor ? TextManager.actorLoss : TextManager.enemyLoss;
return fmt.format(target.name(), TextManager.tp, damage);
} else if (damage < 0) {
fmt = isActor ? TextManager.actorGain : TextManager.enemyGain;
return fmt.format(target.name(), TextManager.tp, -damage);
} else {
return '';
}
};
From that, it looks like:
+ HP and MP use the Actor|Enemy Recovery message, but TP uses Actor|Enemy Gain.
- MP and TP use Actor|Enemy Loss (HP uses Actor|Enemy Damage).
If you want to separate the MP and TP loss messages then try the attached plugin. (Full code in spoiler below.)
JavaScript:
// ==================================================
// TPLossMessage.js
// ==================================================
/*:
* @plugindesc Use separate messages for MP and TP loss.
* @author Caethyril
* @help MP damage will use the normal Actor|Enemy Loss message.
* TP damage will use the Actor|Enemy message from this plugin's parameters.
*
* Terms of use: free to use and/or modify for any project.
*
* @param Actor TP Loss Message
* @type text
* @desc Message used when an actor loses TP.
* Leave blank to use default (Terms: Actor Loss).
* @default
*
* @param Enemy TP Loss Message
* @type text
* @desc Message used when an enemy loses TP.
* Leave blank to use default (Terms: Enemy Loss).
* @default
*/
(function(pluginName) {
'use strict';
var isTP = false;
var msgLoseTP = (function(p) {
return {
actorLoss: p['Actor TP Loss Message'],
enemyLoss: p['Enemy TP Loss Message']
};
})(PluginManager.parameters(pluginName));
(function(alias) {
Window_BattleLog.prototype.makeMpDamageText = function(target) {
isTP = false;
return alias.apply(this, arguments);
};
})(Window_BattleLog.prototype.makeMpDamageText);
(function(alias) {
Window_BattleLog.prototype.makeTpDamageText = function(target) {
isTP = true;
return alias.apply(this, arguments);
};
})(Window_BattleLog.prototype.makeTpDamageText);
(function(alias) {
TextManager.message = function(messageId) {
if (isTP) {
var msg = String(msgLoseTP[messageId] || '').trim();
if (msg) return msg;
}
return alias.apply(this, arguments);
};
})(TextManager.message);
})('TPLossMessage');
Note that this plugin has parameters, so its file name is important. If you want to rename it, you'll have to edit the last line of the plugin code to match the new file name.
[Edit: ah, I just realised you originally asked for different messages for each skill/item. That might need a different approach, sorry. ]
+ HP and MP use the Actor|Enemy Recovery message, but TP uses Actor|Enemy Gain.
- MP and TP use Actor|Enemy Loss (HP uses Actor|Enemy Damage).
If you want to separate the MP and TP loss messages then try the attached plugin. (Full code in spoiler below.)
JavaScript:
// ==================================================[/INDENT]
[INDENT]// TPLossMessage.js[/INDENT]
[INDENT]// ==================================================[/INDENT]
[INDENT][/INDENT]
[INDENT]/*:[/INDENT]
[INDENT]* @plugindesc Use separate messages for MP and TP loss.[/INDENT]
[INDENT]* @author Caethyril[/INDENT]
[INDENT]* @help MP damage will use the normal Actor|Enemy Loss message.[/INDENT]
[INDENT]* TP damage will use the Actor|Enemy message from this plugin's parameters.[/INDENT]
[INDENT]*[/INDENT]
[INDENT]* Terms of use: free to use and/or modify for any project.[/INDENT]
[INDENT]*[/INDENT]
[INDENT]* @param Actor TP Loss Message[/INDENT]
[INDENT]* @type text[/INDENT]
[INDENT]* @desc Message used when an actor loses TP.[/INDENT]
[INDENT]* Leave blank to use default (Terms: Actor Loss).[/INDENT]
[INDENT]* @default[/INDENT]
[INDENT]*[/INDENT]
[INDENT]* @param Enemy TP Loss Message[/INDENT]
[INDENT]* @type text[/INDENT]
[INDENT]* @desc Message used when an enemy loses TP.[/INDENT]
[INDENT]* Leave blank to use default (Terms: Enemy Loss).[/INDENT]
[INDENT]* @default[/INDENT]
[INDENT]*/[/INDENT]
[INDENT][/INDENT]
[INDENT](function(pluginName) {[/INDENT]
[INDENT]'use strict';[/INDENT]
[INDENT][/INDENT]
[INDENT] var isTP = false;[/INDENT]
[INDENT][/INDENT]
[INDENT] var msgLoseTP = (function(p) {[/INDENT]
[INDENT] return {[/INDENT]
[INDENT] actorLoss: p['Actor TP Loss Message'],[/INDENT]
[INDENT] enemyLoss: p['Enemy TP Loss Message'][/INDENT]
[INDENT] };[/INDENT]
[INDENT] })(PluginManager.parameters(pluginName));[/INDENT]
[INDENT][/INDENT]
[INDENT] (function(alias) {[/INDENT]
[INDENT] Window_BattleLog.prototype.makeMpDamageText = function(target) {[/INDENT]
[INDENT] isTP = false;[/INDENT]
[INDENT] return alias.apply(this, arguments);[/INDENT]
[INDENT] };[/INDENT]
[INDENT] })(Window_BattleLog.prototype.makeMpDamageText);[/INDENT]
[INDENT][/INDENT]
[INDENT] (function(alias) {[/INDENT]
[INDENT] Window_BattleLog.prototype.makeTpDamageText = function(target) {[/INDENT]
[INDENT] isTP = true;[/INDENT]
[INDENT] return alias.apply(this, arguments);[/INDENT]
[INDENT] };[/INDENT]
[INDENT] })(Window_BattleLog.prototype.makeTpDamageText);[/INDENT]
[INDENT][/INDENT]
[INDENT] (function(alias) {[/INDENT]
[INDENT] TextManager.message = function(messageId) {[/INDENT]
[INDENT] if (isTP) {[/INDENT]
[INDENT] var msg = String(msgLoseTP[messageId] || '').trim();[/INDENT]
[INDENT] if (msg) return msg;[/INDENT]
[INDENT] }[/INDENT]
[INDENT] return alias.apply(this, arguments);[/INDENT]
[INDENT] };[/INDENT]
[INDENT] })(TextManager.message);[/INDENT]
[INDENT][/INDENT]
[INDENT]})('TPLossMessage');
Note that this plugin has parameters, so its file name is important. If you want to rename it, you'll have to edit the last line of the plugin code to match the new file name.
[Edit: ah, I just realised you originally asked for different messages for each skill/item. That might need a different approach, sorry. ]
pretty sure HP/MP can pull from both term-messages for recovery and gain just depends on the method used for the recovery.
i think only pulls from the recovery message if use a normal HP/MP restore damage formula, but if use .gainMp() or effects section it will pull from the gain message instead.
but TP always just pulls from the terms-gain message.
nvm all that. just rechecked and ya MP is pulling from recovery message not the gain message for all 3 methods.
I'm still undecided weather or not I should add minor swearing to my game. Like I'm going for an all ages demographic... but the idea of a cartoon character saying dammit, hell, or crap in normal conversation is really funny to me.
If we assume an Elf's strong suit is Dexterity (AGI) & Intellect (MAT), I imagine Strength (ATK) & Constitution (DEF) would be among their lowest stats. But I'm having a hard deciding which should be lower, Strength or Constitution?
I'm really sorry to have to do this, but I'm going to have to start blocking those who repeatedly put up sexual content and offer absolutely nothing (that I've seen) related to what this community is supposedly created for.
Don't take it personal. I'm a rape victim with permanent injuries who can never enjoy 'it' ever again, so it's the last thing I want to have put in my face.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.