MZ Action time+ message display

Hello, this is my first post here, but I spend a lot of time reading you all, and I thank you in advance for all the times you help the RPG maker community.

Anyway, I've done a lot of research on the following question, to no avail. From what I understand, it's not possible without a script.
For the record, I use visustella and other free scripts for my game. I don't have any significant financial means for what I do. And I have no JS writing skills.

Anyway, on to the question:

Action time+ is a mechanic I use in my game via a passive (fighting style) that brings several parameter changes for the user. Don a 50% chance of playing 2 times instead of 1.
It works well, but the game doesn't provide any warning if the 2nd action is triggered.
Could you create a script that calls a message box (in the center of the screen) when this happens? Or else point me in the direction of a script that can do this?

Thanks in advance for your answers! 🙂
You could try this.

Code:
var aliasedMakeActions = Game_Battler.prototype.makeActions;
Game_Battler.prototype.makeActions = function() 
{
    aliasedMakeActions.call(this);
    if (this.isActor() && this._actions.length > 1)
        SceneManager._scene._logWindow.addText("Second action triggered!");
};

Paste the above into a text editor, save as a *.js file, include as a plugin.
Turan's solution looks OK, though it will display in the battle log rather than as a "message box (in the center of the screen)". Definitely try it out first! 👋

If the display style is a problem, then you could try something like (untested):
Spoiler: alternative plugin code
JavaScript:
/*:
 * @target MZ
 * @plugindesc Show an action count message (Action Times+).
 * @author Caethyril
 * @url https://forums.rpgmakerweb.com/threads/168530/
 * @help Free to use and/or modify for any project, no credit required.
 */
;void (alias => {
"use strict";
  const SHOW_FACE = true;
  const SHOW_NAME = true;
  const BG_TYPE   = 0;  // Normal
  const POS_TYPE  = 1;  // Middle
  const MSG = "%2 has %1 actions this turn!";  // %1 = act count, %2 = name.

  const showActNumMsg = function(actor) {
    const c = actor.numActions();
    if (c > 1) {
      const f = SHOW_FACE ? actor.faceName() : "";
      const n = actor.name();
      $gameMessage.setFaceImage(f, actor.faceIndex());
      $gameMessage.setBackground(BG_TYPE);
      $gameMessage.setPositionType(POS_TYPE);
      if (SHOW_NAME)
        $gameMessage.setSpeakerName(n);
      $gameMessage.add(MSG.format(c, n));
      $gameTroop._interpreter.setWaitMode("message");
    }
  };

  Game_Actor.prototype.makeActions = function() {
    alias.apply(this, arguments);
    showActNumMsg(this);
  };

})(Game_Actor.prototype.makeActions);

😴 ...and of course, now that I've typed that out, I remember that my Cae_BattleMessages plugin has a similar feature (link to plugin thread). It uses the same timing as Turan's, i.e. the message shows at the start of the actor's turn. It also has a parameter to let you choose whether it displays in a message window or the battle log.
You could try this.

Code:
var aliasedMakeActions = Game_Battler.prototype.makeActions;
Game_Battler.prototype.makeActions = function()
{
    aliasedMakeActions.call(this);
    if (this.isActor() && this._actions.length > 1)
        SceneManager._scene._logWindow.addText("Second action triggered!");
};

Paste the above into a text editor, save as a *.js file, include as a plugin.
Thanks, that's what I was looking for and it works.

I don't suppose there's any way to make it appear in a text box rather than in the log?
Because in the log it's still pretty unobtrusive. If it could at least read an SE it would be fine for the log message. But I prefer message box ^^

I'll let you see if you can still help, otherwise I'll sort it out.

