How to implement every possible Yanfly Tips & Tricks effect in MZ with VisuStella plugins

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
Hello, I'm trying to create an accessory which works similarly the phoenix ring, but which works once per battle, as opposed to breaking it, since it is an equipment piece which grants other benefits. What would be the best way to do it, even using other VS plugins?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,540
First Language
English
Primarily Uses
RMMV
Hello, I'm trying to create an accessory which works similarly the phoenix ring, but which works once per battle, as opposed to breaking it
I'd just use a switch.

Code:
<JS On Add State>
if (target.isActor()) {
    const ring = $dataArmors[101];
    if (target.hasArmor(ring) && !$gameSwitches.value(X)) {
        $gameSwitches.setValue(X, true);
        $gameTemp.requestAnimation([target], 42);
        const hp = Math.floor(target.mhp * 0.25);
        target.gainHp(hp);
    }
}
</JS On Add State>

You'd have to replace the two instances of "X" with the ID of an available switch in your game, then have a turn 0 troop event in every troop that sets the switch to OFF. Or add a post-battle common event that does so, I think the VisuStella Battle Core lets you do that.

This only works correctly if the ring is a unique item. If more than one actor can have it equipped, and it should work once per battle for each of them, I'd change the code entirely and put it into a passive state granted by the ring.
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
This only works correctly if the ring is a unique item. If more than one actor can have it equipped, and it should work once per battle for each of them, I'd change the code entirely and put it into a passive state granted by the ring.
Could you please elaborate on that, this sounds a bit more flexible and less conflictual with "normal" phoenix rings!
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,540
First Language
English
Primarily Uses
RMMV
less conflictual
It sounds less conflictual, does it? :wink::guffaw:

Just use mostly the code for Auto-Life with a boolean on the actor.
Code:
<JS Pre-Start Battle>
user.resurrected=false;
</JS Pre-Start Battle>

<JS Post-Apply As Target>
  if ((target.hp <= 0 || target.isDead()) && !target.resurrected) {
    $gameTemp.requestAnimation([target], 49);
    const rate = 0.1;
    const heal = Math.floor(target.mhp * rate);
    target.gainHp(heal);
    target.startDamagePopup();
    target.resurrected=true;
  }
</JS Post-Apply As Target>

Adjust the animation ID and healing math as desired.
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
It sounds less conflictual, does it? :wink::guffaw:

Just use mostly the code for Auto-Life with a boolean on the actor.
Code:
<JS Pre-Start Battle>
user.resurrected=false;
</JS Pre-Start Battle>

<JS Post-Apply As Target>
  if ((target.hp <= 0 || target.isDead()) && !target.resurrected) {
    $gameTemp.requestAnimation([target], 49);
    const rate = 0.1;
    const heal = Math.floor(target.mhp * rate);
    target.gainHp(heal);
    target.startDamagePopup();
    target.resurrected=true;
  }
</JS Post-Apply As Target>

Adjust the animation ID and healing math as desired.
It's a real word!
Thank you very much. Let me save it, thanks a lot.
 
Last edited:

whiteswords12

Villager
Member
Joined
Sep 18, 2022
Messages
13
Reaction score
2
First Language
English
Primarily Uses
RMMZ
JavaScript:
<JS Post-Start Action>
if (action.isPhysical() && action.isAttack() && action.isHpEffect()) {
$gameTemp.requestAnimation([user], 2);
}
</JS Post-Start Action>

<JS Pre-Damage As User>
if (this.isPhysical() && this.isAttack() && this.isHpEffect() && value > 0) {
value *= 2;
value = Math.ceil(value);
user.removeState(state.id);
}
</JS Pre-Damage As User>
Mind Charge:
JavaScript:
<JS Post-Start Action>
if (action.isMagical() && action.isHpEffect()) {
$gameTemp.requestAnimation([user], 2);
}
</JS Post-Start Action>

