The official VisuStella notetag help thread

HiddenAlchemist

Regular
Regular
Joined
Jan 6, 2021
Messages
131
Reaction score
186
First Language
English
Primarily Uses
RMMV
Post-Apply runs after damage, so at that point value is meaningless. Do JS Pre-Damage instead.
I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,455
Reaction score
10,826
First Language
English
Primarily Uses
RMMV
I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
The documentation for the Battle Core doesn't say these notetags recognize a and b. It says to use user and target.

If it doesn't know what a is, then all of your conditionals involving a.isStateAffected() will be false, which means it will always default down to your last statement of value=0;
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,815
Reaction score
7,800
First Language
English
Primarily Uses
RMMZ
I actually did try Pre-Damage before. It was the same thing. 0 dmg with or without states.
Probably because value already exists and you're trying to redefine it, so it's probably causing an error and returning 0. (edit: I thought you had "const" on the beginning of that line but you don't. Try adding console.log statements to each part and see where it stops logging)

@ATT_Turan It actually does.

1646509832155.png
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,455
Reaction score
10,826
First Language
English
Primarily Uses
RMMV
It actually does.
Hrm, I dunno then. @hiddenone I'd guess you don't actually have either of those states on. I don't see anything else that would make it 0 out.

After you make changes, you're saving your database and starting a new play test, right? Saved games won't recognize database changes, and the battle test can sometimes be wonky with plugins.
 

Seacliff

RPG Maker Mastermind
Regular
Joined
Nov 8, 2012
Messages
3,062
Reaction score
1,227
First Language
Yes
Primarily Uses
RMMZ
You shouldn't need a notetag, you can just add a Trait to the armor and select Add Skill. Do you mean something else?
No, because it's tied to the Notetag javascript conditions mentioned in the first part of my comment.
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,455
Reaction score
10,826
First Language
English
Primarily Uses
RMMV
@hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().

No, because it's tied to the Notetag javascript conditions mentioned in the first part of my comment.
Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,815
Reaction score
7,800
First Language
English
Primarily Uses
RMMZ
@hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().


Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
I figured it wasn't passives since he said negative state, but good question.
 

Seacliff

RPG Maker Mastermind
Regular
Joined
Nov 8, 2012
Messages
3,062
Reaction score
1,227
First Language
Yes
Primarily Uses
RMMZ
@hiddenone These are regular states you're checking for, right? VisuStella passive states won't be recognized by isStateAffected().


Ah, so you want the item to add a skill only if it's in the first of your two Armor slots?
Yeah, I wanted to separate the two unless there was only an answer for one of them, but I could have worded that more clearly.
 

HiddenAlchemist

Regular
Regular
Joined
Jan 6, 2021
Messages
131
Reaction score
186
First Language
English
Primarily Uses
RMMV
Am I being mis-tagged?

So I realized the issue (thanks Trihan on Discord!) as I completely missed the else = 0 in the javascript. I don't know nor remember how that got there. It all works as intended now.
 

Saireau

Regular
Regular
Joined
Dec 19, 2019
Messages
141
Reaction score
75
First Language
German
Primarily Uses
RMMV
Hi! :)

I'm thinking about ways to make my debuff-curing items a little more useful. Therefore, I would like to check whether a target has any negative states — that is, states with the '<Negative State>' notetag. How would I do that?

And if it isn't overly complicated, I would also like to have the option to grant a bonus (like some TP) per debuff cleared, so if you could also tell me how to count those negative states, that'd be awesome!
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,815
Reaction score
7,800
First Language
English
Primarily Uses
RMMZ
Hi! :)

I'm thinking about ways to make my debuff-curing items a little more useful. Therefore, I would like to check whether a target has any negative states — that is, states with the '<Negative State>' notetag. How would I do that?
target.hasStateCategory("negative")
And if it isn't overly complicated, I would also like to have the option to grant a bonus (like some TP) per debuff cleared, so if you could also tell me how to count those negative states, that'd be awesome!
target.statesByCount("negative").length
 

Saireau

