The official VisuStella notetag help thread

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
Hello,
I'm trying to create a paralyze state like the one in Pokemon (probability of not attacking) but it doesn't seem to work in MZ.


<JS Pre-Start Action>

// Set the paralyze success rate.

var paralyzeRate = 1.0;

// Make a random number check to see if paralyze passes...

if (Math.random() < paralyzeRate) {

// If it does, play the paralyze animation on the target.

user.startAnimation(64);

// Check for the user's current action...

if (user.currentAction()) {

// And make the user consume its resources.

user.useItem(user.currentAction().item());

}

// Clear the user's actions making the user lose the actions.

user.clearActions();

// Make the battle wait for the paralysis animation to finish playing.

BattleManager.actionWaitForAnimation();

}

</JS Pre-Start Action>

Thanks!
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
I'll have a look and see what I can do. :)
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
Hello,
I'm having trouble with two skills, both of which do healing, and applying the same state which is an absorption barrier; the single-target form, in MV, reads:

<Post-Damage Eval>
if (a.isStateAffected(25)){
if (this.isHpEffect() && this.isSkill() && value < 0){
b.gainHp(Math.round(-value * 2));
a.removeState(25);
}
} else if (target.result().critical) {
if (this.isHpEffect() && this.isSkill() && value < 0){
if (-value * 2 > target.barrierPoints(-1)) {
target.gainBarrier(((-value * 2) - target.barrierPoints()), 10)
}
}
} else if (this.isHpEffect() && this.isSkill() && value < 0){
if (-value > target.barrierPoints(-1)){
target.gainBarrier((-value - target.barrierPoints()), 10)
}
}
</Post-Damage Eval>

