Attack Skill That Heals

I wanted to make a skill that uses the common animation for attacking with a weapon, and then heals the user. I found this thread about how to set it up: https://forums.rpgmakerweb.com/index.php?threads/variable-for-damage-dealt.88919/ This all works except the animation isn't right. I have Hit Type set to Physical Attack and Animation set to Normal Attack. Damage Type is HP Damage and Elemental Type is Normal Attack. But it still shows the animation of casting a spell (arms out, palms up). What am I doing wrong?
Without plugins, the casting motion (different from animations) is determined by the Skill Type. If you have included that skill type as a Magic skill in the list on the System 2 tab of the database, all skills within it will use the casting motion.

As mentioned, you can use plugins to override that.
Without plugins, the casting motion (different from animations) is determined by the Skill Type. If you have included that skill type as a Magic skill in the list on the System 2 tab of the database, all skills within it will use the casting motion.

As mentioned, you can use plugins to override that.
For me it seems all skills are using the casting motion even "Slash", which is under the Skill Type Special & not added into the [SV] Magic Skills on the System 2 tab

..hmm.. perhaps some sort of bug? I actually even removed Magic from that [SV] Magic Skills on the System 2 tab and it still does the casting motion...

I'm actually really baffled by this myself.
Without plugins, the casting motion (different from animations) is determined by the Skill Type. If you have included that skill type as a Magic skill in the list on the System 2 tab of the database, all skills within it will use the casting motion.

As mentioned, you can use plugins to override that.

It isn't listed in the Magic skill list. All of the default Swordsman skills use the same skill type as what this one does, I just renamed it.

[edit: Another weird thing I just noticed is that in order for the game to use the skill name in the message, you type %2 now... I thought it was *, which the examples show and seem to imply, until you click on them anyway and then they put %2 instead of *. Was it always like this?]
Possibly it's a bug in MZ? The OP says on their profile that they use MV, but this is posted in the MZ support forum.

I know that is the intended functionality, at least - that's the whole purpose of the Magic Skills list.

In rpg_objects.js I see that this looks identical to MV:
Code:
Game_Actor.prototype.performAction = function(action) {
    Game_Battler.prototype.performAction.call(this, action);
    if (action.isAttack()) {
        this.performAttack();
    } else if (action.isGuard()) {
        this.requestMotion("guard");
    } else if (action.isMagicSkill()) {
        this.requestMotion("spell");
    } else if (action.isSkill()) {
        this.requestMotion("skill");
    } else if (action.isItem()) {
        this.requestMotion("item");
    }
};

And, in turn, the isMagicSkill method appears to be correct.

Are you sure you're not using a plugin that modifies something? In MV, the Yanfly Battle Engine Core had default changes to some of the skill motions and animations unless the user read the instructions and plugin parameters. I presume some of the VisuStella stuff might be similar.
I'm not using any plugins that have anything to do with skills, and not using any Yanfly plugins or core plugins from anyone. I use both MV and MZ, and I am currently using MZ, but I don't think this is any different between the two, is it?
Sooo I figured it out... it's not really a "bug" but it is kind of odd..
and will definitely need to be done via a plugin. Upon studying the motion code it does seem to work exactly as it's supposed to... but it's just very limiting.. & the default spritesheets make it look very similar (the major difference is the motion when "charging" the skill/magic)

Spoiler: Spritesheet used in video for referencing
Actor1_1_ex.png

sooo as we can see it is working how it's supposed to work...
just again limiting without plugins the only skill that uses actual attack format is the normal attack & no skill can be setup to use that without the use of a plugin
also as a side note the normal attack uses the weapon to choose which motion sprite to use.

sooo... basically now we just need to be directed to what plugin is best for this.

