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 official VisuStella notetag help thread
● ARCHIVED · READ-ONLY
-
-
The damage formula would just be 15.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?
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.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)) -
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;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.
^ 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.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.
For some reason it still isn't working though. No matter what skill type I test it with. -
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. -
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:I would expect due to you typing this incorrectly, none of your code in your states will work.if (condition) stuff
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 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.
Unfortunately, I just can't understand what you're asking here. However: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.
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>
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:That will remove state 33 from the target if the attacker has passive state X.if (a.states().includes($dataStates[X])) b.removeState(33); then your damage formula
It should.Funny, about 2. at rpg maker vx ace it successfully remove the state if setup "remove by damage 100%" but not in mz. -
Can you show me your 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. -
Sure.Can you show me your notetag?
<JS Passive Condition>
condition = $gameParty.inBattle() && user.tp >= user.maxTp() && user.skills().filter(skill => skill.stypeId === [1]).length > 0;
</JS Passive Condition> -
@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.
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.It should. -
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.1.
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.2.
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]
skill.stypeId==1 -
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.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!
-
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. :pNo 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.
-
This sounds like something you'd just add to the damage formula of a skill:
Code:That will remove state 33 from the target if the attacker has passive state X.if (a.states().includes($dataStates[X])) b.removeState(33); then your damage formulaI 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.You'd put it in your damage formula exactly as I typed before, except you apparently want to do addState instead of removeState.
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.
Hm i see, i thought i could achieve it with notetags from VisuStella MZ Skills and States Core.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. -
I'm sorry, I just don't understand. You said you want it to do this: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.
So I told you to use the code I gave you before, but change it to addState. Therefore:if the wielder of this passive attack a enemy that will add a negative state to him
Code:where X is the ID of the passive state, and 33 is the negative state you want to add.if (a.states().includes($dataStates[X])) b.addState(33); then your damage formula
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. -
I guess, i'm explaining it too confusing. :eswt:I'm sorry, I just don't understand. You said you want it to do this:
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.
That I understood and tried it out already. It not work at any way.So I told you to use the code I gave you before, but change it to addState. Therefore:
Code:where X is the ID of the passive state, and 33 is the negative state you want to add.if (a.states().includes($dataStates[X])) b.addState(33); then your damage formula
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.
Hm seems so, not quiet understand why it should nothing to do with VisuStella notetags, but anyway thanks for trying to help.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. -
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"?The idea was remove the mark, if the enemy is already affected of it (and by any damage).
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.not quiet understand why it should nothing to do with VisuStella notetags
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: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.if (a.states().includes($dataStates[X])) {b.isStateAffected(33) ? b.removeState(33) : b.addState(33)}; then your damage formula
This is a simple ternary operation. You can find more examples and explanations in this thread:
Damage Formulas 101 -
Sorry, i use other words for the same, to actually point up the meaning. Seems the opposite happen.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"?
Since i read, i can add passive states conditions.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.
Yes, that's correct.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
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.Here's the code for that:
Code: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.if (a.states().includes($dataStates[X])) {b.isStateAffected(33) ? b.removeState(33) : b.addState(33)}; then your damage formula
This is a simple ternary operation. You can find more examples and explanations in this thread:
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.