So Yanfly has a script known as Stat Allocation and it mostly does what I want, but I wish I could make it so that each character required a different item to to level up their stats. Is there a way to do this or should I just accept that I need to go with a different tactic? (I do have a few other ideas if I can't make this work)
MV Different Items for each character in Yanfly's Stat Allocation?
Javascript/Plugin SupportYour question is worded a bit ambiguously, but I'm operating under the assumption that you want items which give Allocation Points to only function for specific characters, with each item being unique to that character.
If that's the case, then Yanfly's Item Requirements plugin will probably help you do what you want.
Specifically:
Using these types of item requirements, you should be able to restrict which actor/class can use each item, thus effectively creating AP items unique to each character.
If that's the case, then Yanfly's Item Requirements plugin will probably help you do what you want.
Specifically:
Using these types of item requirements, you should be able to restrict which actor/class can use each item, thus effectively creating AP items unique to each character.
actually what I want is to use the items themselves and not ap.
The problem with this is that I'd presume you're using items outside of combat to do your levelling up and stat allocation. The Item Requirements won't help then, because there is no "battler who's using the item" then, only a target for it.
I don't remember off the top of my head whether Yanfly's Target Core works in the party screen, but that would be more along the thing to check.
You could try:
Code:
<Custom Target Eval>
targets=$gameParty.members().find(member => member.actorId==X);
</Custom Target Eval>
I don't believe it does. Let me go into more detail about what I want and perhaps we can figure this out together.
We have four items (we are thinking 100 of each are hidden throughout the world):
Love Sigil
Duty Sigil
Companion Sigil
Loyalty Sigil
Each corresponds to a different character. You are allowed to spend these items to boost one of their stats. (Note: In order to prevent players from getting stuck with a mistake if you go to a local church you can refund them and reset your stats.)
The script does let you use an item in place of AP, but only one item for everyone. Either I need to expand the parameters of the script someone or find another way.
I thought of using this Tips & Tricks for Stat Upgrades but replacing JP with the item. It seems to work (I fixed an issue where it wouldn't let you learn it multiple times). SO if I go with this tactic I just need a way to keep track of how many Sigil's you've used.
Here is the skill tag:
<Learn Cost Eval>
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Increase the parameter by this amount.
user._paramPlus[id] += 5;
// Make the user forget the skill.
user.forgetSkill(skill.id);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
<Learn Cost>
Item 5: 10
</Learn Cost>
<Custom Cost Display>
\}Passive\{
</Custom Cost Display>
<Hide in Battle>Obviously I need to store a variable for how often you've done this. I can't remember how to do it though.
Edit: Ignore that Learn Cost, that's just for test reasons. It only costs 1 sigil to boost a stat)
Why? You say lower down that every upgrade only costs 1 Sigil, so why track how many you've used? Is there a limit to how many times a user can upgrade, but there's somehow an unlimited number of Sigils you can obtain?
You just make it. For example,
user.sigilsUsedSo if you're not trying to do all of this by using an item, which is how I understood your first few posts, it seems to me this should be pretty simple. You'd make a version of the stat-boosting skill for each actor, then in that skill have notetags from the skill learn system with Learn Show Eval for that specific actor's name/ID/whatever, then Learn Cost for the item that's specifically used by that actor.
This approach, learning a skill to get stats, is not what any of us presumed you were doing, I think, from your original post. It sounded like you were going into the items menu and Using an item on an actor to grant them AP via the Stat Allocation plugin.
OH, originally this was about the plugin. As established. The plugin let's you boosts stats using items, but I wanted to use a different item for each character which it doesn't allow. The skill thing is my work around. I realize I didn't make myself clear which is why I cleared it up now.
I'm not sure I understand. If you reset your stats you get back the Sigil's you already used. I need a way to keep track of how many Sigil's you've used.
I missed the sentence in your post where you said you can reset your stats and get refunded.
So just make a variable like I showed you. Yanfly also does this in a ton of the Tip & Tricks.
Code:
<Learn Cost Eval>
// Increment how many Sigils the user has spent (or create it if this is the first)
user.usedSigils=user.usedSigils ? user.usedSigils+1 : 1;
// Set the param ID of the stat you wish to adjust.
var id = 0;
// Increase the parameter by this amount.
user._paramPlus[id] += 5;
// Make the user forget the skill.
user.forgetSkill(skill.id);
// Refresh the user.
user.refresh();
</Learn Cost Eval>
Then in your reset event you can do Control Variable -> Script ->
$gameActors.actor(1).usedSigilsand you have how many sigils actor 1 used. Then give the party that many Sigils of Bewilderment, or whatever actor 1 uses. And so on for each actor.
I wish I knew more about this stuff so I wouldn't have to keep asking questions like this...
I have one more important question: How do I reset ".usedSigils" for a character and such? because as it stands that number doesn't reset so the more you reset the more you get back which would break the game big time.
The same way I just showed you. After you use Control Variable to store the value, you use the regular Script event command and say
$gameActors.actor(1).usedSigils=0 where, again, the 1 is whatever actor ID you're dealing with at the moment.Oh right, that makes sense. I was just a touch confused.
Original thread: https://forums.rpgmakerweb.com/threads/different-items-for-each-character-in-yanflys-stat-allocation.146437/