Thank you. and of course JS On Erase State is what should be in place of JS on remove?
EDIT: after making this change, for some reason, it's the user of the skill that dies on the first use - progress, but I wonder what happened
Thank you. and of course JS On Erase State is what should be in place of JS on remove?
That's because you typed
user in all of your code. You need to be doing all that stuff to the target object instead.<JS On Add State>
const drainAmount = Math.randomInt(8) + 1;
target._drainedAttack ??= 0;
target._drainedAttack += drainAmount;
target.addParam(2, -drainAmount);
if (target.atk <= 0) {
target.die();
}
</JS On Add State>
<JS On Erase State>
if (target._drainedAttack) {
target.addParam(2, target._drainedAttack);
delete target._drainedAttack;
}
</JS On Erase State>
user in the "On Erase State" note tag. It is now fixed.oh goodness me, then again, I am an amateur, thank you for pointing that out! if any of you is looking for a self-destruct skill feel free to use my original version LOL
this is a significantly more serious issue. as in, this would permanently reduce stats, end of? not even a recovery possible? (I'm an amateur, again)
Yep, it'd be permanent for the remainder of the game, because each time the state was added to the target, it would be overwriting the previous value of
target._drainedAttack, meaning that only the attack drained by the latest stack is being kept track of. So then when the state was finally removed, it would only add back the atk from that latest stack, and the rest of the atk that had been drained would remain lost in the nether.Thank you again very much 🙂 is there a way to make the reduced attribute be highlighted in red on the status menu with the notetag?
Not solely with the note tag, no. That's probably the type of thing that deserves its own thread, since it would require a standalone plugin, and the answer would depend on which other plugins you're already using (i.e. if you're using VisuStella Elements and Status Core, that would completely change how you've gotta go about it).
Thanks, I really appreciate your help and fixing the mistake I made!
No problem. The color thing isn't exactly hard to do. It's just possibly going to require more back and forth than what this thread was really designed for, so it's probably best to put it into its own thread. If too many different conversations get going at the same time in the same thread, things can get confusing pretty fast.
Maybe I will do it then - thankfully, the state icon still appears in the status screen, so it would just be for extra signposting.
<JS Pre-Apply as Target>
// Replace 3 with the ID of the skill type you want to be immune to
if (this.isSkill() && this.item().stypeId === 3) {
target.result().success = false;
target.result().critical = false;
target.result().hpAffected = false;
target.result().mpAffected = false;
target.result().tpAffected = false;
}
</JS Pre-Apply as Target>
I don't see why you would do anything with notetagas for this, this is what the built-in elements system is for. I'm not sure what "a multiplier damage formula" has to do with it, but every actor, class, enemy, etc. in the game can be given a Trait with Element Rate to make them more or less susceptible to a specific element (including immune, if you set the rate to 0%).
The reason being that say, in the VS Status Core plugin, you can pick between these 4 lovely approaches:
Now for the first part of your observation.
This is a once again D&D inspired feature. In D&D, you have a number of main types of ability: magic, supernatural, extraordinary, psionic. Only the first type is subject to spell resistance.
I can't find those traits at all. Are you talking about the Physical Damage and Magical Damage Sp-Parameters?
Yes I am. Was on the train, couldn't check exact terminology.
yes, but caster levels don't exist in RPG maker and AD&D in video games (Baldur's gate 2, for example) works more or less with a % system, so I took that as an inspiration 🙂
It doesn't seem to work, so I must have made a mistake in the syntax :?
Well, sure they do - your level in the class is exactly the same as in D&D your level in the class. But if you prefer to do it this way, that's of course your choice.
I don't see anything glaring. The trick is, you're trying to tell the game "Hey this didn't hit and doesn't do anything" after it already hit. I don't know if that can work, that's why I wouldn't try to implement it this way at all.
I mean, not if you multiclass, but that's beside the point.
I'm not sophisticated enough to go with a percentage 😅 I thought that I'd start with an all or nothing.
oh? I thought it was pre-apply?
I'm not sure how to do either, so help is appreciated.
The Class Change System allows you to track levels per class, just like D&D does.
The description of Pre-Apply says "Runs JavaScript code at the start of an action hit" (emphasis mine).
<JS Pre-Damage as Target>
// Replace 3 with the ID of the skill type you want to be resistant to
if (this.isSkill() && this.item().stypeId == 3)
value*=.8; // Modify math as desired
</JS Pre-Damage as Target>
wow this is way simpler than what I did. Thank you.
I'll make a thread, mark this as exchange 6 only for the purpose of thanking you
There are a variety of ways to do this, and it's difficult to recommend something specific without seeing your code.
That sounds a little hinky - customarily a custom menu would be a scene created by calling functions, not just a variable.
Original thread: https://forums.rpgmakerweb.com/threads/javascript-questions-that-dont-deserve-their-own-thread.46341/