MZ I want to use VisuStella's Skill Learn AP as Shop Currency

Hi everyone! Seems like I posted this question in the wrong forum the first time. I think that I'll pretty much copy/paste what I wrote down to make it easier.
I'm using VisuStella's Skill Learn plugin for MZ. I basically understand how to use it, but I have an issue with the AP, CP, and JP distributions. I'm tempted to have my characters learn their skills thru items/equipment/gold instead, but we'll see.
The problem I have with AP is that eventually, every skill will be purchased, yet the player will still be earning useless points. I don't have a plugin for extra currencies. I haven't found a way to transform AP into another use like a special shop so that the player can use them for other purposes besides skills. If this is possible, would you know how to do it?

I think this is how you link the plugin? https://visustellamz.itch.io/skill-learn-system
the important question is: can you as the developer change the AP available?

if yes you can simply read out the current available number into a variable, store the current gold in a different variable and exchange them before and after a shop processing.

if you cannot manually remove or add AP, then you can't handle that.
And Visustella's plugins can't be modified due to obfuscation, so if there is no official function for that you're out of luck.
the important question is: can you as the developer change the AP available?

if yes you can simply read out the current available number into a variable, store the current gold in a different variable and exchange them before and after a shop processing.

if you cannot manually remove or add AP, then you can't handle that.
And Visustella's plugins can't be modified due to obfuscation, so if there is no official function for that you're out of luck.
I can change how much the characters can earn/start with, but the AP isn't available as an actual separate variable for me to modify. Or if it is, I certainly can't figure out how to add AP to the variable list.
I don't own that plugin, so I can't check its description if you missed something. my guess 50/50 as such fnctions would have their use, but could also be abused and break the plugin.

but if there is no way to influence the value, then the only way to get what you want is for the Visustella team to write a plugin that does that.
I don't own that plugin, so I can't check its description if you missed something. my guess 50/50 as such fnctions would have their use, but could also be abused and break the plugin.

but if there is no way to influence the value, then the only way to get what you want is for the Visustella team to write a plugin that does that.
Yeah, I was kind of worried about that. If it was a variable, it would be easy to do whatever I wanted with it. But since it can't be used that way (unless it's in the plugin itself), then it's a no-go. I was hoping someone would be able to find a workaround, but you had the same thought.
***edit*** I had never used this plugin before and I spoke too soon. Now that I've taken a second to look a bit deeper into the plugin, I've amended my post.

You can save ability points into a variable. In a Control Variables event command, click on Script, and put this in the box:
JavaScript:
$gameActors.actor(actorId).getAbilityPoints()
But instead of actorId, put the actual numerical ID of the actor. So supposing I want to get actor 4's ability points, the script would look like this:
JavaScript:
$gameActors.actor(4).getAbilityPoints()
Oh, wow!!! Thank you! I'm no good with script, so I wouldn't have thought about this. This is the first game I have ever made, so I'm still learning. This should help out a lot. Thank you! I'll give this a shot later today when I get the chance!
Oh, wow!!! Thank you! I'm no good with script, so I wouldn't have thought about this. This is the first game I have ever made, so I'm still learning. This should help out a lot. Thank you! I'll give this a shot later today when I get the chance!
No problem. I think I was wrong about the AP sharing across classes thing. Sorry, I didn't/don't have time to read up on exactly how that plugin works. I'll just assume that you know what that setting is all about, and can adjust accordingly.
Here's another possible use for your extra AP. The actual code you use would be different, but the concept might help you.

No problem. I think I was wrong about the AP sharing across classes thing. Sorry, I didn't/don't have time to read up on exactly how that plugin works. I'll just assume that you know what that setting is all about, and can adjust accordingly.
Hmm... Looks like that I may be able to have AP spent in other ways, but as far as for items/equipment, I can't get past the default shop option. Here's a real quick code I put together. I know that I need another variable in order to prevent infinite AP from being spent. I tried the same thing with gold, and I could even buy with 0. I just haven't figured that out, yet. Which is kind of funny, really. This isn't my first variable. Thanks for all the help so far, though!!
◆Text:Cute Shopkeeper, Actor3(5), Window, Bottom
:Text:Use AP to buy?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
◆Change EXP:{AP}, - 100
◆Change EXP:Adimus, + 100 (Show Level Up)
◆
:When No
◆Text:None, None, Window, Bottom
:Text:ok
◆Text:None, Actor3(5), Window, Bottom
:Text:
◆
:End

And AP is set under a Common Event as ◆Control Variables:#0010 AP = $gameActors.actor(16).getAbilityPoints()
It's letting you buy at 0 because it just subtracts 100 AP from your total.
What you need is a conditional branch to check how much AP you have.
That way if you have less AP than the required cost, it fails and does nothing.

So for Show Choices Yes/No.
For Yes insert a Conditional Branch that checks the variable where you stored the AP value.
If AP >= 100
then -100 AP and +100 EXP

