The official VisuStella notetag help thread

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
Hmm, I understand what you mean but I am not sure how to implement it. Because from my understanding something has to go inside the damage formula correct?

For skill notetags I went with:

<JS Pre-Damage>
if(target.mp > v[125]){
target.result().missed = true;
}
</JS Pre-Damage>

But I am not sure what should go inside the damage formula?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
Hmm, I understand what you mean but I am not sure how to implement it. Because from my understanding something has to go inside the damage formula correct?

For skill notetags I went with:

<JS Pre-Damage>
if(target.mp > v[125]){
target.result().missed = true;
}
</JS Pre-Damage>

But I am not sure what should go inside the damage formula?
The damage formula would just be 15.

Your syntax needs to change though since v[whatever] only applies to the formula. It'd be

if (target.mp > $gameVariables.value(125))
 

Austrian

Veteran
Veteran
Joined
Jan 17, 2016
Messages
46
Reaction score
22
First Language
English
Primarily Uses
RMMZ
The damage formula would just be 15.

Your syntax needs to change though since v[whatever] only applies to the formula. It'd be

if (target.mp > $gameVariables.value(125))
Sorry for the late reply, but I tried the method of adding 15 in the damage formula and changing the pre-damage to if(target.mp > $gameVariables.value(125)), when the miss occurs it now says "Miss" -15 instead of "Miss" -1.
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
334
Reaction score
306
First Language
Swedish
Primarily Uses
Running into a problem. I want to add the condition of "needs to know at least one skill of this skill type" to this state but I can't seem to even be able to figure out how to add a third condition let alone the skill bit.


<JS Passive Condition>

if ($gameParty.inBattle() && user.tp >= user.maxTp() ) {

condition = true

} else {

condition = false;

}

</JS Passive Condition>

Attaching another "&&" just checks if either of the && conditions are true and if one is it ignores the other.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
Running into a problem. I want to add the condition of "needs to know at least one skill of this skill type" to this state but I can't seem to even be able to figure out how to add a third condition let alone the skill bit.


<JS Passive Condition>

if ($gameParty.inBattle() && user.tp >= user.maxTp() ) {

condition = true

} else {

condition = false;

}

</JS Passive Condition>

Attaching another "&&" just checks if either of the && conditions are true and if one is it ignores the other.
condition = $gameParty.inBattle() && user.tp >= user.maxTp() && user.skills().filter(skill => skill.stypeId === [id of skill type you require]).length > 0;

^ That is the only line you need in the notetag.
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
334
Reaction score
306
First Language
Swedish
Primarily Uses
condition = $gameParty.inBattle() && user.tp >= user.maxTp() && user.skills().filter(skill => skill.stypeId === [id of skill type you require]).length > 0;

^ That is the only line you need in the notetag.
Thanks! I'm still getting the hang of the True/False thing. It's more abstract than I thought in some cases.

For some reason it still isn't working though. No matter what skill type I test it with.
 

Choraß

Indie Dev
Veteran
Joined
Apr 13, 2015
Messages
93
Reaction score
31
First Language
German
Primarily Uses
RMMZ
Would please need help to setup passive state ideas correctly.

1.
If the user is affected by a certain state, while use the default defend skill, it should give the user a extra effect, that his spell costs 15% less mp, in the next round. But only for the following round, after that round (if the next round end) it expired.

JavaScript:
<JS Passive Condition>
if user.isStateAffected(ID); {
condition = true;
} else {
condition = false;
}
</JS Passive Condition>

2.
If the user attack a target which applied him a certain state, which already affected by that same state, it should be removed or ignore to apply it again.

JavaScript:
JS Passive Condition>
if target.isStateAffected(33);
target.removeState(33); {
condition = true;
} else {
condition = false;
}
</JS Passive Condition>

That's what i figure out so far.
Funny, about 2. at rpg maker vx ace it successfully remove the state if setup "remove by damage 100%" but not in mz.
 

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'm not sure I'll be able to get everything you want, because I'm having a very hard time figuring out what you're trying to say. However, you have some fundamental flaws in your JavaScript syntax, so we can at least correct that and see how it goes from there.

When you have an if conditional, you must put the condition inside parentheses, and you do not put a semicolon at the end of that line. So the correct syntax is:
Code:
if (condition)
    stuff
I would expect due to you typing this incorrectly, none of your code in your states will work.
If the user is affected by a certain state, while use the default defend skill, it should give the user a extra effect, that his spell costs 15% less mp, in the next round.
You will need more than a passive state for this, you will need to add code to the function that gets called when the actor selects Guard. Inside of that, if they have the passive state, then also add your MP-decreasing state with a duration of one round.
If the user attack a target which applied him a certain state, which already affected by that same state, it should be removed or ignore to apply it again.
Unfortunately, I just can't understand what you're asking here. However:
JavaScript:
JS Passive Condition>
if target.isStateAffected(33);
target.removeState(33); {
condition = true;
} else {
condition = false;
}
</JS Passive Condition>
That's completely wrong. In addition to the errors with the if condition that I listed above, your braces are in the wrong place. The correctly-written version of that code is:
JavaScript:
<JS Passive Condition>
if (target.isStateAffected(33))
{
    target.removeState(33);
    condition = true;
} 
else 
    condition = false;
