Checking if the skill hits the target or misses

I originally just jumped in this thread to give you the 'play movie' script from the script call list, so I'm no expert on this.

But I tested it and it tells me that that command261 is not a function. Then I just tried:

Video.play("movies/" + "DoubleAttack" + ".webm"); this.setWaitMode("video");

It did play the video, but then it says that this.setWaitMode is not a function. I don't have the skills to help you more.

i think it is MV script right? because wherever i read people keep saying its for MV thats why the engine can't recognize it
It did play the video, but then it says that this.setWaitMode is not a function. I don't have the skills to help you more.
That sounds to me like that function is normally called from a different object so you need to substitute "this" with an instance of that object. Or the function is from MV and won't work in MZ.
@enski123 No, this is from the RPG Maker MZ files:
Spoiler
// Play Movie Game_Interpreter.prototype.command261 = function(params) { if ($gameMessage.isBusy()) { return false; } const name = params[0]; if (name.length > 0) { const ext = this.videoFileExt(); Video.play("movies/" + name + ext); this.setWaitMode("video"); } return true; }; Game_Interpreter.prototype.videoFileExt = function() { if (Utils.canPlayWebm()) { return ".webm"; } else { return ".mp4"; } };

@AquaEcho I have no idea about such things 😀 Like I said, I just posted here to give him the script from the script call list.
Could you press F8 (or Fn then F8) after the attack and click on the Console tab to see if there is an error message?
it says this.command261 is not a function


<JS Post-Apply>
if (!target.result().missed)
this.command261(['DoubleAttack']);
</JS Post-Apply>

i did copy paste this code for the skill's notetag
@enski123 No, this is from the RPG Maker MZ files:
Spoiler
// Play Movie Game_Interpreter.prototype.command261 = function(params) { if ($gameMessage.isBusy()) { return false; } const name = params[0]; if (name.length > 0) { const ext = this.videoFileExt(); Video.play("movies/" + name + ext); this.setWaitMode("video"); } return true; }; Game_Interpreter.prototype.videoFileExt = function() { if (Utils.canPlayWebm()) { return ".webm"; } else { return ".mp4"; } };

@AquaEcho I have no idea about such things 😀 Like I said, I just posted here to give him the script from the script call list.
thank you atleast you try to help and spend time for me i really apreciate it
@enski123 No, this is from the RPG Maker MZ files:
Spoiler
// Play Movie Game_Interpreter.prototype.command261 = function(params) { if ($gameMessage.isBusy()) { return false; } const name = params[0]; if (name.length > 0) { const ext = this.videoFileExt(); Video.play("movies/" + name + ext); this.setWaitMode("video"); } return true; }; Game_Interpreter.prototype.videoFileExt = function() { if (Utils.canPlayWebm()) { return ".webm"; } else { return ".mp4"; } };

@AquaEcho I have no idea about such things 😀 Like I said, I just posted here to give him the script from the script call list.
Oh, it's a Game Interpreter function, which means it's normally called from a map event or common event. I'm not sure how you call the Game Interpreter in battle, I'd have to look it up.
Cool.

Btw @enski123 I suggest you check how showing the video looks and works using just the:

Video.play("movies/" + "DoubleAttack" + ".webm");

before you spend anymore time on this. Because next you might just be asking how to make your own battle animations 😀
Cool.

Btw @enski123 I suggest you check how showing the video looks and works using just the:

Video.play("movies/" + "DoubleAttack" + ".webm");

before you spend anymore time on this. Because next you might just be asking how to make your own battle animations 😀
what you mean? my battle animations are the videos i play as movies 😀
You can try replacing "this" with $gameTroop since it uses the interpreter, I don't know if it'll work
Oh, it's a Game Interpreter function, which means it's normally called from a map event or common event. I'm not sure how you call the Game Interpreter in battle, I'd have to look it up.
thank you👍
You can try replacing "this" with $gameTroop since it uses the interpreter, I don't know if it'll work
its says the same error
"$gameTroop.command261 not a function"
Try $gameTroop._interpreter.command261()
Try $gameTroop._interpreter.command261()
now it says "Cannot read property '0' of undefined" at the console
Did you put your video file inside the brackets?
I tested what AquaEcho posted and it seemed to work for me.

<JS Post-Apply> if (!target.result().missed) $gameTroop._interpreter.command261(['DoubleAttack']); </JS Post-Apply>
Did you put your video file inside the brackets?
I tested what AquaEcho posted and it seemed to work for me.

<JS Post-Apply> if (!target.result().missed) $gameTroop._interpreter.command261(['DoubleAttack']); </JS Post-Apply>
oh the syntax () i used from aqua shouldn't be there now i copied your codes and it worked but there is another problem now 🙁 the game still continues in the background i mean the fight continues while the video is playing
Yeah, you need to ask someone how to put a wait time there, since it seems to be something else than a standard wait script? Only way I know of is to trick it to wait by putting a script there to make it play an empty animation and make it last as many frames as your video. Or you could check if the whole thing could be made with action sequences or something.
Yeah, you need to ask someone how to put a wait time there, since it seems to be something else than a standard wait script? Only way I know of is to trick it to wait by putting a script there to make it play an empty animation and make it last as many frames as your video. Or you could check if the whole thing could be made with action sequences or something.
that will be almost like impossible for me even if we find to do that, because i have 80+ videos to play and each skill plays another video and i will keep adding new ones so it will be crazy hard 🙁 thank you anyway
Yeah, you need to ask someone how to put a wait time there, since it seems to be something else than a standard wait script? Only way I know of is to trick it to wait by putting a script there to make it play an empty animation and make it last as many frames as your video. Or you could check if the whole thing could be made with action sequences or something.
Maybe
$gameTroop._interpreter.wait(200)

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-the-skill-hits-the-target-or-misses.162964/