Regular
Regular
Joined
Dec 19, 2019
Messages
141
Reaction score
75
First Language
German
Primarily Uses
RMMV
JavaScript:
<JS Pre-Damage As User>
    user.gainHp(user.skillTpCost(this.item()));
</JS Pre-Damage As User>

Hi again!

You provided me with the code above for a piece of armour which, after using a skill, restores HP equal to the TP cost of that skill. It worked perfectly for skills, but seems to cause this error when a healing item is used:

1647039598428.png

Is there another way of doing it which prevents this error?
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,815
Reaction score
7,800
First Language
English
Primarily Uses
RMMZ
Hi again!

You provided me with the code above for a piece of armour which, after using a skill, restores HP equal to the TP cost of that skill. It worked perfectly for skills, but seems to cause this error when a healing item is used:

View attachment 219478

Is there another way of doing it which prevents this error?
Ah, sorry. That's because items don't have a TP cost I think. Try

JavaScript:
<JS Pre-Damage As User>
    if (DataManager.isSkill(this.item()) user.gainHp(user.skillTpCost(this.item()));
</JS Pre-Damage As User>
 

Saireau

Regular
Regular
Joined
Dec 19, 2019
Messages
141
Reaction score
75
First Language
German
Primarily Uses
RMMV
That works, thank you. :)

With this out of the way, I was able to test the other code snippet for bonus effects when removing negative states. What I have is this:

<State Negative Category Remove: All>
<JS Pre-Apply>
target.gainTp(target.statesByCount("Negative").length * 5);
</JS Pre-Apply>

Which, unfortunately, doesn't work. Do you have an idea why?

Ideally, the item would only generate TP for each state actually removed, not just counted. To be honest, I don't have any plans of including states of the 'Negative' category that can't be removed with this item, but it's better to have too much design space than too little, right? :) So, should you have an idea how to implement this, that would be even better.
 

Trihan

Speedy Scripter
Regular
Joined
Apr 12, 2012
Messages
6,815
Reaction score
7,800
First Language
English
Primarily Uses
RMMZ
That works, thank you. :)

With this out of the way, I was able to test the other code snippet for bonus effects when removing negative states. What I have is this:

<State Negative Category Remove: All>
<JS Pre-Apply>
target.gainTp(target.statesByCount("Negative").length * 5);
</JS Pre-Apply>

Which, unfortunately, doesn't work. Do you have an idea why?

Ideally, the item would only generate TP for each state actually removed, not just counted. To be honest, I don't have any plans of including states of the 'Negative' category that can't be removed with this item, but it's better to have too much design space than too little, right? :) So, should you have an idea how to implement this, that would be even better.
Yeah, that should be doable. I'll have a crack at it later, got kitchen renovations and coding today!
 

Paladain_377

Villager
Member
Joined
Mar 5, 2016
Messages
22
Reaction score
1
First Language
English
Primarily Uses
Having trouble starting my game after installing Visustella Plugins. When ever I Playtest, I get this message.

Screenshot 2022-03-19 142055.png

Here are my plugins.

Screenshot 2022-03-19 142202.png

Screenshot 2022-03-19 142317.png


Screenshot 2022-03-19 142337.png

Any help would be greatly appreciated.
 

WilsonE7

Regular
Regular
Joined
Oct 12, 2019
Messages
142
Reaction score
67
First Language
English
Primarily Uses
RMMZ
Having trouble starting my game after installing Visustella Plugins. When ever I Playtest, I get this message.

View attachment 220368

Here are my plugins.

View attachment 220369

View attachment 220370


View attachment 220371

Any help would be greatly appreciated.
You need the PIXI JS filters plugin. It comes in the 8 Waves Bundle. Put it all the way at the top in the Plugin Manager. Or turn off Bright Effects and Horror Effects. There might be a couple more that use PIXI, but those are the two I know off the top of my head.
 

Winglerfish

Warper
Member
Joined
Nov 2, 2020
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMZ
Hello,