</JS Passive Condition>

That being said...this will still never do anything. There's no such thing as "target" in a passive state, passive states only apply (and know anything about) the actor they're applied to.

This sounds like something you'd just add to the damage formula of a skill:
Code:
if (a.states().includes($dataStates[X])) b.removeState(33); then your damage formula
That will remove state 33 from the target if the attacker has passive state X.
Funny, about 2. at rpg maker vx ace it successfully remove the state if setup "remove by damage 100%" but not in mz.
It should.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
Thanks! I'm still getting the hang of the True/False thing. It's more abstract than I thought in some cases.

For some reason it still isn't working though. No matter what skill type I test it with.
Can you show me your notetag?
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
334
Reaction score
306
First Language
Swedish
Primarily Uses
Can you show me your notetag?
Sure.


<JS Passive Condition>

condition = $gameParty.inBattle() && user.tp >= user.maxTp() && user.skills().filter(skill => skill.stypeId === [1]).length > 0;

</JS Passive Condition>
 

Choraß

Indie Dev
Veteran
Joined
Apr 13, 2015
Messages
93
Reaction score
31
First Language
German
Primarily Uses
RMMZ
@ATT_Turan
Okay besides my code mess, i'll try to explain what i want to achieve. ^^

1.
So if a actor have a passive state let's call it "magic hand". Now at the default defend skill should be a notetag code, if the wielder of that passive "magic hand" use now the defend skill, it should give him a extra effect. That his spell costs 15% less mp, in the next round now. But only for the following round, after that round the effect expired.

2.
That's actually a mark passive, if the wielder of this passive attack (normal attack) a enemy that will add a negative state to him, which reduce his magic defense. The mark remains until the enemy get any damage, after it was applied.

It should.
Unfortunately not about 2. i tested it with same conditions. At rpg maker vx ace it successfully remove the state by any damage, at mz not. Because it just give him the negative state (mark) again after damage output in mz. Like the order is different of vx ace - mz.
 
Last edited:

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 think I already explained how to do this - it wouldn't have anything to do with a notetag. You could use a little plugin, a common event on the Guard skill, or Action Sequences in the Guard skill.
Yeah, I would never have gotten that from your prior description or what you tried to put in your code. But it's only a minor change to what I already explained - this, again, would have nothing to do with a state or notetag. You'd put it in your damage formula exactly as I typed before, except you apparently want to do addState instead of removeState.

skill.stypeId === [1]
This is incorrect syntax. I don't even think there's anything that could make this be true, especially with the strict equality you're using (maybe an array with one element?). You're looking for the stypeId to be the value 1, not [1]. So change it to:
skill.stypeId==1
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
As ATT_Turan said, you're currently checking whether the skill type ID is an array containing the value 1, which will never happen. The square brackets were showing something you needed to change, not something you needed to copy directly. Sorry for not specifying!
 

Weremole

Veteran
Veteran
Joined
Jan 22, 2016
Messages
334
Reaction score
306
First Language
Swedish
Primarily Uses
As ATT_Turan said, you're currently checking whether the skill type ID is an array containing the value 1, which will never happen. The square brackets were showing something you needed to change, not something you needed to copy directly. Sorry for not specifying!
No problem. There's just so many brackets and such that it's easy to get confused whit what's what. Anyhow, now this thing works and I'm really happy that this system I've been nailing together is finally in place. Thanks a lot everyone.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
5,035
Reaction score
4,644
First Language
English
Primarily Uses
RMMZ
No problem. There's just so many brackets and such that it's easy to get confused whit what's what. Anyhow, now this thing works and I'm really happy that this system I've been nailing together is finally in place. Thanks a lot everyone.
I hear you. It's a constant struggle trying to figure out a good way to show people something in sample code they need to change without using characters that also appear in code sometimes. :p
 

Choraß

Indie Dev
Veteran
Joined
Apr 13, 2015
Messages
93
Reaction score
31
First Language
German
Primarily Uses
RMMZ
This sounds like something you'd just add to the damage formula of a skill:
Code:
if (a.states().includes($dataStates[X])) b.removeState(33); then your damage formula
That will remove state 33 from the target if the attacker has passive state X.
You'd put it in your damage formula exactly as I typed before, except you apparently want to do addState instead of removeState.
I tried it out, but unfortunately that not works too. As i guess, it just add the mark state again after damage output, from the passive.

2. (Passive add a another passive (state) which give the normal attack a 100% attack state addition.)

As mention before in vx ace it was really fine, i could easy remove it by any damage, at the default option.

(EDIT)
I made a test with a another actor which don't have that passive, what add the mark. It successfully remove the mark by damage. Which just affirmed my guess. The order how it handle must be changed there, which add state after damage output.