@mobiusclimber Is this what yours is looking like also?
If soo I guess that is meaning it is technically working as it's supposed to I guess.
Yeah I want it to use the weapon and show an attack animation, not something that looks like a magic spell. I don't know why it would do that by default because it isn't indicative of an attack skill at all. I can see if it was listed as a magic skill, but why make that default with no way to use your weapon to perform the attack action? It's weird and downright useless.
Yeah I want it to use the weapon and show an attack animation, not something that looks like a magic spell. I don't know why it would do that by default because it isn't indicative of an attack skill at all. I can see if it was listed as a magic skill, but why make that default with no way to use your weapon to perform the attack action? It's weird and downright useless.
I do agree but at least now I guess I understand the format

but ...wait! Solved! ☺️

It's done using traits for actors/classes:
Spoiler
1652244259372.png

1652244439820.png

Rather odd way of having this setup but while further studying the code it also looks at the trait "Attack Skill" and with that you can setup skills to use as a "normal" attack motion 😉
Oh wow that was actually it! I set up the Traits and it works! I think in the future I'm going to have to pay for Yanfly's plugins so I can do custom animations, but for now this is great. Thank you so much!
Oh wow that was actually it! I set up the Traits and it works! I think in the future I'm going to have to pay for Yanfly's plugins so I can do custom animations, but for now this is great. Thank you so much!
No prob! Very happy to help.
I learned quite a bit too ☺️

So also I did get it working with plugin/notetag set up as follows:
if you'd prefer to go the plugin/notetag route to make this all easier and not have to make sure that the class/actor always has to have the trait setup then you can use the following setup to achieve that with my Custom Script Anywhere Plugin 😉

[RMMV-MZ] Custom Script Anywhere by CT_Bolt

Spoiler: PARAMETER SETUP
Class: Game_Action
Property of Function: prototype
Function: isAttack
Post Script:
JavaScript:
if ($dataSkills[this._item._itemId].meta.attackMotion) {
  r = true;
};
1652246955657.png
With that you can use the notetag:
<attackMotion:true>

The notetag is placed on any skill you want to use the "attack motion" 😉

Spoiler: Notetag Screenshot
1652246968289.png
Heh, I'm now confused by the whole thread. Looking at the video you posted, I don't see the confusion between the casting motion and the preparing to use a skill motion...but I guess I misunderstood and the question was when actually executing the skill showing an attack motion.

My original answer to that would've been to use action sequences, but:
Rather odd way of having this setup but while further studying the code it also looks at the trait "Attack Skill" and with that you can setup skills to use as a "normal" attack motion 😉
Really? I thought that trait replaced the actual skill that's executed when you use the Attack command in battle. Is that incorrect?
If you look at the sprite sheet, the confusion should be cleared up. The two motions are nearly identical. The character just leans forward when casting a magic skill. (And of course, they are different colors.) It doesn't at all look like a weapon attack, even if you ignore the fact that it doesn't use the equipped weapon. I guess I can see why they did this, since you might want to make your own animation and have it read off the sprite sheet, but... it's very confusing all the same. If they were at least appreciably different, I wouldn't have been confused by it, but they're basically the same motion.
Really? I thought that trait replaced the actual skill that's executed when you use the Attack command in battle. Is that incorrect?
Oh lol yeah I'm dumb.. didn't fully test it, that is exactly what it does.. I got excited before because I only tested the skill and seen it actually played the attack motion.. however yep it also changes the normal attack into the skill 😅

Sooo yep best way is to use a plugin like I have shown above or with action sequencing plugin
The way I setup with my Custom Script Anywhere Plugin does work really well for this simple issue though ☺️

Well this is pretty dumb. I don't know why I didn't expect it. I'm using RPG Maker after all.

Thanks for the help, @ATT_Turan and @ct_bolt ! I will use the plugin until I can get Yanfly's stuff and do custom battle animations. This is just kind of ridiculous. Every time I think I'm going to do something easy, it's a huge hassle instead. There's no reason someone should have to make a forum post about this. But everything in RPG Maker is like that. It's literally pulling teeth to do anything.

[edit: Aaaaaand it didn't work. Any idea why I got that message when I tried to attack (normal attack)?]
Any idea why I got that message when I tried to attack (normal attack)?
I would presume something isn't configured correctly in your plugin parameters (or there's a bug in the plugin, or a conflict with one of your other plugins). Anything referring to null means the code is looking at something that doesn't exist, so for some reason you've set up something that's looking for a notetag on an invalid skill.

