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

rux
The most words I have ever written in an entire document is in my game's script, jeez i have a lot of characters that ramble on
Yes! I finally did something! This is a picture I drew of what I wish I looked like; I hope that you guys like it!
Finished that egg-sitting mini-game I mentioned here a couple weeks back. Now to fix the weather system so it doesn't rain indoors while you're playing it. >.> A simple fix in itself; leave it to me to take it as an excuse to completely revamp the time/weather/lighting system from scratch.
I'm really tempting to pre order cyberpunk 2077... should I do it or not :/ I really want to play the game but don't want to take a big hit to my saving because of it

Forum statistics

Threads
105,485
Messages
1,014,101
Members
137,138
Latest member
DawnStar
Top