Bobstah's Custom Stats 1.3.2

Discussion in 'JS Plugin Releases (RMMV)' started by Bobstah, Oct 31, 2015.

    Tags:
  1. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Updated 11/04/2015 12:41 PM ET

    Introduction

    Allows you to set custom number or percentage stats at the Actor, Class, and Enemy level. These stats can be increased and decreased by weapons, armor, states, and items by using the appropriate notetags. They can be accessed inside of damage formulas.

     

    If you use the default status window, these custom stats will not show up. If you desire this behavior, I recommend using JawsUF's StatusMenuCore plugin.

     

    The ability to increase and decrease custom stats automatically upon level up/down will be made available in a future update of my Level Up Bonuses plugin.

     

    Features

    • Set a stat to an actor, class, or enemy, and use that stat in damage formulas just like the standard stats!
    • If a class has a stat and an actor is a member of that class, the actor uses the class' value unless they have one of their own!
    • If a stat hasn't been set on a specific actor/class/enemy, it will default to 0 or if using a percentage stat, 100%.
    • Increase and decrease custom stats by equipping weapons and armor, applying states, and consuming items!
    • Use the Eval feature to make these stats even more dynamic!

    How to Use
    Add the plugin in your game and view the help information. It describes the notetags and all the crazy modifiers you can use. See the examples and neat examples section for more information.

    Notetags

    Actor/Enemy/Class

    <CustomStat: statName=statValue>

    statName - The name you want to reference this stat with.

    statValue - The default value of your stat. Must be a number.

    Options - You can append a percent sign (%) to the end of statValue to have it calculated as a percentage (statValue * 0.01)

     

    Weapon/Armor/State/Item

    <CustomStat: statName+statValue>

    <CustomStat: statName-statValue>

     

    You can also eval the statValue by surrounding your code with $():

    <CustomStat: statName=$(yourCode() ;)

    <CustomStat: statName+$(yourCode() ;)

    <CustomStat: statName-$(yourCode() ;)

     

    You can combine percentage stats and eval, too:

    <CustomStat: statName+$(a.level;)%>

     

    For more information on eval, check the plugin's help documentation.

    Examples

    After setting a custom stat to an actor/enemy, you reference it in damage formulas or other code just like any other stat. Below is a sample damage formula for the a stat named 'sanity':

    100 + a.sanity

     

    Let's say you gave the enemy a stat named 'insanity':

    (100 + a.sanity) - b.insanity

     

    If that stat were a percentage instead of a normal number, you would use it like this:

    (100 * a.sanity) - b.insanity

     

    To have a shield give +10 sanity, use the following notetag on the sword:

    <CustomStat: sanity+10>

     

    To have a state remove 6 sanity, use the following notetag on the state:

    <CustomStat: sanity-6>

     

    To have an item give a permanent boost of 6 to sanity, use this notetag:

    <CustomStat: sanity+6>


    Plugin
    Get it here - File name is CASE SENSITIVE: BOB_CustomStats.js

    Dependencies
    None

    FAQ

    1. How do I use this plugin?

    Read the plugin help and ask any questions here.

    Changelog

    1.3.2 (11/04/2015) - Fixed a major bug that could cause issues when attempting to load a saved game.

    1.3.1 (11/02/2015) - Fixed a major bug that was causing actor-based custom stats to not be evaluated properly upon actor initialization.

    1.3 (11/02/2015) - Added percentage-based stats and the ability to eval a statValue. Read the plugin help for more information.

    1.2.3 (11/02/2015) - Fixed a bug where the built-in help documentation wasn't showing up properly in the plugin manager.

    1.2.2 (11/02/2015) - Fixed a crash bug that was caused by the main custom stat list being undefined. This does not fix the issue of it being undefined under certain circumstances. It will log a warning to the console if encountered.

    1.2.1 (10/31/2015) - Fixed a bug where a custom stat could return garbage (NaN) if the actor had a class that did not have the stat defined.

    1.2 (10/31/2015) - Added addition and subtraction notetags to weapons, armor, and states.

    1.1.2 (10/30/2015) - Fixed a bug where enemy stats wouldn't factor into damage formulas properly.

    1.1.1 (10/30/2015) - Fixed a bug where stats wouldn't save with a save game.

    1.0 (10/30/2015) - Initial release.

    Legal

    Free to use in commercial and non-commercial projects with credit. A free copy of the finished game would be nice, but is not required.

    Credit and Thanks
    - Bobstah 
     
    Last edited by a moderator: Nov 5, 2015
    #1
  2. Silent Darkness

    Silent Darkness Robomage Veteran

    Messages:
    2,284
    Likes Received:
    321
    Location:
    Dark Realms
    First Language:
    English
    Very nice....
     
    #2
    Bobstah likes this.
  3. Joronjo

    Joronjo Veteran Veteran

    Messages:
    155
    Likes Received:
    29
    First Language:
    English Spanish
    This could work to set enemy levels until an enemy class script comes along!
     
    #3
    Bobstah likes this.
  4. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Thanks!

    Sure can! I'm working on some enhancements for this now to let you adjust the parameters with plugin commands, then I'll add some adjustment abilities into my level up bonuses script so that you can cause these custom variables to increase upon leveling up.
     
    #4
  5. Joronjo

    Joronjo Veteran Veteran

    Messages:
    155
    Likes Received:
    29
    First Language:
    English Spanish
    Is it possible to set these stats on a curve or make a formula for them (as in, make "anger" dependent on attack * level)
     
    #5
  6. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    It's something I have planned. Right now it's after basic addition/subtraction as it is more complicated. Stay tuned!
     
    #6
  7. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Version 1.2 is now available!

    I've added the ability for states, weapons, and armor to add or subtract values from the custom stats. Check the original post for notetag information! :)
     
    #7
    Chickenlump likes this.
  8. fighder

    fighder Warper Member

    Messages:
    1
    Likes Received:
    0
    First Language:
    English
    Have a question about the example:
     

    what does "a" mean? and what does "b" mean? and do you not need <> when increasing or decreasing stat?
     
     
    #8
  9. Sera

    Sera Veteran Veteran

    Messages:
    80
    Likes Received:
    16
    First Language:
    English
    a refers to the user of a skill and b stands for the target. Using them as prefixes is how you reference certain character's stats in damage formulas. <> is for the notes sections.
     
    #9
    Bobstah likes this.
  10. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Sera is correct with their response about a and b and how to use them in damage formulas. :)

    As for your second question, I am a bit confused. If you use the notetags below, you can increase or decrease this stat through weapons, armor, and states:

    <CustomStat: statName+statValue>

    <CustomStat: statName-statValue>

    If you want a Sword to add +5 to a custom stat called anger, you would use the following notetag on the sword:

    <CustomStat: anger+5>

    To subtract 5 anger instead:

    <CustomStat: anger-5>

    Did this answer your question?
     
    Last edited by a moderator: Nov 2, 2015
    #10
  11. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    I was waiting for a plugin like this in order to implement a couple stats into one of my games.  One stat is a new take on how often you get critical hits and the other augments how much more damage they do compared to your normal attack.  I can't download this right now but I'll be sure to try it later.  Thanks a lot for making something like this!
     
    #11
    Bobstah likes this.
  12. Ozuma

    Ozuma Villager Member

    Messages:
    19
    Likes Received:
    5
    This solves several problems at once!

    I looked for it all your life. Thank you so much!

     

    Somehow changing the status throughout the game?

    Example: The "sanity" of the actor 1 is being hampered throughout the game, reducing the efficiency of the formula "a.sanity - b.mdf"
     
    #12
    Bobstah likes this.
  13. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    You're welcome. Glad it's helping you! :)

    The next update of this plugin will feature plugin commands to support adding and subtracting from these stats, as well as an Eval option.

    If you do not want to wait, you can use states for the time being, although I know this isn't a perfect method.
     
    #13
  14. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    Upon trying to load a game I get a weird bug in which it won't let me start playing the game.  It won't let me load a saved game and when I start a new one it says "TypeError:  Cannot read property 'length' of undefined" and freezes.

    I'm not quite sure what is causing this.
     
    Last edited by a moderator: Nov 3, 2015
    #14
  15. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Was this save game created before you installed the plugin? If so, that is why you are getting the error.

    If not, could you provide a sample of your notetags while I investigate?
     
    #15
  16. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    I haven't added any notetags yet and it gave me that error.  I had 2 saved games (both created before plugins) that would not load at all.  The crash happens when I started a new game.
     
    #16
  17. Bearsmith

    Bearsmith Villager Member

    Messages:
    22
    Likes Received:
    5
    First Language:
    English
    Using Yanfly's scripts and wondering if things like

    <Custom Parameters>if(user.hp <= (user.paramBase(0)* .25)){atk = 20;mat = 40;}</Custom Parameters>on gear be possible with this script eventually. I want to use custom stats but I need to be able to use conditionals!I do see you're adding eval support though so I assume that means yes.
     
    #17
  18. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    What other plugins are you using? I'm able to start a new game in my project with all of the pre-order plugins (Yanfly and Yami), plus a few misc ones that have been released in the last few days.

    That's correct! If you use the eval feature for statValue, it gets executed every time the value for that stat is requested. Things might get a bit crowded in your note field, but I'm assuming you're totally ok with that. :)
     
    #18
  19. TheGamedawg

    TheGamedawg Veteran Veteran

    Messages:
    350
    Likes Received:
    132
    Location:
    United States
    First Language:
    English
    For Yanfly, I have the Core, Battle, Equip, and all 3 Action Sequences Engines.  I also have AltSaveScreen, DeadOrAliveItem, and EllyeSimpleATB.  Your plugin is right at the bottom.  I've tried a good combination of turning them off to see if your's will work, on top of turning each and every one of them off except for yours.  However it still gives me the crash.
     
    #19
  20. Bobstah

    Bobstah Pluginstah Veteran

    Messages:
    216
    Likes Received:
    164
    Location:
    United States
    First Language:
    English
    Primarily Uses:
    N/A
    Please provide a screenshot of the error message and a copy/paste of you BOB_CustomStats.js file via Pastebin or similar site.
     
    #20

Share This Page