I think I already explained how to do this - it wouldn't have anything to do with a notetag. You could use a little plugin, a common event on the Guard skill, or Action Sequences in the Guard skill.
Hm i see, i thought i could achieve it with notetags from VisuStella MZ Skills and States Core.
 
Last edited:

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 tried it out, but unfortunately that not works too. As i guess, it just add the mark state again after damage output, from the passive.
I'm sorry, I just don't understand. You said you want it to do this:
if the wielder of this passive attack a enemy that will add a negative state to him
So I told you to use the code I gave you before, but change it to addState. Therefore:
Code:
if (a.states().includes($dataStates[X])) b.addState(33); then your damage formula
where X is the ID of the passive state, and 33 is the negative state you want to add.

I suggest you start a new thread, because none of this has anything to do with VisuStella notetags. When you do, you should post screenshots of the skills and states that you've set up, that should make it easier to understand what you're trying to do.
 

Choraß

Indie Dev
Veteran
Joined
Apr 13, 2015
Messages
93
Reaction score
31
First Language
German
Primarily Uses
RMMZ
I'm sorry, I just don't understand. You said you want it to do this:
I guess, i'm explaining it too confusing. :eswt:
I also mentioned:

which already affected by that same state, it should be removed or ignore to apply it again.
The mark remains until the enemy get any damage, after it was applied.



So I told you to use the code I gave you before, but change it to addState. Therefore:
Code:
if (a.states().includes($dataStates[X])) b.addState(33); then your damage formula
where X is the ID of the passive state, and 33 is the negative state you want to add.
That I understood and tried it out already. It not work at any way.

If this wasn't clear before:
The idea was remove the mark, if the enemy is already affected of it (and by any damage). Which i could easy handle over the "remove by damage" option before (vx ace). Which don't work in mz, because of the different handle order obviously. Which i test to confirm it:
I made a test with a another actor which don't have that passive, what add the mark. It successfully remove the mark by damage. Which just affirmed my guess. The order how it handle must be changed there, which add state after damage output.


I suggest you start a new thread, because none of this has anything to do with VisuStella notetags. When you do, you should post screenshots of the skills and states that you've set up, that should make it easier to understand what you're trying to do.
Hm seems so, not quiet understand why it should nothing to do with VisuStella notetags, but anyway thanks for trying to help.
 
Last edited:

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
The idea was remove the mark, if the enemy is already affected of it (and by any damage).
One of the confusing things is that you're using different words in different posts, and different parts of posts. Is "the mark" the same thing as "add a negative state"?
not quiet understand why it should nothing to do with VisuStella notetags
Why do you think it should have anything to do with notetags? You could do this using <JS Post-Damage as User>, but it isn't necessary, and it definitely wouldn't have anything to do with a passive condition like you were originally trying.

So if I properly understand now:
- The actor with this passive state on attacks an enemy
-- If that enemy doesn't have state 33, it's put on
-- If the enemy does have state 33, it's taken off

Here's the code for that:
Code:
if (a.states().includes($dataStates[X])) {b.isStateAffected(33) ? b.removeState(33) : b.addState(33)}; then your damage formula
where X is the ID of your passive state, and 33 is the mark that you want to add or remove. You probably don't even need the removeState call in there, but whatevs.

This is a simple ternary operation. You can find more examples and explanations in this thread:
 

Choraß

Indie Dev
Veteran
Joined
Apr 13, 2015
Messages
93
Reaction score
31
First Language
German
Primarily Uses
RMMZ
One of the confusing things is that you're using different words in different posts, and different parts of posts. Is "the mark" the same thing as "add a negative state"?
Sorry, i use other words for the same, to actually point up the meaning. Seems the opposite happen.

Why do you think it should have anything to do with notetags? You could do this using <JS Post-Damage as User>, but it isn't necessary, and it definitely wouldn't have anything to do with a passive condition like you were originally trying.
Since i read, i can add passive states conditions.

So if I properly understand now:
- The actor with this passive state on attacks an enemy
-- If that enemy doesn't have state 33, it's put on
-- If the enemy does have state 33, it's taken off
Yes, that's correct.

Here's the code for that:
Code:
if (a.states().includes($dataStates[X])) {b.isStateAffected(33) ? b.removeState(33) : b.addState(33)}; then your damage formula
where X is the ID of your passive state, and 33 is the mark that you want to add or remove. You probably don't even need the removeState call in there, but whatevs.

This is a simple ternary operation. You can find more examples and explanations in this thread:
Okay i see now what the problem is. You assume it from the MV base behavior, not MZ. They may be similar, but not at all. To confirm it, i tried your "Damage Formula" code in MV and in MZ, indeed as i guess, in MV your code works quite well, but in MZ It not work at any way.

Of course i use the MZ, as the topic here "MZ Support" and as i mentioned before.
Also the "remove by damage" option works in MV, not in MZ by same setup. Ther handle order is different.
 
Last edited:

Latest Threads

Latest Posts

Forum statistics

Threads
124,350
Messages
1,162,961
Members
163,146
Latest member
harish-m98
Top