Maybe I just don't play enough Pokeman to understand, but how is PP different than MP anyways? Either way you have a finite resource that depletes over time. Couldn't you just do the same thing by calling MP PP and then restricting or eliminating all items that restore that resource?
Got it. So does this apply to everyone that has that skill then? Or just that character? If that character it sounds kind of similar to the old D and D spell memorization system, and there should be a script for that. If it is for all uses of that sills across all actors, then you probably need something else.
@Andar: That won't work, the limited uses resets after every battle. I think the OP wants it to not reset until you rest.
You might run into another issue though. As far as I know, the limited uses are not saved, so if someone saves their game then loads it, the PP will reset. Of course, if you restrict saving to fixed locations that restore your PP then it is a non-issue.
I think it has to be an attr_accessor to be saved actually. Instance variables stay for that instance of the class, and are not saved. At least that's how it has been for me for all other Yanfly scripts I use (like the passive states script. If you add a passive state mid game, it's lost once you load a game as they were saved as instance variables).
But, agreed, let's let the OP test it and see. I might be totally wrong here.
Nope, I just tried to push a new state into the array (by a script call). When I loaded the game, it was not saved. So I can confirm that the array of all passive states on an actor is not saved. Instead, it is read every time you load a game via his loadnotetags call (since Yanfly set it up to read them every time you load a game). So it appears as if it is saved, but it is not. You can also confirm this by adding a new passive state then loading a save game, the new state will suddenly be there. If it were saved with the actor data, that would not work.
And its an unmodified script. I have a feeling the same issue will arise with the limited uses, as you can suddenly add it to a skill, and it will be there on an old save game, despite it not being there before.
Now that would make sense then! Thanks. Though this side discussion might have helped me fix a bug in my game now.
Back on topic: OP, is it solved now?