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

GOBBLE GOBBLE! Happy thanksgiving.
Oh no. That moment when you try to fix something you modified in your game, like, a year ago but didn't want to fix then, and you now have no idea what you even did. Me right now, trying to figure out why my gold window is over stretched?
LittlePIGGY wrote on atreyoray's profile.
Where are you TT^TT
We need ARP_InGameManual for MZ
Oh my gosh. Thank you, Macy's! Thank you so much! You have made me very happy!

Forum statistics

Threads
105,550
Messages
1,014,568
Members
137,225
Latest member
Eryndor
Top