Looking For Custom Code Vocabulary

Hey folks o/

I'm trying to figure out some intermediate-advanced formulas for my game but my Javascript understanding is limited, though growing. I've figured out how to call some interesting info in custom damage/action sequence formulas and I have the feeling I've only scratched the surface.

I'm open to any and all advice on this matter. There might be stuff out there I don't even realize I need yet so everything is fair game.

I've figured out stuff like if $gameVariables.value(60) < 25 to check a variable for things. I also know how to check stats like a.atk and m.def, etc. What I'm wondering is, can I do things like check if skill target is actor id?
You mean something like

if (b.actorId() === 1)

That would check for the ID of the target. This particular one is used in damage formulas so I'm not sure if they work outside of damage formulas.
That won't work. If used in a damage formula, it'll result in the skill dealing 0 damage to enemies every time. You need to use a two-step method:

JavaScript:
if(b.isActor() && b.actorId() === 1)

Basically, the problem is that checking the actor ID of an enemy is an error, and errors mean 0 damage, so you just have to make sure it's an actor before checking the actor ID.
unless we're talking about a battle system that is not the default, check for turn phase first, before grabbing the actor.
validate the phase to be the enemies turn, and that'll give you B = actor.
Oh nice, replies came fast!

So I could write something like this for yanfly action sequence:


if(b.isActor() && b.actorId() === 51)
motion victory: target

else

motion victory: user


... and this would have it so that if Actor 51 is the target then they will motion victory but if the target is anything other than Actor 51 then the user will motion victory, right?
unless we're talking about a battle system that is not the default, check for turn phase first, before grabbing the actor.
validate the phase to be the enemies turn, and that'll give you B = actor.

I'm not sure if I'd be able to do it that way for my current project since it's Active Time Battle and that seems to do strange things to turn phases. That's cool to know for my other project, though!
since it's Active Time Battle
yeah, no, it won't work then.
you can check for battler.isEnemy? I believe.

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-custom-code-vocabulary.124004/