Crystal Engine - Extra Stats

extra-stats.png
Introduction
This script allows for you to have additional stats for your battler. Those are  viewable on the default status screen for your convinece. To use them in damage formulas use xstat.(stat abriviation).

Actor/Class/Weapon/Armor/State/Enemy Notetags
<state_xstat: stat x%> Sets the specified stat to be multiplied by x%

Actor/Class/Enemy Notetags
<xstat> 
stat => formula,
</xstat_end>
 Sets the xstat formulas up. Actor/Enemy formulas take precidence over the class formula. Be sure to put a collon on the stats. The formula can be any valid ruby exprssion that returns a number.
 
Skill/Item Notetags
<xstat growth: stat x> Changes the specified stat by x

Weapon/Armor Notetags
<weapon_xstat: stat x> Sets the specified stat to be modified by x
 
Script Calls
change_xstat(actor_id, stat, value) Alter the specified stat by the specifed  value. Can be either positive or negative.

Script Download
http://crystalnoel42.wordpress.com/2013/07/05/crystal-engine-extra-stats/
Whoa, looks, like, one of those scripts that I really always wanted! This...the new stats can do anything the default stats can do, right???

Well, that gets me thinking...is there any possibility this could also be used to make more "Points" stats, you know, HP/MP/TP? Or would that be a different kind of script? It's just...you can use HP/MP/TP in just about the same ways as normal stats, equipment can raise it, traits/features can alter it, and so on.

Also, what about "Growth" effects? Can you make items or whatever that "grow" extra stats?

This script already looks awesome, but, with those things too, that would be...whoa.
That is a different script. I have seen one before, but I can't seem to be able to find it anymore.

I just added the growth effect today. Re download the script for growth effects.
Alright then. I'll have to look for that then!

Thanks for adding the growth effects! I can definitely use this script in a few projects, one of which I'm currently working on!
Sorry to bother you Crystal Noel,i put <weapon_xstat: str 20> and it worked. It increased that stat by 20 points,but it is possible to make that number negative?

Excuse me for my bad English and thanks for this great script.
Yes, that is possible.
I tried different metods but nothing worked...

<weapon_xstat: str -12>

<weapon_xstat: str - 12>

<weapon_xstat: -str 12>

Could you explain how it should be?

Please...

PD: I finally understood how to use the formulas for skills,no bugs so far. I love this script.
Fixed. You now have to put a + in front of the number for gains now.
Thanks you very much! 😀

It works like a charm,good luck in your future projects.

EDIT:

Excuse me again Crystal Noel… I Found a little issue,for example if you have 50 of str and have a equipment that reduces that parameter by 60,it shows str-10.
http://s22.postimg.org/4rjyeelbl/Sin_t_tulo.png
Please take your time,i hate to bother people… I will try to learn scripting in the future…

Sin_t_tulo.png
nevermind found the fix. and yea this xstat is actually working right for me. my other one was not updating the stat if it was based off a base stat properly.

thank you for the script
Finally got around to testing this out in my project, awesome as expected.

But...two things.

One, is there anyway to have stat limits for the extra stats? Like, one of the stats can't go over 100? I tried adding STAT_MAX after the STAT_MIN section, but nothing happened, which is surprising, because at least I thought it would cause an error!

Two, buffs and debuffs? Anyway to have those for the extra stats?

Thanks again for the awesome script!
Hi Crystal, thanks for your script. I'm wondering if there is a way to access to the xstat with applied item bonuse from a script. I can access the base stat via $game_actors[id].xstat_plus[stat], but the item bonuses do not add. For exemple, I'd like my conditional branch to work if my SPI > 50 (including SPI inducing items) with a script condition. Sorry to bug you out, but I can't figure out how to do it, since I don't understand how to apply an actor ID to the "eval("actor.xstat.#{stat}")" command you use to draw the stats.
EDIT:  found the error, it was mine.  sorry!
Hey Crystal Engine Master. Love this script by the way. Though I was wondering.

When using xstats in damage formulas, how do I access the foe's extra stats. 

EX: a.xstat.str + a.atk - b.xstat.vit + b.def or

      actor.xstat.str * 2 + a.atk * 4 - enemy.xstat.vit + b.def * 2

Every time I keep trying to access the foe's xstats, damage returns to 0.

Any pointers would be a great help. 
Hi. This is almost what i'm, searching for, but i have couple issues: First. I want to use icons (maybe only the icons and no text) before parameter numbers. Is there way to add icons?

And second issue: It is possible to have more than 6 stats? I mean 7th stat goes atop of the  character's description box. I can't find option which shrinks the text size or create second row beside etc.
Great script, congratulations. Some games simply need more stats and now this is possible thanks to you 🙂
can you change what the stat does?
Hello.

I dropped this on your script page but got no response.

Thought I'd put it here and see if my request has better luck:

Two issues:

One: I’m trying to put a stat into a variable, but I keep getting errors.
I tried putting $game_actors[1].xstat.Burn_A into one, but it comes back with an fixnum to string error.
(Burn_A is the name of the stat)

Two: I’m using an instance script and adding upgrade to equips via note editing. However, the stats do not seems to be updating.
Do I need to reinitialize the stats somehow, or am I messing up somewhere?
I append the note with this call:
WEAPON_XSTAT: Burn_A +1 (plus the brackets)
Before adding it, the weapons have no stat related note tags at all.

I suspect it may work, but as I can’t seem to find the right syntax to apply, I won’t know.

As an aside, if I put xstat_plus[:Burn_A] in a formula, it seems to work, but I do not think it is correct.

Any help would be greatly appreciated.
I just started experimenting with this script.


Your first issue can be solved by using this:

eval("$game_actors[1].xstat.#{:str}")Replace ':str' with your xstat symbol (can be found at the 'STATS' settings in the script).
Replace the ID of your actor accordingly too.


Put this into a variable, or you can just use it directly in a conditional branch by using the 'Script' method there, like this:

eval("$game_actors[1].xstat.#{:str}") >= 50This returns true if the actor with the ID of 1 got at least 50 STR.
Edit:


Just tested another method and it works too:

$game_actors[1].xstat.strReplace 'str' from the end with your xstat's symbol.
But this will count in any bonus xstat too, from equipment and so.


No idea how to check for the base xstats without the bonuses.


"$game_actors[1].xstat_plus[:str]" always returns 0 for every actor and for every xstat for me. >.>


For the second question, I use this:

<WEAPON_XSTAT: STR +11>It works even on an instanced item for me.
Replace 'STR' with your xstat's name (can be found at the 'TERMS' settings in the script).


Edit2:


Nevermind the above crossed lines. I tested it further to make sure if it is the name or the symbol what is needed. It seems that it is the symbol without the colons.


So, use the symbol, not the name!
Thanks for the help.

I believe I found the issue I was having: I didn't input the stats correctly.

However after fixing that, I still had issues manually changing stats (which is a necessity for my game.) which was one of the reasons I was trying to put the value into a variable.

This script, while clearly very powerful, isn't user friendly enough for me to edit the way I need to.

I'll have to look for something else.

:-(

Original thread: https://forums.rpgmakerweb.com/threads/crystal-engine-extra-stats.15015/