or however you have it setup.
I don't really understand what you're trying to do here. When you're talking about buying things from a shop, why do you have Change Experience commands in there?
◆Change EXP:{AP}, - 100
This will take 100 experience away from the Actor ID of the value of Actor 16's AP. So if Actor 16 has 312 AP, it's going to try to take 100 experience away from Actor 312. I don't see what the point of this is.
◆Change EXP:Adimus, + 100 (Show Level Up)
This is more straightforward, you're giving Adimus 100 experience. I still don't see what this has to do with a shop, but it's there.
And AP is set under a Common Event as ◆Control Variables:#0010 AP = $gameActors.actor(16).getAbilityPoints()
It almost certainly should be set at the beginning of this event. Otherwise, you don't know that you're necessarily working with the current value.

If you're trying to make a shop, I don't really see what this event has to do with it. You're not converting AP to gold, you're not using a plugin that allows you to use the AP as a currency, you're not using Show Choices to ask them to select items to buy...you mention needing another variable, but I don't know why.

If you can clarify a bit more what you're trying to do, we might be able to help. It seems like VisuStella's More Currencies plugin does exactly what you're describing...in the event to interact with your shopkeeper you'd put your AP into a variable, then you define that variable as a currency in the plugin, and at the end after the shopping you do the reverse and update AP according to that variable.
I don't really understand what you're trying to do here. When you're talking about buying things from a shop, why do you have Change Experience commands in there?

This will take 100 experience away from the Actor ID of the value of Actor 16's AP. So if Actor 16 has 312 AP, it's going to try to take 100 experience away from Actor 312. I don't see what the point of this is.

This is more straightforward, you're giving Adimus 100 experience. I still don't see what this has to do with a shop, but it's there.

It almost certainly should be set at the beginning of this event. Otherwise, you don't know that you're necessarily working with the current value.

If you're trying to make a shop, I don't really see what this event has to do with it. You're not converting AP to gold, you're not using a plugin that allows you to use the AP as a currency, you're not using Show Choices to ask them to select items to buy...you mention needing another variable, but I don't know why.

If you can clarify a bit more what you're trying to do, we might be able to help. It seems like VisuStella's More Currencies plugin does exactly what you're describing...in the event to interact with your shopkeeper you'd put your AP into a variable, then you define that variable as a currency in the plugin, and at the end after the shopping you do the reverse and update AP according to that variable.
Yeah, I am sorry. I don't think that I was too clear. The shop only let me use gold and since this is my first time ever using RPG Maker, I am still learning it. I thought, well... I can't spend AP for items, let's try to use it in the same way, but for something different.

I knew that I needed a conditional branch because I used them before. I was just stuck on that part. But yeah, I didn't mention that. I must not be thinking straight because I didn't consider changing AP into my world's currency. That might fix my whole problem, honestly. Have the AP changed to the currency and then the player can buy whatever.
I knew that I needed a conditional branch because I used them before. I was just stuck on that part. ...I didn't consider changing AP into my world's currency.
That's pretty straightforward.
Show Message: want to convert AP?
Show Choices: Yes, No
Choice Yes:
- Conditional Branch -> AP < 100
-- Show Message: You can't afford it!
- Else
-- Plugin Command or Script call or whatever to subtract 100 AP
-- Change Gold +100 (or whatever you want the exchange rate to be)

Or if you want it to look slicker, you can use the VisuStella plugin I mentioned and it will simply integrate with shops and show it as a currency.
That's pretty straightforward.
Show Message: want to convert AP?
Show Choices: Yes, No
Choice Yes:
- Conditional Branch -> AP < 100
-- Show Message: You can't afford it!
- Else
-- Plugin Command or Script call or whatever to subtract 100 AP
-- Change Gold +100 (or whatever you want the exchange rate to be)

Or if you want it to look slicker, you can use the VisuStella plugin I mentioned and it will simply integrate with shops and show it as a currency.
Oh, I see! The convert is the same as the gold. So the branch I'd use for a "can't do it" would be if they didn't have the funds. That makes a lot of sense. And I have been tempted to get the extra currency plugins. Problem is, I bought the 8 wave bundle not too long ago, and that set me back some. As well as all the resources I get on Steam. So I would rather not buy anything for at least a little while. This should work, though!

Thank you! I'll test it out right now!
Oh, I see! The convert is the same as the gold.
I mean...if you want it to be? O__o I'm actually not sure what you mean by that.
So the branch I'd use for a "can't do it" would be if they didn't have the funds.
Yes. Logically, someone can't give you 100 AP for something if they don't own 100 AP.
I mean...if you want it to be? O__o I'm actually not sure what you mean by that.

Yes. Logically, someone can't give you 100 AP for something if they don't own 100 AP.
Okay, the Skill Learn System is working and I got the "You can't learn this" branch working. I think the problem may be with my AP variable because I gave myself 1000 starting AP, checked, had it, and I still didn't get the 100 exchange.

