Variable Skill Cost

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,317
Reaction score
818
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.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top