Status
Not open for further replies.

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
I am trying to make a skill requires PP more like Pokemon my game just have 20 skills so what I am doing is setting a variable for each skill so can someone help me with that to set custom requirement of variable in skill and show that variable but I know it can be done by Skill core but I don't know how

Edit-:
I have done almost everything but I don't know how to subtract variable in script this is last thing left please help me with it
 
Last edited:

Fernyfer775

Veteran
Veteran
Joined
Oct 6, 2013
Messages
1,318
Reaction score
824
First Language
English
All of these codes require Yanfly Skill Core + the Core and battle engine I believe? You'll need to slap these codes into your skills and tweak as needed.

This first code is the requirement itself:

<Custom Requirement>
if ($gameVariables.value(x) >= 1) {
value = true;
} else {
value = false;
}
</Custom Requirement>

This one reduces the variable by X when this skill is used:

<Custom Execution>
$gameVariables.setValue(X, $gameVariables.value(X) - 1);
</Custom Execution>

This last one shows the "custom cost" of the skill. You can use all sorts of codes to show icons, change the text color, etc.
<Custom Cost Display>
\v[X]
</Custom Cost Display>

Make sure you initialize the variable somewhere (beginning of battle or whatever) and set it to whatever amount of "pp" you wanted.
 

Ameer

Veteran
Veteran
Joined
Oct 13, 2018
Messages
85
Reaction score
13
First Language
English
Primarily Uses
RMMV
@Fernyfer775 Thanks for your code My code before this was

Code:
<Custom Show Eval>

if ($gameVariables.value(12) < 1) {

visible = false;

} else {

visible = true;

}

</Custom Show Eval>


<Custom Cost Display>

\c[4]\v[12]\c[0] SP

</Custom Cost Display>
and I was calling a common event for decreasing variable

Now my code is this
Code:
<Custom Show Eval>
if ($gameVariables.value(12) < 1) {
visible = false;
} else {
visible = true;
}
</Custom Show Eval>

<Custom Execution>
$gameVariables.setValue(12, $gameVariables.value(12) - 1);
</Custom Execution>

<Custom Cost Display>
\c[4]\v[12]\c[0] SP
</Custom Cost Display>

Again thanks now I don't have to use Common events for every skill in my game
 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Sneak peak of my upcoming update! Who's holding her, you may ask? Find out tonight!
10.PNG
BCj
Finished another GUI! Turn indicator wasn't made by me.

ff981f8dc50b03cf58038c644334b454.jpg


3cb092fdc00087acfa0a190fd891f0ed.jpg
Added a small refining scene to my game.

It makes sense that you try to focus on the squishy mages at the back of the party first, right? If the mage can out-DPS the enemy DPS before the latter can kill the tank in front, the fight becomes boring.

Forum statistics

Threads
115,258
Messages
1,088,399
Members
149,858
Latest member
updateddlc
Top