[ADDON] AP - Ability Distribution

Spoiler
Ah, looks like that's not going to work. Whenever an enemy attacks, the game crashes. I can definitely pinpoint it down to the damage formula running the check for those abilities, but the enemies don't have those abilities, so it just crashes.


Any idea what I can do to try and resolve this?


I was thinking a workaround would involve attaching an invisible passive state to all enemies. I really would not mind doing this in order to get this to work. Something like using State 123, and the damage line running a check where if isAffected State 123, then just do the normal formula, but if the state isn't applied, do the formula with the ability check involved. I think that'd fix it, but I'm not sure what the code could be.


We discussed this as the code:


(base + plus) * rate + flat + user.abilityLevel("Tenacity") * 0.01


Is there any way, perhaps, we can put in a state check? I really do think that might fix it. It's a bit of a roundabout solution, but I think it'd be the easiest thing to do.


Something like if State 123 then (base + plus) * rate + flat else (base + plus) * rate + flat + user.abilityLevel("Tenacity") * 0.01


You get what I'm trying to say? This would make it so when an enemy attacks, because I'd have this state attached as a passive to all enemies, that it wouldn't run this ability check and thus not crash the program (ideally).



By the way, you can use the simple in-built solution:


//Damage Formulas
(a.isActor() ? ActorFormula : EnemyFormula)
//Param Formulas
(user.isActor() ? ActorFormula : EnemyFormula)


This solution evals "ActorFormula" code if the user (the one having their Params evaluated or casting the Skill, in other words "a" in damage formulas) is a Player Character/Actor, otherwise it evals "EnemyFormula", because the user is not an Actor. That way you can set-up entirely different formulas for Player Characters and Enemies


I use this setting up my BaseParam formulas for now:


(user.isActor() ? ((user.abilityLevel("Vitality") * 50) + plus) * paramRate * buffRate + flat : (base + plus) * paramRate * buffRate + flat)


It's just an example, since I'm still setting up my custom stats system.
Plugin Update:

The Ability Distribution Plugin now creates new columns if you have a lot of abilities at once! Theoretically the plugin can create unlimited columns but keep in mind that after a certain amount of columns the texts will start to overlap.



Link to the post on my blog.
Very nice plugin, Alistar. I'm wondering if I can increase an ability with a variable.


I tried this


$gameActors.actor(1).increaseAbilityLevel("Test", v[88]); and it did not work. Is it possible?
@HasdrubalBarca


You can't use the v[x] shortcut there.
This should work: $gameActors.actor(1).increaseAbilityLevel("Test", $gameVariables.value(88));
@Alistair

Spoiler
<Custom Class Parameters>
maxhp = 85 + (level * 20) + (user.abilityLevel(“Health”) * 5);
maxmp = 35 + ((level * 5) + 5);
atk = 5 + (this.level * 0.5);
def = 4 + (this.level * 0.5);
mat = 3 + (this.level * 0.25);
mdf = 4 + (this.level * 0.25);
agi = 5 + (this.level * 0.5);
luk = 5 + (this.level * 0.125);
exp = level * 10;
</Custom Class Parameters>



When I use this formula, i get this error...


Ability_Distribution_Error.png



I copied the example completely and still get that error.  This error appears before the title screen even appears.  The game doesn't crash, but the Param [MaxHP for this example] doesn't get calculated and is lowered to one.  I set up the script call for the "Health" Ability when the new game is selected, but even then the error just randomly appears throughout the game if you try to keep playing despite that.


I really think RMMV hates me since it seems like none of my plugins work anymore...  :stare:


Can you help out?
@firestalker


The quotation marks around the word Health are different from each other.


Right now it is:


“Health”


It should be:

Code:
"Health"
@AlistairThanks that worked.


EDIT: @Alistair How could I use this Plugin Command: < AddPoints x y > to make an item that give an actor points.  Something like: Item calls Common Event when used and the Common Event has this in it -


so that the target of the item get the points not just the actor assigned to the command.  Is there a way to do this?
@firestalker


Use this in the damage formula of the item:


b.addDistributionPoints(x); 0


Remember to replace x with the amount of points you want to add.
@Alistair That didn't work.  All it does is buzz at me.  Is there a certain way it's supposed to be set up?  This is my set-up for the item:

Spoiler
Item_Attribute.png
@firestalker


I think using the Gain TP Effect should make the item usable on a character. Just use 0 so that the character does not actually gain any TP.
@AlistairThat worked thanks.


@AlistairOkay...  one more thing.  I was wondering if you can add a script call to change the Growth of the Ability.


Something like:


$gameActors.actor(x).abilitySetGrowth("ability", value);


something like that?
Um, is it possible to use the parameters in the damage formulas?


I have my doubts about that because I wouldn't be able to use them in a battle test, since we have to set them up in-game.
@YoshifullYou can try using this:


a.abilityLevel("ability")


change "Ability" to the name of your ability [KEEP THE QUOTES].  This script call is supposed to return a number and should be able to be used in the damage formula for a a skill or item.  You can also set up a new map, call it TEST MAP, and just copy the events to it.  you start on that map and add a battle you should be able to get the basic idea if it'll work.  That's what I do whenever I have to check something out in game and don't want to go through everything again.


