The official VisuStella notetag help thread

optiprimeful

Veteran
Veteran
Joined
Aug 27, 2017
Messages
86
Reaction score
7
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
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
I'll have a look and see what I can do. :)
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
98
Reaction score
12
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
2,953
Reaction score
2,227
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!
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
98
Reaction score
12
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
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
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
98
Reaction score
12
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: 5

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
What was the .barrierPoints() bit doing?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
98
Reaction score
12
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
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
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
98
Reaction score
12
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
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
"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
98
Reaction score
12
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
2,953
Reaction score
2,227
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. :)
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
98
Reaction score
12
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: 5
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,953
Reaction score
2,227
First Language
English
Primarily Uses
RMMV
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
98
Reaction score
12
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:

optiprimeful

Veteran
Veteran
Joined
Aug 27, 2017
Messages
86
Reaction score
7
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
2,953
Reaction score
2,227
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.
What's the code for your party heal?
 

Junane

Veteran
Veteran
Joined
Feb 10, 2018
Messages
98
Reaction score
12
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 Posts

Latest Profile Posts


Livestreaming again.
I managed to review my previous lessons on Learn MV and fixed a lot of things. Yay! :kaopride:
I've decided "Attack on Equestria" should be released first... hence this new ARG channel! https://www.youtube.com/channel/UClKiUI8xOVx9dsF4kRXUmxw
Check it out, and subscribe! The ARG will lead up to the video game. It's not a creepy game, but I just thought it should follow ARG standards.
For anyone interested in my project M - i finally made a gamethread about it :D

Yay. I turned 39 today. Another year older, another year closer to the grave.

Forum statistics

Threads
110,407
Messages
1,053,068
Members
143,470
Latest member
AttilaHU1990
Top