Thanks again. 🙂
La solution de Turan semble correcte, même si elle s'affichera dans le journal de bataille plutôt que sous la forme d'une « boîte de message (au centre de l'écran) ». Essayez-le d'abord !👋

Si le style d'affichage pose problème, vous pouvez essayer quelque chose comme (non testé) :
Spoiler: code du plugin alternatif
JavaScript:
/* :
 * @cible MZ
 * @plugindesc Afficher un message de décompte d'actions (Action Times+).
 * @auteur Caéthyril
 * @url https://forums.rpgmakerweb.com/threads/168530/
 * @help Gratuit à utiliser et/ou à modifier pour tout projet, aucun crédit requis.
 */
;void (alias => {
« utiliser strict » ;
  const SHOW_FACE = vrai ;
  const SHOW_NAME = vrai ;
  constBG_TYPE = 0 ; // Normale
  const POS_TYPE = 1 ; // Milieu
  const MSG = "%2 a %1 actions ce tour-ci !"; // %1 = nombre d'actes, %2 = nom.

  const showActNumMsg = fonction (acteur) {
    const c = acteur.numActions();
    si (c > 1) {
      const f = SHOW_FACE ? acteur.faceName() : "";
      const n = acteur.nom();
      $gameMessage.setFaceImage(f, acteur.faceIndex());
      $gameMessage.setBackground(BG_TYPE);
      $gameMessage.setPositionType(POS_TYPE);
      si (SHOW_NAME)
        $gameMessage.setSpeakerName(n);
      $gameMessage.add(MSG.format(c, n));
      $gameTroop._interpreter.setWaitMode("message");
    }
  } ;

  Game_Actor.prototype.makeActions = function() {
    alias.apply(this, arguments);
    showActNumMsg(this);
  } ;

})(Game_Actor.prototype.makeActions);

😴... et bien sûr, maintenant que j'ai tapé cela, je me souviens que mon Cae_BattleMessagesplugin a une fonctionnalité similaire ( lien vers le fil de discussion du plugin ). Il utilise le même timing que celui de Turan, c'est à dire que le message s'affiche au début du tour de l'acteur. Il dispose également d'un paramètre vous permettant de choisir s'il s'affiche dans une fenêtre de message ou dans le journal de bataille.

Wow, that's great, I'll give it a try!

It's a pleasure to have an answer from you, your plugins have often saved me from many problems. Especially OneUseEffect, which is just too good!

I'll test it and get back to you.
Ok after testing it's the same as ATT_Turan's plugin. The message appears in the log.
Reading your script I see that it's supposed to appear in a message box.

I think it interacts with my other plugins (especially Visustella battle core).

1715348630132.png

1715348659456.png


1715348676803.png
It's easy for you to test that, just turn off any other plugins, save your project, start a new play test. It seems like it would be very weird for a VisuStella plugin to convert any Show Text commands during battle into battlelog, but anything is possible.
You'll laugh, I hadn't activated the right plugin hahaha.

So it works. I'll have to set the box a bit, but it's really not bad! 🙂 🙂

Since I'm no good at plugins, I could ask you if I can't figure out how to modify the box (remove the portrait, use the dark background, etc.).

If you don't mind ^^

Thank you both for your help.
I could ask you if I can't figure out how to modify the box (remove the portrait, use the dark background, etc.).
There's a line that has SHOW_FACE = true, change that to false

I'm not positive what you want from "the dark background," but the number after BG_TYPE = corresponds to the three options in the Show Text command - Windowskin, dim, or transparent (I'm guessing you mean dim).
There's a line that has SHOW_FACE = true, change that to false

I'm not positive what you want from "the dark background," but the number after BG_TYPE = corresponds to the three options in the Show Text command - Windowskin, dim, or transparent (I'm guessing you mean dim).
Thanks for the info, I was able to set up the plugin and it's really perfect. Thanks to both of you.

I don't know if I'm overdoing it, but do you think it's possible to add an animation to the plugin when the double action is triggered?
I don't know if I'm overdoing it, but do you think it's possible to add an animation to the plugin when the double action is triggered?
Immediately after this line in my plugin code:
JavaScript:
      const n = actor.name();
...you could add a new line to request the animation:
JavaScript:
      $gameTemp.requestAnimation([actor], 123);
Replace 123 with the animation ID. 👋


Also, you posted 3 times in a row here (posts 4, 5, 6). Please try to avoid that, unless 72+ hours have passed since your last post. Here's the standard message (you're not in trouble):

@Fheng, please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

Immediately after this line in my plugin code:
JavaScript:
      const n = actor.name();
...you could add a new line to request the animation:
JavaScript:
      $gameTemp.requestAnimation([actor], 123);
Replace 123 with the animation ID. 👋


Also, you posted 3 times in a row here (posts 4, 5, 6). Please try to avoid that, unless 72+ hours have passed since your last post. Here's the standard message (you're not in trouble): Double-post notice: @Fheng
Thank you very much, it's perfect thanks to your help. Sorry for the triple post, I rarely use the forums, I'll be more careful.

This topic is done, if a modo wants to close it. 🙂
Great, no worries! Happy RPG Making~

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/action-time-message-display.168530/