@AlistairI don't think the Level Up parameter of this plugin works.  I tried both false and true and nothing happens when an actor levels up.  Not a big deal, just fyi
@firestalker



I'll add that command with the next update.



Which parameter do you exactly refer to?
@AlistairThe parameter that says...


I have Victory Aftermath... but it doesn't seem to do anything.


Nevermind....  found the problem!  I had the Stat Distribution Plugin above the Victory Aftermath. 
Plugin Update:

Spoiler: Notes
The Ability Distribution plugin finally has its own seperate Distribution points!
You can choose to either keep sharing the Distribution points between both Distribution plugins (the way it has been until now) or you can use the new seperate points OR Yanfly's Job Points.
Awesome update Alistair thank you for doing this. Do you happen to know the syntax for checking if an actor has a certain ability level in a shop and graying out there name if they cannot equip something? I'm kind of stuck with this, I was using Yanfly Equip Requirements and it works mechanically but not visually. For instance I can use...

<Custom Equip Requirement Condition>
if (user.abilityLevel("Heavy Armor") > 0) {
condition = true;
} else {
condition = false;
};
</Custom Equip Requirement Condition>

...and it works but doesn't show that in the shop status and is a little buggy in shop. I was trying to see if there was a way to do it without that plugin by doing something like...

if (user.abilityLevel("Heavy Armor") > 0)
then can equip
else
then cannot equip

I just don't know the proper way to say the can equip/cannot equip part. I'm trying to see if it will work visually in shop this way instead of using Yanfly Equip Requirements. Big thanks if there is a way to do this.
@Knightmare

Hi,

do you use Yanfly's Shop Core plugin?
Everything seems to work 😕. I used the Notetag you posted and here in the shop it says Aldo can't equip this sword.
1.PNG

Did I misunderstand your question? Can you elaborate a bit?
Thanks for the reply. Allow me to elaborate more. Yes I'm using Yanfly Shop and played with it so much to try and get it to work right that I may just give up on it. I experimented using as few scripts as possible. I've been working on this issue for about a month. I got it to where I was just using your Stat and Ability Distribution, Yanfly Shop, Yanfly Equip Core and Yanfly Equip Requirements. Basically if I use this...

<Custom Equip Requirement Condition>
if (user.abilityLevel("Heavy Armor") > 0) {
condition = true;
} else {
condition = false;
};
</Custom Equip Requirement Condition>

It seems to only work for the first actor and completely ignores the other actors for some reason in shop (visually, it still works mechanically.) For instance let's say that all actors have Heavy Armor at 1 point which means they can all equip Basic Heavy Armor, it will only show that Actor 1 can equip it in shop and the other actors will be greyed out like they can't use it for some reason even if they all have the associated Armor Trait.

What I'm trying to do is have a classless type system and using your ability distribution so players can basically create their own character with a lot of customization. So I have only one class in database that have all Equip Traits by default but in order to actually equip the item then they will need to have enough points in the respective ability. For example in order to use a Basic Sword then the character will need at least 1 point in the Sword Ability. For some reason it ignores the other 3 actors visually.

Alternatively if everyone has all Equip Traits and Actor 1 has let's say Swords at 1, and Actor 2 has Spears at 1, Actor 3 has Bows at 1, and Actor 4 has Staves at 1 then for some reason it shows that Actor 1 can equip everything (but he shouldn't be able to because he only has a point in swords so theoretically they should all be greyed out EXCEPT the sword but it shows he can equip them all. It also greys out the other actors completely and shows they can't equip anything at all even though mechanically they can still equip what they have ability points in.

If I try to do it without traits and have them learned as a passive skill then it works better but will still show they can equip something even if they don't have enough ability points. I'm trying to get it where it only shows what can equipped if enough Ability Points are in the proper Ability. Hence why I was asking how to do it without Yanfly Equip Requirement dependability because if I take that plugin out then it works quite a bit better (but still not perfect.)

Sorry if it's long winded, I'm just trying to get the syntax for "can equip" and "cannot equip" to see if it works without Yanfly Equip Requirements, because I'm 90% sure that plugin is causing the visual issues. Thanks for your time Alistair, if you would rather not mess with it then if you know the proper syntax that I could use then that would be more than enough. To restate I'm trying to make an IF, ELSE statement that does this independently of using Yanfly Equip Requirement...

So like...

if (user.abilityLevel("Heavy Armor") > 0)
then can equip
else
then cannot equip

I just don't know the proper way to type out the bolded. I know I could theoretically do a bunch of passive states and a bunch of Weapon and Armor Types and Traits to get what I want to happen but I'm trying not to resort to that so there are no lag issues and it will take a very long time to do properly but I'm more worried about the lag that it will cause than anything else. I don't expect you to be able to fix this issue but if you know the syntax for the bolded then I can do the rest and if it doesn't work then well hey I might come up with another system. Thanks for your time, I appreciate it.
hmm id like to see the ability to create Symbols for new stats that would let us shorten what we have to type to access the new stats, and something akin to
Bobstah Custom Stats, also if you were to do such a thing maybe consider compatibly with JahwsUF's StatusMenuCore letting user view the stats outside of the distribution menu.

Original thread: https://forums.rpgmakerweb.com/threads/addon-ap-ability-distribution.65184/