MZ Picture in Fight

Good evening,
we have a problem and can not solve it at the moment, so we hope that you can help us here!

We want, when a skill is executed, that a picture of the character appears who is pointing a weapon at whom. We managed to do that, but we can't get the timing correct, because the image appears after the shot and not just before.

Hopefully we can get some help here,

TGG
Are you using a particular plugin? If so, can you please tell us which one? It will be easier for people to help you.
Thank you for the answer.

We use a number of plugins from VisuStella

VisuMZ_0_CoreEngine
VisuMZ_1_BattleCore
VisuMZ_1_ElementStatusCore
VisuMZ_1_EventsMoveCore
VisuMZ_1_ItemsEquipsCore
VisuMZ_1_MainMenuCore
VisuMZ_1_MessageCore
VisuMZ_1_OptionsCore
VisuMZ_1_SaveCore
VisuMZ_1_SkillsStatesCore
VisuMZ_2_WeatherEffects
VisuMZ_2_QuestSystem
VisuMZ_3_VisualCutinEffect (we try to time one of these cutins to appear just before the character shoots the gun)

VisuMZ_4_MultiLayerHpGauge
VisuMZ4_CGGallery

Currently tried at a script has my acquaintance.

(() => {
const pluginName = 'SkillImage';
const parameters = PluginManager.parameters(pluginName);
const image = 'img/pictures/' + parameters['image'];

const _Game_Battler_invokeAction = Game_Battler.prototype.invokeAction;
Game_Battler.prototype.invokeAction = function(action) {
if (action.item().id === 233) {
const sprite = new Sprite();
sprite.bitmap = ImageManager.loadPicture(image);
sprite.x = Graphics.width / 2 - sprite.width / 2;
sprite.y = Graphics.height / 2 - sprite.height / 2;
sprite.opacity = 255;
sprite.anchor.x = 0.5;
sprite.anchor.y = 0.5;
SceneManager._scene.addChild(sprite);
setTimeout(() => {
SceneManager._scene.removeChild(sprite);
}, 3000); // image is displayed for 3 seconds
}
_Game_Battler_invokeAction.call(this, action);
};
})();


Unfortunately, we spent all evening yesterday trying to get this to work, and it didn't. We are at a dead end. The image does appear, but only after the skill has been executed - that is, after the opponent has taken damage. The image should appear before the main character fires.
The VisuStella Visual Cutin Effect plugin shouldn't need all that.

Just make an Action Sequence for your skill and include the Cutin plugin command where you want it to happen.
The VisuStella Visual Cutin Effect plugin shouldn't need all that.

Just make an Action Sequence for your skill and include the Cutin plugin command where you want it to happen.

Thanks also for your help, very kind of you....

We have tried. We have only the problem that we can not find the right command. I have already created a cutin sequence, but if you are in combat, the problem is exactly the same as when we do this with the above script. The image appears, but only after the shot is already fired.

How can I make it so that this is possible?

Where do I enter this command. We have, for example, the script at hints from the skill this command purely made. This we have among other things then with a "Ordinary Event" linked. However, everything did not help, the image still appears after the pistol shot and not before.

I know we can't be far from the target script. It's just that we can't get the timing right, and we can't really figure out VisuStella's explanation in the window.

Now we have this, but the Character shoot and then the picture comes, not before

Bild_2023-05-10_083059571.png
Bild_2023-05-10_083136863.png
As I said in my first post, and it says in the Cutin plugin documentation, you need to use VisuStella's Battle Core to make an Action Sequence for the skill.


Just calling a common event like you show, yes, will always happen after the skill resolves.

Original thread: https://forums.rpgmakerweb.com/threads/picture-in-fight.157383/