I am trying to create a state that changes an actor's image along with their stats, like "mini" or "frog" in the Final Fantasy series. I have referred to Yanfly's Actor Transformation Tutorial and also looked around for similar solutions on different forums, but I have not found anything that will help me do this with JS in MZ.

When I test the state in RMMZ, the most important parts of the state seems to work fine, but the SV Battlers do not transform. Is there a way to use Yanfly's Actor Transformation using VisuStella's Skills and States Core? In the case of this state I do not need it to change the Actor's name or face, only the Battler Image, but I have included the character and face names and indexes to try to match the original tutorial.

<JS On Add State>

if (user.isActor()) {

user._prevCharName = user._prevCharName || user._characterName;
user._prevCharIndex = user._prevCharIndex || user._characterIndex;
user._prevFaceName = user._prevFaceName || user._faceName;
user._prevFaceIndex = user._prevFaceIndex || user._faceIndex;
user._prevBattlerName = user._prevBattlerName || user._battlerName;
if (user.actorId() === 1) {
var charName = ‘PackageMZ3_mvt’;
var charIndex = 0;
var faceName = ‘Package3_mvt';
var faceIndex = 0;
var battlerName = ‘Carol_SV_Mega’;
} else if (user.actorId() === 2) {
var charName = ‘Marsha-character-pack1’;
var charIndex = 0;
var faceName = ‘Marsha-character-pack1';
var faceIndex = 0;
var battlerName = ‘Marsha-_SV_Mega’;
} else if (user.actorId() === 3) {
var charName = ‘PackageMV1’;
var charIndex = 3;
var faceName = ‘Package1MV';
var faceIndex = 3;
var battlerName = ‘Hayatemaru_SV_Mega’;
} else if (user.actorId() === 4) {
var charName = ‘PackageMZ3_mvt’;
var charIndex = 4;
var faceName = ‘Package3_mvt';
var faceIndex = 4;
var battlerName = ‘Alan_SV_Mega’;
}
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user.refresh();

</JS On Add State>

<JS On Erase State>
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
user.refresh();

</JS On Erase State>

<JS On Expire State>
var charName = user._prevCharName;
var charIndex = user._prevCharIndex;
var faceName = user._prevFaceName;
var faceIndex = user._prevFaceIndex;
var battlerName = user._prevBattlerName;
user.setCharacterImage(charName, charIndex);
user.setFaceImage(faceName, faceIndex);
user.setBattlerImage(battlerName);
user._priorityCharacterName = undefined;
user._priorityCharacterIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityFaceName = undefined;
user._priorityFaceIndex = undefined;
user._prevFaceName = undefined;
user._prevFaceIndex = undefined;
user._priorityBattlerName = undefined;
user._prevBattlerName = undefined;
user.refresh();

</JS On Expire State>



Thanks for taking the time to respond to my question. I appreciate any advice or directions you can give.
 

Paladain_377

Villager
Member
Joined
Mar 5, 2016
Messages
22
Reaction score
1
First Language
English
Primarily Uses
You need the PIXI JS filters plugin. It comes in the 8 Waves Bundle. Put it all the way at the top in the Plugin Manager. Or turn off Bright Effects and Horror Effects. There might be a couple more that use PIXI, but those are the two I know off the top of my head.
Thanks, your advice helped me to fix my problem. I didn't use the PIXI JS filter plugin. What is that used for anyway? Also does anyone know where I can find a plugin for targetting enemies in groups (like lines of enemies)? If not that's fine.
 

Latest Threads

Latest Posts

Latest Profile Posts

Spiffing up maps is actually a lot of fun.
So the concept for my Game Jam project is way more than I can complete before the deadline. But I think I found a way to get the core done and make the incomplete parts either not really noticeable or make them a part of the story for now. That sneaky, dastardly Krampus! Then I can complete the rest. Did I mention that this is fun?
I've been working on a game called "Eternal Sunset". Is there anywhere here i can "show it off" maybe? Wondering what others think.
What do you do when there are lots of offers online but you don't have even a slight chance of ever playing those myriads of games?

Forum statistics

Threads
136,549
Messages
1,267,376
Members
180,219
Latest member
Wevep
Top