Creating a character variable

I'm trying to create a variable in which the variable is that when character a attacks in a certain move.  Character A is the variable.  How would I do this?
You should explain what you're trying to achieve. It SOUNDS like you want a variable to be set to the id of the attacker?


In that case, in the damage formula you would put this:

Code:
v[1] = a.id;
followed by the actual damage formula. The 1 is the variable id, so if you want to use variable 15, you would put v[15] instead.
You should explain what you're trying to achieve. It SOUNDS like you want a variable to be set to the id of the attacker?

In that case, in the damage formula you would put this:

v[1] = a.id;followed by the actual damage formula. The 1 is the variable id, so if you want to use variable 15, you would put v[15] instead.
I'm trying to make it so that a common even decreases the health of the attacker.  Using the "change hp" in the event commands only gives the option for the entire party or one specific member so I'm trying to make a variable so that it changes the user's hp.
Then you don't need to use variables or common events. In fact, common evens don't run during battle.

Code:
a.change_hp(-1,true); <damage formula here>
and insert the appropriate damage formula where indicated (without the <>), will reduce the attacker's HP by 1 and do whatever damage is needed.
In addition to the good answer from Shaz, you will find this guide on Custom Forumulae to be very useful.

Original thread: https://forums.rpgmakerweb.com/threads/creating-a-character-variable.41120/