Note that the "25" state was generated by another skill (this may move to state #33) to convert the barrier into extra healing and the critical section does not exist in the party-wide form of this skill.

Naturally, this is unlikely to work in MZ's Anti-Damage Barriers plugin so any assistance would be nice.
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
Hello,
I'm trying to create a paralyze state like the one in Pokemon (probability of not attacking) but it doesn't seem to work in MZ.


<JS Pre-Start Action>

// Set the paralyze success rate.

var paralyzeRate = 1.0;

// Make a random number check to see if paralyze passes...

if (Math.random() < paralyzeRate) {

// If it does, play the paralyze animation on the target.

user.startAnimation(64);

// Check for the user's current action...

if (user.currentAction()) {

// And make the user consume its resources.

user.useItem(user.currentAction().item());

}

// Clear the user's actions making the user lose the actions.

user.clearActions();

// Make the battle wait for the paralysis animation to finish playing.

BattleManager.actionWaitForAnimation();

}

</JS Pre-Start Action>

Thanks!
Okay, so you have a couple of issues here. First is that startAnimation no longer exists in MZ, and actionWaitForAnimation isn't a thing either. There's also the fact that clearing the user's actions at this point will crash the engine because it was already processing an action at the time. However, I've managed to create an effect that's almost exactly what you were going for.

Create a new skill called "Paralyzed" with the following notetag:

Code:
<Cast animation: 64>

<JS Post-Apply>
const text = user.name() + " is paralyzed and can't attack!";
const window = SceneManager._scene._logWindow;
    if (text) {
      window._lines.push(text + '<CENTER>');
      window.refresh();
    }
</JS Post-Apply>

Then instead of user.clearActions(), do user.currentAction().setSkill(id of your paralyzed skill);

This will replace the action with the paralyzed one, which will use 64 as its cast animation and output a message to the log similar to the one you get in Pokémon.

Hello,
I'm having trouble with two skills, both of which do healing, and applying the same state which is an absorption barrier; the single-target form, in MV, reads:

<Post-Damage Eval>
if (a.isStateAffected(25)){
if (this.isHpEffect() && this.isSkill() && value < 0){
b.gainHp(Math.round(-value * 2));
a.removeState(25);
}
} else if (target.result().critical) {
if (this.isHpEffect() && this.isSkill() && value < 0){
if (-value * 2 > target.barrierPoints(-1)) {
target.gainBarrier(((-value * 2) - target.barrierPoints()), 10)
}
}
} else if (this.isHpEffect() && this.isSkill() && value < 0){
if (-value > target.barrierPoints(-1)){
target.gainBarrier((-value - target.barrierPoints()), 10)
}
}
</Post-Damage Eval>

Note that the "25" state was generated by another skill (this may move to state #33) to convert the barrier into extra healing and the critical section does not exist in the party-wide form of this skill.

Naturally, this is unlikely to work in MZ's Anti-Damage Barriers plugin so any assistance would be nice.
You're right, the MZ version doesn't have the gainBarrier() or barrierPoints() functions. It's actually somewhat easier though, since it's done via state tags.

What you need to do is assign your barrier value to a temporary variable, like user._absorbPoints, then have a new state for your barrier with the notetag

<All Absorb Barrier: user._stateDisplay[id of barrier state] + user._absorbPoints>

<JS On Erase State>
delete target._absorbPoints;
</JS On Erase State>
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
You're right, the MZ version doesn't have the gainBarrier() or barrierPoints() functions. It's actually somewhat easier though, since it's done via state tags.

What you need to do is assign your barrier value to a temporary variable, like user._absorbPoints, then have a new state for your barrier with the notetag

<All Absorb Barrier: user._stateDisplay[id of barrier state] + user._absorbPoints>

<JS On Erase State>
delete target._absorbPoints;
</JS On Erase State>
I'm afraid I'm confused on how to assign a variable to the state, since at present the barrier reads as 0.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
I'm afraid I'm confused on how to assign a variable to the state, since at present the barrier reads as 0.
What specifically is it meant to do?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
Adds a barrier equal to 125% of HP it heals. (e.g. 500 HP = 625 barrier); the single-target version is 150% instead.
 

Attachments

  • Capture.PNG
    Capture.PNG
    26.7 KB · Views: 11

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
What was the .barrierPoints() bit doing?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
What was the .barrierPoints() bit doing?
Two things: it'd first check if there were any points remaining (e.g. 150) then subtract the barrier points of the old from the new (if it healed for 600 and 150 remained, 600 - 150 = 450 barrier points added). It also checked if the barrier points were higher than the heal (e.g. 400 heal when 500 barrier exists) in which case the barrier effect would not happen).
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
Ahh, okay. I see now.

Code:
<JS Post-Damage>
  const existingBarrier = target._stateDisplay[id of absorb state];
  if (a.isStateAffected(25)){
    if (this.isHpEffect() && this.isSkill() && value < 0){
      b.gainHp(Math.round(-value * 2));
      a.removeState(25);
    }
  } else if (target.result().critical) {
    if (this.isHpEffect() && this.isSkill() && value < 0){
    
      if (-value * 2 > existingBarrier) {
        target._barrierPoints = -value * 2 - existingBarrier;
        target.addState(id of absorb state);
      }
    }
  } else if (this.isHpEffect() && this.isSkill() && value < 0){
    if (-value > existingBarrier){
      target._barrierPoints = -value - existingBarrier;
      target.addState(id of absorb state);
    }
  }
</JS Post-Damage>
 
Last edited:

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
is existingBarrier defined anywhere? and how does that interact with the state to determine the number since I get no absorption barrier counter?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
"const existingBarrier" is the line that defines it.

If you set the notetag for your barrier state to use <All Absorb Barrier: user._absorbPoints> it'll add the state with that number of absorb points.
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
If you set the notetag for your barrier state to use <All Absorb Barrier: user._absorbPoints> it'll add the state with that number of absorb points.
Still coming up as 0 despite healing 365 (should be appearing as 548) causing it to end on the start of their next turn.

EDIT: Solution found!

<JS Post-Damage>
if (this.isHpEffect() && value < 0){
var Heal = Math.round(-value * 1.5)
$gameVariables.setValue(1, Heal)
}
</JS Post-Damage>

<All Absorb Barrier: $gameVariables.value(1)>
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
I could have worked through with you why a local var wasn't working but if using a game one does then happy days. Don't want to mess with it if it ain't broke. :)
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
I could have worked through with you why a local var wasn't working but if using a game one does then happy days. Don't want to mess with it if it ain't broke. :)
I sadly must come back to it as that's only step 1. Step 2 needs a weaker barrier number from the same state to not overwrite a stronger one (68 overwrote a 608 barrier in my playtest) and the absorption barrier function is not playing nice with the attached skill which adds state #33.
 

Attachments

  • Capture.PNG
    Capture.PNG
    26.8 KB · Views: 6
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
Just make sure value isn't < user._stateDisplay[id of barrier state] (the state display is used for how many points the barrier has) and don't call addState if it is.
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
Testing with a x1 multiplier for now.

EDIT: Step 2 works with:

<JS Post-Damage>
if (this.isHpEffect() && value < 0){
var Heal = Math.round(-value * 1.5);
if (b.isStateAffected(32)){
if (Heal > target._stateDisplay[32]){
$gameVariables.setValue(1, Heal);
b.addState(32);
}
} else {
$gameVariables.setValue(1, Heal);
b.addState(32);
}
}
</JS Post-Damage>

Now onto step 3...

EDIT 2: My single-target heal proves reliable with Rapid Response using the following code:

<JS Post-Damage>
if (this.isHpEffect() && value < 0){
var Heal = Math.round(-value * 1.5);
if (a.isStateAffected(33)){
$gameVariables.setValue(1, Heal);
b.gainHp(-value + $gameVariables.value(1));
a.removeState(33);
} else if (b.isStateAffected(32)){
if (Heal > target._stateDisplay[32]){
$gameVariables.setValue(1, Heal);
b.addState(32);
}
} else {
$gameVariables.setValue(1, Heal);
b.addState(32);
}
}
</JS Post-Damage>

However my party heal equivalent only works on the first actor and ignores everyone else.
 
Last edited:

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
Create a new skill called "Paralyzed" with the following notetag:

Code:
<Cast animation: 64>

<JS Post-Apply>
const text = user.name() + " is paralyzed and can't attack!";
const window = SceneManager._scene._logWindow;
    if (text) {
      window._lines.push(text + '<CENTER>');
      window.refresh();
    }
</JS Post-Apply>
Thank you so much! I removed the bad note tags and added this skill. Now it works perfectly!:D
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
6,153
Reaction score
6,311
First Language
English
Primarily Uses
RMMZ
Testing with a x1 multiplier for now.

EDIT: Step 2 works with:

<JS Post-Damage>
if (this.isHpEffect() && value < 0){
var Heal = Math.round(-value * 1.5);
if (b.isStateAffected(32)){
if (Heal > target._stateDisplay[32]){
$gameVariables.setValue(1, Heal);
b.addState(32);
}
} else {
$gameVariables.setValue(1, Heal);
b.addState(32);
}
}
</JS Post-Damage>

Now onto step 3...

EDIT 2: My single-target heal proves reliable with Rapid Response using the following code:

<JS Post-Damage>
if (this.isHpEffect() && value < 0){
var Heal = Math.round(-value * 1.5);
if (a.isStateAffected(33)){
$gameVariables.setValue(1, Heal);
b.gainHp(-value + $gameVariables.value(1));
a.removeState(33);
} else if (b.isStateAffected(32)){
if (Heal > target._stateDisplay[32]){
$gameVariables.setValue(1, Heal);
b.addState(32);
}
} else {
$gameVariables.setValue(1, Heal);
b.addState(32);
}
}
</JS Post-Damage>

However my party heal equivalent only works on the first actor and ignores everyone else.
What's the code for your party heal?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
103
Reaction score
18
First Language
English
Primarily Uses
RMMV
What's the code for your party heal?
Exactly the same as the single ally heal listed under the Restoration spoiler tag, only difference being 1.5 changes into 1.25.

EDIT: That got solved by adding "Remove State" into the effects box.
 
Last edited:

Latest Threads

Latest Profile Posts


Ah yes, all three of my moods all at once.
Here's a tutorial I did on how I made my Leonardo A.I.-assisted artworks for my game's recent update. :rhappy:

Disclaimer: This is meant to be a band-aid solution for people like me who aren't good artists or don't have the financial means to hire an amazing artist. If you have the means, please buy commissions and support your fav artists.:yhappy:

Found some expired fireworks in garbage today. I wonder if they still work.
Now a videogame developer has been arrested in Japan for insider trading. Darn blue hedgehog! XD

Forum statistics

Threads
131,751
Messages
1,222,931
Members
173,502
Latest member
bamsae0821
Top