<JS Pre-Damage As User>
if (this.isMagical() && this.isHpEffect() && value > 0) {
value *= 2;
value = Math.ceil(value);
user.removeState(state.id);
}
</JS Pre-Damage As User>
Looking at this I think I implemented it right. But how can I tell if the buff worked? Is there an icon or something?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,540
First Language
English
Primarily Uses
RMMV
Looking at this I think I implemented it right. But how can I tell if the buff worked? Is there an icon or something?
When asking for help, it's a good idea to be precise in your terminology - "buff" means a specific thing in RPG Maker that isn't related to what you're asking about.

Are you using the above code but also following the full instructions from Yanfly's original Tip & Trick video?

If so, the code is going into a state that you apply via a skill. If you give that state an icon, then that icon will show on the actor while they have it.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
23,577
Reaction score
13,351
First Language
English
Primarily Uses
RMMZ
The Runic (State) is only for a magic taunt, magic damage and MP. I am trying to create a version where it is a physical taunt, physical damage and TP. Have I got the code right? (Probably not, but I live in hope that one day...)

Code:
<Physical Taunt>
<JS Pre-Damage As Target>
if (this.isPhysical() && this.isHpEffect() && value > 0) {
    value = 0;
    if (DataManager.isSkill(this.item())) {
    const tp = user.skillTpCost(this.item());
    // Recover the TP.
    target.gainTp(tp);
  }
    target.startAnimation(58);
}
</JS Pre-Damage as Target>

Thank you
 

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
50
Reaction score
22
First Language
English
Primarily Uses
RMMZ
Does the Tricks & Tips Meajai's Soulstealer work without a Battle Statistics Plugin from VISUSTELLA? Assuming there isn't one, if there is then I missed it somewhere.

I tried using it with the sample core plugins, and it doesn't seem to work at all. I know the original version for MV required the Battle Statistics plugin from Yanfly.

Mainly for the user._killCount.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,540
First Language
English
Primarily Uses
RMMV
Does the Tricks & Tips Meajai's Soulstealer work without a Battle Statistics Plugin from VISUSTELLA?
Please go back and read the first post in this thread, where you found Mejai's Soulstealer. Your question is addressed at the top :wink:
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
So, I've had a small try and it appears that one Tip which can now be created is Holy Prism - the new selection control works of battle core just fine and the script can work right as it is? What is a tad problematic is the damage formula (for me).

The ones that require definitely more work are Jump (not attempted) and Void shift - as the scripting language seems a bit different in MZ?
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
8,718
Reaction score
6,540
First Language
English
Primarily Uses
RMMV
So, I've had a small try and it appears that one Tip which can now be created is Holy Prism...What is a tad problematic is the damage formula (for me).
In what way? You can take the damage formula from Yanfly's Tip, delete the comment lines, and delete the line breaks so it's all on one line and goes into the damage formula. For that matter, you can even delete the braces, they're superfluous.

The ones that require definitely more work are Jump (not attempted) and Void shift - as the scripting language seems a bit different in MZ?
MV and MZ both use JavaScript. I see Trihan described Jump as a hack but I don't know which part of it actually is wonky at all.

For Void Shift, I see listed in the Battle Core instructions a notetag <Cannot Target User> that you can add. What else doesn't Trihan's version do?
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
In what way? You can take the damage formula from Yanfly's Tip, delete the comment lines, and delete the line breaks so it's all on one line and goes into the damage formula. For that matter, you can even delete the braces, they're superfluous.
oh, ok then, then even the damage formula is fine, so it can officially be added to the list.
MV and MZ both use JavaScript. I see Trihan described Jump as a hack but I don't know which part of it actually is wonky at all.
For Void Shift, I see listed in the Battle Core instructions a notetag <Cannot Target User> that you can add. What else doesn't Trihan's version do?
I thought those two weren't even attempted?
 

EllTipprro

