Crystal Engine – Extra Stats

Extra Stats

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

Notetag Effect
<state_xstat: stat x%> Sets the specified stat to be multiplied by x%

Actor/Class/Enemy Notetags

Notetag Effect
<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

Notetag Effect
<xstat growth: stat x> Changes the specified stat by x

Weapon/Armor Notetags

Notetag Effect
<weapon_xstat: stat +x> Sets the specified stat to be modified by x. Can be negative.

Script Calls

Script Call Effect
change_xstat(actor_id, stat, value) Alter the specified stat by the specifed value. Can be either positive or negative.

Script Download

Download the Latest Version

Categories: Scripts | 81 Comments

Post navigation

81 thoughts on “Crystal Engine – Extra Stats

  1. Mitchell aka Audrey

    Will you marry me?

  2. Jacob

    is there a way to use this with yanfly extra param formulas?

  3. Jacob

    what is the specific syntax i should use, this i what i tried and it didnt work.
    hit_n_value = (atk + xstat.(per)) / 2

  4. Megablackdragon31

    Sorry to bother you Crystal Noel,i put 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.

  5. Megablackdragon31

    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.

    Please take your time,i hate to bother people… I will try to learn scripting in the future…

  6. Eschaton

    I’m not sure if it’s possible with this script, or if a modification can be added, but….

    Can an addition be made to this script that allows the user to write formulae that determine MaxHP and MaxMP?

  7. FenixTargaryen

    Nice script, better than N.A.S.T.Y extra stats n_n Keep working!

  8. Jacob

    when i make more than s new stats, the last three are cutoff at the bottom of the screen.

  9. Jacob

    and i get an error because i might have to many stats.
    the error say ‘comparison of fixnum with nil failed.’

  10. Jacob

    I’m using a script that uses several windows for displaying actor status, how do i render different stats to multiple windows?

  11. Jacob

    i’m trying to set up the first 6 in a window but how i differentiate between the first 6 and the other 12?

    heres what i got for the first 6
    6.times {|i| draw_xstat_parameters( 0, 120 + line_height * i, i + 2) }

    it seems default parameters are called differently than xstats in Game_BattlerBase

  12. Jacob

    how do i render 18 extra stats to a both windows?
    i have 6 stats rendered under the default and i’m trying to add the other 12 to the second window.

    • I would assume using an algorithm that offsets the first stat displayed in the window so the next window picks up where the last one left off.

      • Amir Clayton

        Will I be able to create a class similar to the Onion Knight class from FF3? My class like that is called Spiral Knight. Their stats start off relatively low, but once they reach level 80, their stats begin to rise dramatically!

  13. Jacob

    this is the line im trying to use to render stats to the second window
    12.times {|i| draw_xstat_parameters(@actor, 0, 0 + line_height * i, i + 2) }

    • So when you draw it you add the number of stats in the first window to I. That should work, what does it look like in that line!

  14. xDrahcir

    is there a way to have them show up in the Parameters section of Yanfly’s Status Menu? I’ve been looking over it constantly and i can figure it out

    • xDrahcir

      Ah, I meant the General section. I wanted to replace ATK, DEF, MAT, and MDF since they will be determined by weapons, and have the new stats be shown there instead

  15. Jacob

    i cant render stats to the second window in my script at all.

  16. Hey, Crystal.
    Quick Q.
    I know that in order to use formulas for skills that you have to use xstat.x, but I have stats like.
    STR,VIT,INT,MND…
    Damage dealt is calculated like this: a.atk * 4 + a.xstat.str – b.def + b.xstat.vit.
    However, every time I do that, I get a value of zero damage.
    If I try only: a.xstat.str or xstat.str, it gives me that value of damage to the foe.
    But if I try: b.xstat.str, it still remains 0, I tried changing their stat formulas around, and put their stats in their enemy notebox, but still nothing. So, any help would be greatly appreciated. Thanks.

    • The formula is spitting out a 0 or lower causing no damage. Check the STR, VIT, ATK, and DEF stats of the battlers. Put the numbers into a calculator and see what you get.

      • Heh, thanks.
        I figured it out, It wasn’t that I was setting up the formula the wrong way, but I guess it’s in the order of where I placed the script.
        (I have some Victor Scripts, and the Yanfly limit adjustment thing.)
        Thank you so much, though.

  17. Jacob

    can you add a function that allows you to set where the stats cutoff into a new column

  18. i trying to make my own stat (DEX) and (AGL)
    DEX- hit rate
    AGL- evasion rate

    is there any way to link the hit rate and evasion rate to DEX and AGL?

  19. @bone dragon 788

    Thanks you very much! I love this script,just a little question… It is posible to make it compatible with Theo Display Parameter Changes? It is workin perfectly,but the xstat changes are not showing. Gracias nuevamente y perdoname si estoy molestando… No es obligacion hacer lo que te estoy pidiendo,pero si lo haces te estare agradecido de por vida. Disculpame por mi mal Ingles,soy Chileno.
    http://theolized.blogspot.com.ar/2013/11/theo-display-parameter-change.html

  20. Jacob

    i have no idea how to split the xstats into two rows

    • Jacob

      the problem is im trying to add a second draw_actor_xstats, and i’m trying to set it at which number it starts at.

  21. every time anyone attacks (that includes enemy), every body could evade the attack…
    how do i fix this?

    i used your link that leads to yanfly
    http://yanflychannel.wordpress.com/rmvxa/core-scripts/extra-param-formulas/

    but i need help

  22. Don Tuel

    I’ve been trying to get the change_xstat to work. I’ve added it to an event and it does nothing.
    Here’s the script call:
    change_xstat(1, :str, 1)

    The STR stat remains at 23.

    Any ideas on why it’s not working?

    • Don Tuel

      Never mind. I figured it out. Stupid newbee mistake. I needed to get the id of the appropriate party member.

      The script now reads:
      temp = $game_party.members[0].id
      change_xstat(temp, :str, 1)

      Thanks,
      Don Tuel

  23. cookie52

    How do you put these stats into skills? Like 10+spi*2-b.mdf*2 or what?

  24. Piers

    I want to know, I want to put a stat like HIT but with magical attacks? is there a way to make this with this script? how? and… Why I can’t see it? D: Thanks if you can solve that

  25. Jacob

    could you take a look at my status window script and help me split the stats between the stat windows?
    http://www.mediafire.com/download/pwcs4p29529kvq5/customwindow.rar

  26. Nathan

    How could I assign an actors xstat to a variable or use it in a conditional branch? I have tried $game_actors[1].xstat.acr where acr is my xstat and it always crashes.

    • Nathan

      I take that back haha, sorry. It was a common event I was overlooking causing issues. Your script works great! Thanks a ton

  27. Jan

    I want help,
    my stat is called effectivity.

    I just want a WORKING example of this

    stat => formula,

    I
    I do not understand how I shuld write the formula for my actor.

  28. lanceXstorm5

    Hello, I’m having a problem with the script. I was just playing around with it when I discovered a potential problem. I have not seen another person report on this so I thought it might be a good idea if I did.

    What I’ve been trying to do in my game is include way to calculate damage and damage resistance, similar to that of the FFRPG table top rules. Basically, I’m using my custom xstat.arm (i.e. armor) to add on the total def points from the armor being worn and then add a formula with that to get a final armor value.

    The problem is that it won’t recognize the ‘def’ value in the formula below and it bugs out on me.

    :arm => ‘def + ((level * 70) / 128)’,

    Strangely if I did this…

    :arm => ‘atk + ((level * 70) / 128)’,

    … or this…

    :arm => ‘mdf + ((level * 70) / 128)’,

    … or any of the other main parameters, it accepts their values and works normally. I don’t know if this is a bug or if it’s conflicting with rpg maker vx ace program itself. I might even have just made a mistake somewhere, I don’t know. I do know that It’s not a problem caused by other custom scripts because I’m testing this script out on a testing project with no other custom scripts being used.

    When it bugs out, it also give me this message…

    Script ‘Crystal Engine’ line 314: SyntaxError occurred.

    unexpected ‘*’, expecting ‘)’
    def + ((level * 70) / 128)

    Some help on trying to fix this issue would be greatly appreciated. Thank you.

  29. Maliki79

    Hello.

    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.

  30. Hi Crystal Noel
    can you explain to me, what these new stats are doing? Do they affect something?
    If I don’t use the stats in the damage formula they are just numbers, right?

  31. rubydragon44

    Say, may I request the ability to add stat plus/minus modifiers to all objects, not just equipment?

  32. rubydragon44

    By what I mean is dynamic stats, like Spirit +12% (of base) or Strength +10. Especially do I like the +x% feature.
    Kind of like this script, only, this script also only allows such features to equipment instead of all objects http://yanflychannel.wordpress.com/rmvxa/gameplay-scripts/equip-dynamic-stats/

  33. Although I think there is something I’m not understanding with this script and enemy stats:

    My damage formula is: (database_param(2)) + (xstat.str / 4) <– that which the ) fixed the error

    However, while I can do damage fine, enemies cannot, even if I give them 99 STR, 16 hits and 500 ATK. It's NULLed out. So my guess is something is reading it as zero, but I do not know why. All my enemies have their own formulas in the noteboxes, but none of them can do any damage.

    It could be my Attack Skill formula: (a.xstat.pwr * a.xstat.hit) – b.def * 2 – b.xstat.sta

    with the enemies the PWR * HIT causing a x * 0 somewhere and reading 0 damage, but I have no idea.
    So:

    x = 3 (User's DEF)

    y = 4 (User's STA)

    z = 16 (Enemy's PWR) [Calculated from: (database_param(2)) + (xstat.str / 4)]

    The base ATK formula: (a.xstat.pwr * a.xstat.hit) – (b.def * 2) – b.xstat.sta

    (z * 1) – (x * 2) – y

    (16 * 1) = 16 – (3 * 2) = 10 – 4 = 6 +- 1.2 (<– 20% variance on damage.)

    So theoretically, it should do between 5-7 damage, but yet the enemy always does zero.

    With 500 ATK, 99 STR, and 16 HITS (The maximum possible in my game)

    PWR: 500 + 99/4 = 524.75 == 525

    (525 * 16) = 8400 – (3*2) = 8394 – 4 = 8390 +- 1678

    So theoretically, this should do between 6712 – 10068 damage, but even with these stats: when the enemy would attack a LV 1 character, it does zero damage.

    I don't understand it. I got to be getting a times 0 somewhere in one of the formulas.

  34. James O

    So I’m having an issue when I set my stats for the class they are being overrun by the DEFAULT_LEVEL_FORMULA given in the host script. Is there a way for me to make it so that this doesn’t happen? I want the stats to be based off of the actor’s class not the actor themselves. Thank you!

  35. spyderman

    Hi CrystalNoel, thanks for the wonderful script! I have a question regarding its usage though.

    When setting variables to xstat values for events, its quite easy for actor.xstats : I go for “control variables”, select the wanted variable and let it set by script with ” $game_actors[1].xstat.mystat “, for example.

    Can I do the same with enemy xstats? $game_enemy[1] and $data_enemies[1] return errors.

    Or do I have to create a new actor for every enemy, paste the xstats there and select the values then via $game_actors[31(orwhatever)].xstat.mystat ?

    Thanks for the help and continue your great work!

  36. I want to make a stat that shows on menu with 2 decimals, like 5.00

    can you help me? @_@

  37. Amir Clayton

    Is it possible to make some stats, such as hit count invisible, that means they exist, you just can’t see them in the menu!

  38. K

    Crystal, would you happen to know how to have the changes to different xstats show when equipping weapons and armor? I only have two additional parameters, which are Attack and Defense, and I have weapons and armor only affect those stats. I just need to have those changes show on the equipment menu.

  39. blackmdawn

    This script is exactly what I’m looking for, but I keep getting an error:
    [
    line 323: TypeError occurred.

    can’t convert nil into String
    ]

    All I’ve done is create 5 stats [:wgt,:pat,:mat,:pdf,:mdf], set each formula to zero, set each name to the capitalized version of each [ :wgt = “WGT” ], and changed the starting values of each according to player class.
    I’d greatly appreciate any help or suggestions.

  40. blackmdawn

    I was able to fix my earlier issue, but now I have a new one.

    I am creating a total of 10 extra stats, the first 6 of which I want to appear.
    I was hoping that the next 4 would be cut off, but they keep going down the screen.

    Is there a way to either:
    – show the last four in another column
    – not show the last four (but the player still has them)

  41. Stefan

    Hello Crystal,
    Is their a way to get access to the xstats an equipped item grants you via scriptcall?
    Something like
    $data_armors[armor_id].xstat[xstat_id]
    ?
    Greetings, Stefan

Leave a reply to otrizarri Cancel reply

Create a free website or blog at WordPress.com.