I'm almost there, though! I can feel it.


◆Text:Converter, Actor3(5), Window, Bottom
:Text:Would you like to convert your AP to Ryas?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
◆Show Choices:100, 1000, 10000, 100000, 10000000 (Window, Right, #1, #2)
:When 100
◆If:AP < 100
◆Text:Converter, Actor3(5), Window, Bottom
:Text:You haven't earned enough AP to do that yet.
◆
:Else
◆Control Variables:#0010 AP -= 100
◆Change Gold:+ 100
◆
:End
◆
:When 1000
◆If:AP < 1000
◆Text:Converter, Actor3(5), Window, Bottom
:Text:You haven't earned enough AP to do that yet.
◆
:Else
◆Control Variables:#0010 AP -= 1000
◆Change Gold:+ 1000
◆
:End
◆
:When 10000
◆If:AP < 10000
◆Text:Converter, Actor3(5), Window, Bottom
:Text:You haven't earned enough AP to do that yet.
◆
:Else
◆Control Variables:#0010 AP -= 10000
◆Change Gold:+ 10000
◆
:End
◆
:When 100000
◆If:AP < 100000
◆Text:Converter, Actor3(5), Window, Bottom
:Text:You haven't earned enough AP to do that yet.
◆
:Else
◆Control Variables:#0010 AP -= 100000
◆Change Gold:+ 100000
◆
:End
◆
:When 10000000
◆If:AP < 1000000
◆Text:Converter, Actor3(5), Window, Bottom
:Text:You haven't earned enough AP to do that yet.
◆
:Else
◆Control Variables:#0010 AP -= 1000000
◆Change Gold:+ 1000000
◆
:End
◆
:End
◆
:When No
◆Text:Converter, Actor3(5), Window, Bottom
:Text:Take care, then.
◆
:End
I don't see you actually change the AP anywhere. You're changing the variable that you set to the same value as their AP, but you aren't using any plugin command or script call (like I said in my last post) that actually changes the AP.

For that matter, if you're not using it for something like the shop currency plugin, there's really no reason to be setting a variable to the AP in the first place.

Do you understand that setting a variable doesn't have any affect on the first number? It's like making a copy of a file, anything you edit in the copied version doesn't do anything to your original file.
I don't see you actually change the AP anywhere. You're changing the variable that you set to the same value as their AP, but you aren't using any plugin command or script call (like I said in my last post) that actually changes the AP.

For that matter, if you're not using it for something like the shop currency plugin, there's really no reason to be setting a variable to the AP in the first place.

Do you understand that setting a variable doesn't have any affect on the first number? It's like making a copy of a file, anything you edit in the copied version doesn't do anything to your original file.
Here we go! Yeah, that was my mistake. I got it working. The AP variable was preventing anything from converting. Here's how it is working, and I can tweak the text/options to make it better. But I got the basic skeleton down and it worked. I started with 1000, it took 100 to leave me with 900 AP, and gave me 100 gold.

I somehow thought that controlling the variable would be the same thing as a plugin command. And this is kinda funny because if I knew it would be this simple, I wouldn't have worried about it. It was there all along! But, yeah. This thread was still a major help!

◆Text:None, None, Window, Bottom
:Text:Convert?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
◆Plugin Command:VisuMZ_2_SkillLearnSystem, Ability Points: Lose
:Plugin Command:Actor ID(s) = ["16"]
:Plugin Command:Class ID(s) = ["0"]
:Plugin Command:Ability Points = 100
◆Change Gold:+ 100
◆
:When No
◆Text:None, None, Window, Bottom
:Text:ok
◆
:End
I got it working perfectly, now. Changed a few things up. Now it won't give me infinite money and it will stop when I run out. This is exactly what I needed. I'll also be able to fix this up for special shops with items/equipment, too! Now that I know all I need to do is use the Plugin Command, I'll only have to change items each time.

◆Control Variables:#0010 AP = $gameActors.actor(16).getAbilityPoints()
◆Text:None, None, Window, Bottom
:Text:Convert?
◆Show Choices:Yes, No (Window, Right, #1, #2)
:When Yes
◆If:AP < 100
◆Text:None, None, Window, Bottom
:Text:No go.
◆
:Else
◆Plugin Command:VisuMZ_2_SkillLearnSystem, Ability Points: Lose
:Plugin Command:Actor ID(s) = ["16"]
:Plugin Command:Class ID(s) = ["0"]
:Plugin Command:Ability Points = 100
◆Change Gold:+ 100
◆
:End
◆
:When No
◆Text:None, None, Window, Bottom
:Text:ok
◆
:End

Original thread: https://forums.rpgmakerweb.com/threads/i-want-to-use-visustellas-skill-learn-ap-as-shop-currency.148753/