MZ RMMZ VisuStella Message Core - Equipped weapon Atk value text code

Hello!

In RPG Maker MZ, I am using VisuStella's Message Core and I am wondering how I could make a text code that grabs the attack value from the weapon the actor is currently holding. (Or rather, I am wondering if that is even possible at all, given how things like this seem to only be able to track one actor at a time). I already have mechanics that read from the atk value of the equipped weapon, but I'm not certain on how to transfer using a.weapons()[0].params[2] for text codes.
VisuMZ_1_MessageCore > Text Code Replacements > (make new)
1691117788098.png

Code:
Match: The text used to call the replacement
Example used: WeaponAtk
Usage application: \WeaponAtk[x] (x is the actor number)


Type: \[(\d+)] looks for a number


STR: Text: Leave undefined


JS: Text:
const actor = $gameActors.actor(arguments[1]); // pulls the number placed in usage application.

return actor.weapons()[0].params[2]; // returns the number of the stated param

Take note that this will take data from the weapon without any other factors such as actor/class bonus' etc.

1691118149509.png

1691118174663.png
1691118208438.png
VisuMZ_1_MessageCore > Text Code Replacements > (make new)
View attachment 272147
Code:
Match: The text used to call the replacement
Example used: WeaponAtk
Usage application: \WeaponAtk[x] (x is the actor number)


Type: \[(\d+)] looks for a number


STR: Text: Leave undefined


JS: Text:
const actor = $gameActors.actor(arguments[1]); // pulls the number placed in usage application.

return actor.weapons()[0].params[2]; // returns the number of the stated param

Take note that this will take data from the weapon without any other factors such as actor/class bonus' etc.

View attachment 272148
View attachment 272149View attachment 272150
Thank you! While this does work, I also wonder if there is any way for it not to be restricted to one actor at a time. Since this will be used for a skill that all actors have access to in battle, I wanted to see if there was any way for it to change which actor it looks at. If this is not possible, though, this advice should allow me to still do what I wanted to accomplish (that being: jank).
Thank you! While this does work, I also wonder if there is any way for it not to be restricted to one actor at a time. Since this will be used for a skill that all actors have access to in battle, I wanted to see if there was any way for it to change which actor it looks at. If this is not possible, though, this advice should allow me to still do what I wanted to accomplish (that being: jank).
I'm not really sure what you mean.. as per the explaination, changing the value of x.. represents the actor which will be checked.
\WeaponAtk[1] actor 1
\WeaponAtk[2] actor 2
etc etc
Could you try to describe what kind of skill it is that you want? Methinks the skill damage calculation part and the message box part are different problems. Are you asking for a way to display the ATK stat of the weapon in e.g. a help message of the skill?
Could you try to describe what kind of skill it is that you want? Methinks the skill damage calculation part and the message box part are different problems. Are you asking for a way to display the ATK stat of the weapon in e.g. a help message of the skill?
The "skill" in question is really just the standard Attack command, lol. I thought to use a message code because this will be displayed in the Message box, the same place "%1 Attacks!" goes. (I probably should've just explained this from the beginning, whoops). That's why I'm uncertain if it would even be possible to have the message code switch which actor it grabs the WeaponAtk value from, since you can't really write a script in the message box (or can you? lol).

If this wouldn't work out, do you know if there's a way to force a message to appear in battle in the notetags utilizing VisuStella? As in, for example, making a message appear as if a skill were used, but done through something like <JS Post-Damage>.

Thank y'all for your help!
I think VisuStella has action sequence plugin commands to force something in the Battle Log (which is where x attacks goes), could you try it with those? 😴
I think VisuStella has action sequence plugin commands to force something in the Battle Log (which is where x attacks goes), could you try it with those? 😴
Yep, it does! And I am happy to say that by combining everyone's advice I was able to accomplish my goal. In the damage formula, I simply logged the weapon damage it was outputting into a variable (since all the attack formula does is check the weapon atk stat, not the actor's), and in post damage, I called a common event that displayed the variable using the VisuStella Battle Core battle log plugin command. Now I'm left with a battle log system that's all text, I'm trying to go for a classic text style ♪⁠ヽ⁠(⁠・⁠ˇ⁠∀⁠ˇ⁠・⁠ゞ⁠)

I've been having a great time on these forums, and I've legitimately been picking up some JavaScript concepts along the way. Maybe soon I'll post something on my account that shows off the battle system in my game!

Original thread: https://forums.rpgmakerweb.com/threads/rmmz-visustella-message-core-equipped-weapon-atk-value-text-code.160006/