Villager
Member
Joined
Apr 14, 2021
Messages
21
Reaction score
5
First Language
Hungarian
Primarily Uses
RMMZ
I'd like to change kyrie eleison in a way that the amount kyrieHp it has scales up with the number of enemies that has a specific state. Something like: user.def * 0.04 * enemies with state.
Is that possible? And if so how?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,143
Reaction score
6,291
First Language
English
Primarily Uses
RMMZ
I'd like to change kyrie eleison in a way that the amount kyrieHp it has scales up with the number of enemies that has a specific state. Something like: user.def * 0.04 * enemies with state.
Is that possible? And if so how?
user.def * 0.04 * $gameTroop.members().filter(member => member.isStateAffected(stateId)).length
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
526
Reaction score
131
First Language
English
Primarily Uses
RMMZ
So, this is a variation of the Tsunami script that is meant to interrupt when the enemy gets hit by a disabling state like stun or berserk

JavaScript:
<JS On Add State>
  user.clearActions();
  let text = '<CENTER>' + user.name() + ' will unleash \\c[4]Tsunami\\c[0] in 3 turns.';
  SceneManager._scene._logWindow._lines.push(text);
  text = '<CENTER>Inflict a state that imposes a restriction on ' + user.name() + ' to cancel it!';
  SceneManager._scene._logWindow._lines.push(text);
  SceneManager._scene._logWindow.refresh();
</JS On Add State>

<JS On Erase State>
  if (user === origin) {
    const skill = 267;
    const target = -2;
    user.forceAction(skill, target);
  }
</JS On Erase State>

<JS Post-Damage As Target>
  let hasRestrictiveState = this.states().some(state => state.restriction !== 'None');
  if (hasRestrictiveState) {
    this.removeState(state.id);
    const text = '<CENTER>' + this.name() + "'s \\c[4]Tsunami\\c[0] is interrupted!";
    SceneManager._scene._logWindow._lines.push(text);
  }
</JS Post-Damage As Target>

But I'm not sure, I think it is redundant? and oops, did I even use the right notetag?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,143
Reaction score
6,291
First Language
English
Primarily Uses
RMMZ
So, this is a variation of the Tsunami script that is meant to interrupt when the enemy gets hit by a disabling state like stun or berserk

JavaScript:
<JS On Add State>
  user.clearActions();
  let text = '<CENTER>' + user.name() + ' will unleash \\c[4]Tsunami\\c[0] in 3 turns.';
  SceneManager._scene._logWindow._lines.push(text);
  text = '<CENTER>Inflict a state that imposes a restriction on ' + user.name() + ' to cancel it!';
  SceneManager._scene._logWindow._lines.push(text);
  SceneManager._scene._logWindow.refresh();
</JS On Add State>

<JS On Erase State>
  if (user === origin) {
    const skill = 267;
    const target = -2;
    user.forceAction(skill, target);
  }
</JS On Erase State>

<JS Post-Damage As Target>
  let hasRestrictiveState = this.states().some(state => state.restriction !== 'None');
  if (hasRestrictiveState) {
    this.removeState(state.id);
    const text = '<CENTER>' + this.name() + "'s \\c[4]Tsunami\\c[0] is interrupted!";
    SceneManager._scene._logWindow._lines.push(text);
  }
</JS Post-Damage As Target>

But I'm not sure, I think it is redundant? and oops, did I even use the right notetag?
I can't currently think of a better implementation for it.
 

Latest Threads

Latest Posts

Latest Profile Posts

Happy Memorial Day to those on here like me who live in the United States. :)
Alright got a video of a review of a fake PS5 here. I've decided I'm only going to do maybe 10 videos about bootleg consoles, and then I think I'm going to move on, and post YouTube videos of old video game TV advertisements for franchises like Mario and Sonic and Spyro and all that for a little nostalgia. :cool:

Two solid days and I still have four slots left in my custom A2 tilesheet I am drawing.
i really love spaghetti

Forum statistics

Threads
131,524
Messages
1,220,482
Members
173,223
Latest member
ZecaVn
Top