The official VisuStella notetag help thread

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,930
Reaction score
3,131
First Language
English
Primarily Uses
RMMV
I am trying to let a random variable determine if the hit is successful or not.
So as far as I can tell from the documentation, that's the wrong tag. The VisuStella documentation is a bit less clear than the original Yanfly Skill Core, but presuming they're equivalent, Pre-Damage happens before damage is dealt (so you can modify it), but after hitting is determined.

The earliest notetag that includes a "target" option is Pre-Apply, so try moving your code into that.
Hello, I have been trying to implement the giant slayer from the yep tips and tricks, but to no avail. Does anyone know how to?
I think you're in the wrong thread - this is for the VisuStella plugins for MZ.

If you're using Yanfly's plugins in MV, the tips and tricks should work via copy-and-paste if all of your plugins are set up correctly. If this is what you're doing and it doesn't work, you should start a new thread in Plugin Support and give screenshots of your skill and plugin manager.

If you're using VisuStella and MZ and trying to convert the Giant Slayer, please show the work that you have done to convert it, and give any details about what doesn't work.
 

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
Didn't think to try pre-apply but unfortunately, that didn't work either. It doesn't seem to check the last IF statement on whether the attack hit was a miss or not.
 

NaosoX

Veteran
Veteran
Joined
Feb 28, 2013
Messages
524
Reaction score
300
First Language
English
Primarily Uses
RMMZ
I think he mentioned pre-damage, not pre-apply.. as they are two different things. Not to mention pre-damage, pre-damageas user, pre-damage as target.
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,930
Reaction score
3,131
First Language
English
Primarily Uses
RMMV
Didn't think to try pre-apply but unfortunately, that didn't work either. It doesn't seem to check the last IF statement on whether the attack hit was a miss or not.
Not sure...you might just want to start doing a console.log() of the various numbers in play, in the different sections, see what everything is and what's getting looked at by the code.

I am curious about the whole chunk of your code leading up to the if conditional:
Code:
//Roll the dices & add strMod
let die = Math.floor((Math.random() * 20) + 1);
die += str;

//Set the hitDie
$gameVariables.setValue(122, die);

//if attack miss
if(target.mp > $gameVariables.value(122))

you declare a local variable, then you stick it into one of the game's globals, why? Do you actually use that "die roll" value outside of this skill with the game variable?

Couldn't all that just be
Code:
if(target.mp > Math.floor((Math.random()*20)+1)+str)
    target.result().missed = true;
?
 

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
I do use die roll outside of skill.

Originally, I was using the common events action sequences and use the variables in there to determine the hit and damage. But thought about converting it all into the skill notes tab. I was trying to figure out how to get rid of the miss + damage occurring. Seems to occur in both methods. Everything works fine, the dmg is calculated correctly, even if the target has resistance.

I've even did target.result().critical = true, that works perfectly as well. But when I do target.result().missed = true; the miss function works but the target is still getting hit. I am not sure why. When I try something similar without battle core and adjust some of the implementations, the target.result().missed = true, causes the user to miss their attack even if the skill is set to certain hit.

I could use that method in your last line of code but I like to use the debugger to check the numbers. To make sure things are working, though I should probably take a look at the console more.
 

JosephSeraph

White Mage
Restaff
Joined
Mar 7, 2014
Messages
1,243
Reaction score
1,521
First Language
Portuguese
OK, now this is in a state where it makes sense to ask for help.

I have this state that gets removed if the recipient is either the target or the user of a skill with a certain element. However, this does not take into account elements inherited from traits nor (with Visustella Elements) multi-element skills. How should I change this if condition to see if a skill contains a given element?

<JS Post-Damage as Target>
if (this.item().damage.elementId == 2)
{b.removeState(34);}
</JS Post-Damage as Target>

<JS Post-Apply as User>
if (this.item().damage.elementId == 2)
{a.removeState(34);}
</JS Post-Apply as User>