If ct_bolt doesn't have a quick fix for you, it should be easy for you to install...I think you just need Yanfly's Action Sequences 1 for this, and few lines of instructions in the target action section.

Also, I'm not sure the code you were given is valid for MV. The method to access notetags changed between MV and MZ, and I have always done this:
Code:
$dataSkills[this._item.itemId()].meta["attackMotion"]
There's no reason someone should have to make a forum post about this. But everything in RPG Maker is like that. It's literally pulling teeth to do anything.
That doesn't seem very reasonable to me. The goal with RPG Maker was to make the basic functionality as simple as possible, with everything else capable of being modified if you have or learn the coding required.

It's a little silly to say one arbitrary thing shouldn't require a forum post/modification, just because you want to do it and you think it should be simple. A hundred people could come up with a hundred things like that, and then the editor would be very complex and not accessible to beginners at all.

Of the dozens of JRPGs I've played, I've only seen what you're trying to do in newer things (the earliest I can think of anything like this is Final Fantasy X). So it's not exactly prevalent in the genre, that one would expect it to be included here.

Anyhow, you're getting help with making it work, so let's focus on that 🙂
I'm using MZ. I know my tag says I primarily use MV, and that's true. Because MV has free plugins and MZ has paid ones. But for this particular project, I'm using MZ, which is why I posted in the MZ forum. I don't mean to b---h about how disappointed I am in RPG Maker, but this is a constant issue I have using these programs. Everything I want to do, that should be simple, isn't. All I want to do is use the weapon attack animation for a skill. There are pre-made attack-based skills already in the database, that do not use the weapon animation. So someone made the very thing I want to make but didn't realize how janky it looks when the animation is just jazz hands. In no RPG I have ever played, ever in my entire life, has a sword skill used jazz hands. I've ranted enough, but I'll say just one more thing: this is constant, every time I try to use RM. I know how to code. I use C# in Unity. RM is supposed to be a quicker alternative, but instead, it's a janky broken mess that you have to track down and in many cases pay money for plugins. Or write your own, which defeats the purpose. There are so many other engines out there, and RM refuses to compete with any of them. Most of them are free AND have free plugins that do everything that RM does. I'm just stubborn and trying to get my money's worth on something I should have gotten a refund on a long time ago.
[edit: Aaaaaand it didn't work. Any idea why I got that message when I tried to attack (normal attack)?]
Hmm... not really sure from the screenshot
could I get screenshots of your plugin parameter setup
& if you happen to have any other plugins, a screenshot of the plugin list also 🙂
possibly a screenshot of the console log also if you wouldn't mind. That could be helpful too
Thanks for all your help @ct_bolt and sorry if I'm coming off as a jerk. XD I attached all the files; let me know if you need any more.
Thanks for all your help @ct_bolt and sorry if I'm coming off as a jerk. XD I attached all the files; let me know if you need any more.
No prob. Hmm.. I've tried everything I can think to recreate the error, but just can't get that error ever.
..but either way try this code perhaps.

Surely that will work to at least not give any game breaking errors:
JavaScript:
if ($dataSkills[this._item._itemId]){
  if ($dataSkills[this._item._itemId].meta.attackMotion) {
    r = true;
  };
};
I just wrapped it in another check to ensure the data skill is there.

& if for whatever reason that still don't work maybe try this:
JavaScript:
if ($dataSkills[this._item.itemId()].meta.attackMotion){
  if ($dataSkills[this._item.itemId()].meta.attackMotion) {
    r = true;
  };
};

but for my own curiosity though to figure out more of what's going on do this:
JavaScript:
if ($dataSkills[this._item._itemId]){
  if ($dataSkills[this._item._itemId].meta.attackMotion) {
    r = true;
  };
}else{
  console.log(this._item._itemId)
};

then can you please send a screenshot of what the console prints

Original thread: https://forums.rpgmakerweb.com/threads/attack-skill-that-heals.147484/