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?
Creating a character variable
RPG Maker VXAce SupportYou 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:
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.
In that case, in the damage formula you would put this:
Code:
v[1] = a.id;
Then you don't need to use variables or common events. In fact, common evens don't run during battle.
and insert the appropriate damage formula where indicated (without the <>), will reduce the attacker's HP by 1 and do whatever damage is needed.
Code:
a.change_hp(-1,true); <damage formula here>
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/