RMMV How could I make this Eval work?

STARFALL

STARFALL
Veteran
Joined
Jul 6, 2020
Messages
67
Reaction score
9
First Language
spanish
Primarily Uses
RMMV
I explain, I made 3 skills that call the same common event that I should do the following:
if skill A was used, set variable X to 0, if not, variable X increased by one
and try the following:

if ( the skill used is == Skill A){
$game.Variables.setValue(x,0));
}
else {
$game.Variables.setValue(x,$game.Variables.value(x,++));
}

but I don't know how to complete it, the truth is that I don't know if what I did is right.
Could someone help me, Thanks in advance.
 

Cythera

Veteran
Veteran
Joined
Jul 31, 2019
Messages
146
Reaction score
252
First Language
English
Primarily Uses
RMMV
If they're three different skills, why don't you control the variable in each skill using Action Sequence commands? :3 Or even a skill after eval.
Or are you trying to do something else in the common event in addition to the variable control?
 

STARFALL

STARFALL
Veteran
Joined
Jul 6, 2020
Messages
67
Reaction score
9
First Language
spanish
Primarily Uses
RMMV
If they're three different skills, why don't you control the variable in each skill using Action Sequence commands? :3 Or even a skill after eval.
Or are you trying to do something else in the common event in addition to the variable control?
you're right it's easier that way. but I would be interested in learning how to do it with js. I am trying to learn but it is not easy.
 

Cythera

Veteran
Veteran
Joined
Jul 31, 2019
Messages
146
Reaction score
252
First Language
English
Primarily Uses
RMMV
If you don't want to do it via action sequences, I'd go with the skill core plugin - another freebie of Yanfly's. Then do an after eval on each of the skills; it would look something like:
<After eval>
$gameVariables.setvalue(1, $gameVariables.value(1) + 1);
</After eval>
But I say just use action sequences :p It's the easiest route! Don't add more work for yourself is my opinion haha.
Also, side note here, if you're interested in learning to code with MV, I use this site - it has documentation for...pretty much everything in the engine. I find it super useful.
 

STARFALL

STARFALL
Veteran
Joined
Jul 6, 2020
Messages
67
Reaction score
9
First Language
spanish
Primarily Uses
RMMV
If you don't want to do it via action sequences, I'd go with the skill core plugin - another freebie of Yanfly's. Then do an after eval on each of the skills; it would look something like:
<After eval>
$gameVariables.setvalue(1, $gameVariables.value(1) + 1);
</After eval>
But I say just use action sequences :p It's the easiest route! Don't add more work for yourself is my opinion haha.
Also, side note here, if you're interested in learning to code with MV, I use this site - it has documentation for...pretty much everything in the engine. I find it super useful.
Okay, I'll use <ACTION SEQUENCES>, in the end the result will be the same and it's easier, and thank you very much for the link.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

SF_Monster6 added!

Wonder when the next theme contest is coming?
Long time no see. I'm aiming a vertical slice / tech demo for my game featuring a series of boss battles this month. I hope I could get some testers.
So which forum do I use if I want to showcase graphics? I've been using AML forum, but I'm not sure it's correct.

Forum statistics

Threads
105,781
Messages
1,016,459
Members
137,482
Latest member
mentalhealthawareness
Top