Hello! I'm hoping that I have a bit of a simple request here.
I'm trying to make use of Alistair's stat distribution (free!) plugin to handle a form of manual level ups in my game. https://alistairengine.wordpress.com/2020/11/21/mz-ap-stat-distribution/
The issue is that I need to be able to make the ability points = a variable that I have set up. I was hoping to have a similar function to a souls game where instead of getting a game over, the player will temporarily lose their upgrade points and have to retrieve them or risk losing them permanently. Now I have all of that evented out just fine (in theory) but there are no plugin commands to CHECK a characters current AP. And if I can't check AP I can't store it in a variable that is required for the death AP to function. So while I can set AP to 0 or increase it based on a variable, I can't first store AP as a variable to then give it back to them later. At least not with the built in commands as far as I can understand them.
Obviously AP has to be stored somewhere since the game remembers how many points you have if you exit the menu, but I'm not sure where I'd find that in the actual javascript document nor how I would run a script that can call that information upon defat to then be stored in a variable. Any help would be much appreciated! I've had a lot of trouble finding many MZ stat distribution plugins as well so if there's one I missed that has this kind of functionality feel free to point me toward that as well. Thanks for your time!
EDIT/SOLUTION:
I will provide all of the finalized code here should anyone like to have a similar system in their own game. Alistairs AP Stat Distribution is a great base for a souls style leveling system. If you want a system where the player can die, lose all of their souls and then later retrieve them, you can do just that, but you'll have to use some scripting and a couple of variables to do so.
To start you should ignore most of the actual plugin commands as you won't be using many of them. Instead make 2 variables. For examples Souls and Death Souls. Souls will track your current Souls. So kill an enemy, they add to the variable. When you die simply make Death Souls = Souls, and set Souls to 0. Then when you retrieve your Death Souls you add Death Souls to Souls and set Death Souls to 0.
Where does the AP come in? At your bonfire you need to run a few events. First use a plugin command to subtract your AP by the maximum value you set in the plugin parameters. This will ensure that your AP to spend will always equal your current Souls. Then run this script to add your Souls value to your AP
Your event should then call the stat distribution scene, allowing the players to level up their stats by spending their points. However once this is done we need to do the inverse code and change Souls to reflect our remaining AP. Just add this script under the distribution scene call.
And that's all it takes really. Now you can have less game overs will still giving your player plenty of reason to avoid losing in battle!
I'm trying to make use of Alistair's stat distribution (free!) plugin to handle a form of manual level ups in my game. https://alistairengine.wordpress.com/2020/11/21/mz-ap-stat-distribution/
The issue is that I need to be able to make the ability points = a variable that I have set up. I was hoping to have a similar function to a souls game where instead of getting a game over, the player will temporarily lose their upgrade points and have to retrieve them or risk losing them permanently. Now I have all of that evented out just fine (in theory) but there are no plugin commands to CHECK a characters current AP. And if I can't check AP I can't store it in a variable that is required for the death AP to function. So while I can set AP to 0 or increase it based on a variable, I can't first store AP as a variable to then give it back to them later. At least not with the built in commands as far as I can understand them.
Obviously AP has to be stored somewhere since the game remembers how many points you have if you exit the menu, but I'm not sure where I'd find that in the actual javascript document nor how I would run a script that can call that information upon defat to then be stored in a variable. Any help would be much appreciated! I've had a lot of trouble finding many MZ stat distribution plugins as well so if there's one I missed that has this kind of functionality feel free to point me toward that as well. Thanks for your time!
EDIT/SOLUTION:
I will provide all of the finalized code here should anyone like to have a similar system in their own game. Alistairs AP Stat Distribution is a great base for a souls style leveling system. If you want a system where the player can die, lose all of their souls and then later retrieve them, you can do just that, but you'll have to use some scripting and a couple of variables to do so.
To start you should ignore most of the actual plugin commands as you won't be using many of them. Instead make 2 variables. For examples Souls and Death Souls. Souls will track your current Souls. So kill an enemy, they add to the variable. When you die simply make Death Souls = Souls, and set Souls to 0. Then when you retrieve your Death Souls you add Death Souls to Souls and set Death Souls to 0.
Where does the AP come in? At your bonfire you need to run a few events. First use a plugin command to subtract your AP by the maximum value you set in the plugin parameters. This will ensure that your AP to spend will always equal your current Souls. Then run this script to add your Souls value to your AP
$gameActors.actor(ID).addDistributionPoints($gameVariables.value(x));Your event should then call the stat distribution scene, allowing the players to level up their stats by spending their points. However once this is done we need to do the inverse code and change Souls to reflect our remaining AP. Just add this script under the distribution scene call.
$gameVariables.setValue(x, $gameActors.actor(ID)._distributionPoints);And that's all it takes really. Now you can have less game overs will still giving your player plenty of reason to avoid losing in battle!