Creating a character variable

Coolconor98

Villager
Member
Joined
Jun 5, 2015
Messages
17
Reaction score
0
First Language
English
Primarily Uses
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?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 

Coolconor98

Villager
Member
Joined
Jun 5, 2015
Messages
17
Reaction score
0
First Language
English
Primarily Uses
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.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,867
Messages
1,017,062
Members
137,575
Latest member
akekaphol101
Top