Back on MV it seems like it was getItemElements().contains(x) (in place of this.item().damage.elementID == x) but I don't know how it's like on Visustella MZ. Is there any documentation / resource where we can read up on this? I don't like asking for help, but I also can't find really find reference =(
 
Last edited:

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
246
Reaction score
92
First Language
English
Primarily Uses
RMMZ
So, I'm wondering, for notetags that point towards a specific resource, have they been updated to support the new subfolder functionality of RPG maker mz? (Like the "animated item drop")
 

NaosoX

Veteran
Veteran
Joined
Feb 28, 2013
Messages
524
Reaction score
300
First Language
English
Primarily Uses
RMMZ
Perhaps You are asking what supports sub folders?
Some plugins will point to img folder for example, to use notetags for sub folders, just include them.
If you had a sub folder called trees inside img folder... and the file pine.png
trees/pine.png

think this is what you're asking?
 

Dark_Ansem

Veteran
Veteran
Joined
Jun 16, 2020
Messages
246
Reaction score
92
First Language
English
Primarily Uses
RMMZ
It
Perhaps You are asking what supports sub folders?
Some plugins will point to img folder for example, to use notetags for sub folders, just include them.
If you had a sub folder called trees inside img folder... and the file pine.png
trees/pine.png

think this is what you're asking?
Is, thank you. I was just wondering if Visustella Notetags and plugins allowed for subfolders when pointing to resources
 

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
I'd like to recreate the flat damage barrier effect in MZ but this is not working


<JS Pre-Damage>

target.loseBarrier(300)

</JS Pre-Damage>

Does anyone knows how to do it? Thanks
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
I'd like to recreate the flat damage barrier effect in MZ but this is not working


<JS Pre-Damage>

target.loseBarrier(300)

</JS Pre-Damage>

Does anyone knows how to do it? Thanks
Barriers in the VisuStella suite use the Anti Damage Barriers plugin (so make sure you have that) and barriers are added via states. Check the plugin documentation for an explanation on setup.
 

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
I have the plugin but nowhere in the documentation do they include a way to reduce the target barrier points. I want a skill to only do damage to barrier, not to HP
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
I have the plugin but nowhere in the documentation do they include a way to reduce the target barrier points. I want a skill to only do damage to barrier, not to HP
That's handled automatically. Damage will always apply to a barrier first until it's depleted and only then will it damage HP.
 

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
That's handled automatically. Damage will always apply to a barrier first until it's depleted and only then will it damage HP.
I know. What I want is another sort of damage like Shield damage that is not affected by the skill formula. For example, flat 300 damage to barrier and normal damage of 100
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
I know. What I want is another sort of damage like Shield damage that is not affected by the skill formula. For example, flat 300 damage to barrier and normal damage of 100
Ah, okay. Then you want to use

JavaScript:
const barrier = target.getStateDisplay(stateid);
target.setStateDisplay(stateid, barrier - 300);
 

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
I used in my skills
<JS Pre-Damage>

const barrier = target.getStateDisplay(195);

target.setStateDisplay(195, barrier - 300);

</JS Pre-Damage>

(195 is the barrier state of the enemy)
and then


<JS Pre-Damage>

const barrier = target.getStateDisplay(stateid);
target.setStateDisplay(stateid, barrier - 300);

</JS Pre-Damage>

But none of them work
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
I used in my skills
<JS Pre-Damage>

const barrier = target.getStateDisplay(195);

target.setStateDisplay(195, barrier - 300);

</JS Pre-Damage>

(195 is the barrier state of the enemy)
and then


<JS Pre-Damage>

const barrier = target.getStateDisplay(stateid);
target.setStateDisplay(stateid, barrier - 300);

</JS Pre-Damage>

But none of them work
Try this.

JavaScript:
<JS Pre-Damage>
  const barrier = target.getStateDisplay(195) - 300;
  if (barrier > 0) target.setStateDisplay(195, barrier); else target.removeState(195);
</JS Pre-Damage>
 

Krawzer_KOF

Veteran
Veteran
Joined
Aug 27, 2017
Messages
113
Reaction score
12
First Language
English
Primarily Uses
RMMV
It works! Thank you! Btw is there a way to add a pop up to show the damage to the barrier?
 

Latest Threads

Latest Posts

Forum statistics

Threads
124,348
Messages
1,162,932
Members
163,143
Latest member
WinterWolf
Top