Every time the skill is used, it will be a random tp cost (determine with the specific skill like skill JUMP always cost 1 to 8 tp each time it s used) for the charactwr who used it.This doesn't answer the original question. When do you want the randomisation to occur? Do want the cost randomised every turn in battle, at every actors input, at the start of battle, when the skill is learned, when the game is created, on moving to a new map, on a day/night cycle basis? Is this to be shown in the actual skills cost? If it isn't, what do you do when the skill fluctuates to cost more than originally displayed base cost?
There's too many unknowns for anyone to answer your question.
<Custom TP Cost>
// Add a random number 0~5 to the skill cost
cost += Math.randomInt(6);
</Custom TP Cost>
<Before Eval>
var skillCost = Math.randomInt(6);
user.gainTp(-skillCost);
</Before Eval>
Oh yes, whoops. Looks like <Custom Cost Display> adds text rather than replacing it.Unfortunatly, when I put the code, I can't hide the skill cost. I can put a picture, but still a "random" skill cost will appear since I set it to be random
gainTp can accept negative values; as you see in my example I've put a minus in front of the input:And also, it really helps for the cost, but how does it work for the GAIN? Instead of losing TP, you gain them.
user.gainTp(-skillCost);
var skillCost = Math.randomInt(6);
user.gainTp(-skillCost);
user.gainTp(-Math.randomInt(6));
<Custom Cost Display>
\i[4]
</Custom Cost Display>
<Before Eval>
var skillCost = Math.randomInt(6);
user.gainTp(-skillCost);
</Before Eval>
<Custom Requirement>
if (user.tp >= 5) {
value = true;
} else {
value = false;
}
</Custom Requirement>