NeMV - State Resources

Discussion in 'JS Plugin Releases (RMMV)' started by Nekoyoubi, Apr 29, 2016.

  1. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English
    Plugin: NeMV - State Resources


    Version: 1.2


    Author: Nekoyoubi


    Release: April 27th 2016


    Download: https://raw.githubusercontent.com/nekoyoubi/NeMV/master/NeMV_StateResources.js


    Requires: YEP - Buffs & States Core & YEP - Skill Core


    Introduction


    This plugin grants the ability to quantify states and use them as resources via YEP - Skill Core-friendly notetags.


    Features

    • Use states as additional resources (beyond HP/MP/TP)
    • Resource cost tags mimic YEP - Skill Core
    • Assists in building entirely new functional mechanics
    • Bonus feature if you use YEP - Auto Passive States & YEP - Subclass (Subclass passives! Woo!)



    Example Use Cases

    • Separate resource pools for classes and subclasses (e.g. the initial request post)
    • Build power-up abilities/buffs (e.g. use enough kinetic spells and enter a GOKU!! state)
    • Alter damage formulas (e.g. poisons can stack to do more damage)



    Demonstration


    Servidion put together a pretty awesome showing of some of these things in action just a few short comments down. Check out his comments for sure, but here are the videos.




















    How to Use


    Step 1  
    Designate your state to be used as a resource via the following notetag:  


    State  >  Notebox  >  <RESOURCE INITIALVALUE, [MAXVALUE], [RESOURCENAME]>


    Below are a few of examples of valid State Resource notetags.


    <Resource 0, 100, Rage>
    <resource 10 20 Ammo>
    <RESOURCE 100, 9999>


    Note that the last example will attempt to only use the state's icon to show the resource cost.


    The following notetags can also be used to adjust or set the resources upon starting or exiting a battle. Please note that these tags make use of positive string values (e.g. +10) for increasing the resource, negative values (e.g. -10) for decreasing them, and integers (e.g. 10) for setting the amount explicitly. Also, please be sure that these lines are placed below the initial/setup <Resource> tag.


    State  >  Notebox  >  <RESOURCE PHASE: [+/-]AMOUNT>


    For example...


    <Resource BattleStart: 100>
    <RESOURCE BATTLEEND: 0>
    <resource battlestart: +10>
    <resource battleend: -10>


    In the first example all party members will have their resource set to 100. In the second, the resource will be zeroed out for all party members on the completion of battle. The third example will add 10 to whatever amount (while still being capped to the defined maximum) each individual party member has at the start of a new battle. The last example will force the party members to each lose 10 of the resource (while not falling below zero).


    Step 2
    Add "SR" costs to your Skills with notetags similar to those found in YEP - Skill Core (albeit slightly modified for our case).  


    Skill  >  Notebox  >  <SR STATEID COST: AMOUNT[%]>


    The following examples illustrate a couple of valid Skill notetag uses.  


    <SR 19 Cost: 5>
    <sr 22 cost: 10%>


    Step 3
    Use the following script commands to retrieve or adjust your current and maximum values of a resource (plugin commands may be added in a future version if wanted/needed).


    [Actor|Enemy].getSR(state) // Gets the actor's current resource value
    [Actor|Enemy].setSR(state, amount) // Sets the actor's current resource value
    [Actor|Enemy].getMaxSR(state) // Gets the actor's max resource value
    [Actor|Enemy].setMaxSR(state, amount) // Gets the actor's max resource value
    [Actor|Enemy].adjustSR(state, amount) // Adjusts the actor's current resource


    Note that the .adjustSR() method's amount can be either positive for adding to the current value (e.g. 10; not +10) or negative to remove from the pool (e.g. -10). This will also constrain the value to a range between zero and the resource's maximum for that actor.


    Script (external)


    NeMV on GitHub  |  SR on GitHub  |  SR on MV Plugins  |  SR on Stitch Gaming  |  >> Download SR <<

    FAQ


    Q: Does this work with YEP - ______?


    A: This plugin requires YEP - Buffs & States Core and the YEP - Skill Core to perform its main function. For some extra fun, toss in the YEP - Subclass and YEP - Auto Passive States for extra functionality. Otherwise, I run an almost full YEP stack by default without issue. 


    Q: Is this able to be used in commercial projects?


    A: Absolutely! Wouldn't that be cool?!


    Q: If I use this, do I need to say so anywhere?


    A: If you can make use of my work on any level, then I would absolutely love to know about it, but I make no attribution requirements or the like. NeMV is licensed under the WTFPLv2.


    Credits & Thanks

    • Yanfly for building such awesome plugins for me to exploit! (Oh, and for still choosing not to shoot me.)
    • Servidion for requesting the plugin in the first place, and letting me visually piggy-back on his use of it in testing.



    Author's Notes


    This plugin is the response to a plugin request from Servidion. Thanks to how awesome he is, I was able to not only build exactly the plugin he needed, but also to grow the core concept over the past few days into something that I hope will bring many new opportunities to makers. I hope you get more from it than you expect. Happy stacking!
     
    Last edited by a moderator: Apr 30, 2016
    #1
    nonkiru, Volis, HeathRiley and 8 others like this.
  2. Ilan14

    Ilan14 Veteran Veteran

    Messages:
    220
    Likes Received:
    69
    Location:
    Fantasy Land
    First Language:
    Spanish
    This looks very nice! But do you think you could post a screenshot or two showing how it looks in action, if possible?
     
    Last edited by a moderator: Apr 29, 2016
    #2
  3. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English
    I can probably do that, but since how it's displayed it completely up to the use case, I opted against it. E.g. sometimes it's an invisible state, other times it appears just as a turn-based state would, and then in some cases users may choose to recolor the counter to avoid visual conflict with Yanfly's turn counters. Let me see if Servidion can share a screenshot or two from his implementations. ;x
     
    #3
    Ilan14 likes this.
  4. Servidion

    Servidion Last Soul Keeper Veteran

    Messages:
    233
    Likes Received:
    26
    Location:
    Alberta, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Updating Xsplit and I should have a video/screenshots for you this morning or after work this evening.
     
    #4
    Ilan14 likes this.
  5. Ilan14

    Ilan14 Veteran Veteran

    Messages:
    220
    Likes Received:
    69
    Location:
    Fantasy Land
    First Language:
    Spanish
    Thanks you two! :)
     
    #5
  6. Servidion

    Servidion Last Soul Keeper Veteran

    Messages:
    233
    Likes Received:
    26
    Location:
    Alberta, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    So my first example (Below) is my Gunslinger class. It regenerates Ammo with a "Reload" ability and uses ammo with certain offensive abilities. The ammo is listed with it's state icon.






    My second example (Below) is my Pyromancer class. It generates a stack of Wreathed in Flame for each fire spell I cast. At 7 stacks of Wreathed in Flame the stacks drop to zero and it activates the Firelord state, drastically increasing my fire damage for a few turns. While Firelord is in effect I cannot gain any stacks of Wreathed in Flame.


    Example:



    <Resource 0, 7>
    <Resource BattleEnd: 0>
    <Custom Establish Effect>
    if (a.getSR(207) >= 7) {
    a.setSR(207,0);
    a.addState(208);
    }
    </Custom Establish Effect>


    This formula would be in the Wreathed in Flame state (207), while the Firelord state would be (208).






    My third example (Below) is my Arcanist class. It applies a stack of arcane weakness for each arcane spell cast from the Arcanist's arsenal. I can call the state stack in a formula to increase the damage of any arcane spell (from any other class!).


    Example: b.getSR(128)






    Hope this helps! :D  Neko, feel free to use any of this in your main post.
     
    Last edited by a moderator: Apr 30, 2016
    #6
    Ilan14 and Nekoyoubi like this.
  7. Ilan14

    Ilan14 Veteran Veteran

    Messages:
    220
    Likes Received:
    69
    Location:
    Fantasy Land
    First Language:
    Spanish
    Thanks for the info! This looks really useful! :D
     
    #7
    Nekoyoubi and Servidion like this.
  8. ToastyCheese

    ToastyCheese Villager Member

    Messages:
    10
    Likes Received:
    4
    First Language:
    English
    This is brilliant and I'd been waiting for something like this to happen.


    Does the stacking effect also allow stacking of effects like DoT and status alterations without bugging? There was another stacking state plugin lurking about that had crash issues when you stacked similar effects like accuracy down.


    Either way - yes please thank you I've been praying for stacks and state resources for evers.
     
    #8
    Nekoyoubi likes this.
  9. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English


    State Resources doesn't alter the state in any way other than to put a quantifier on it, and allow you to easily "spend" that resource. Now, obviously, Servidion's done much more with it than I originally wrote it for, but nothing he's doing is beyond the realm of its overall intent. If you're expecting it to stack the effects of the same state, no, it doesn't even pretend to get into any of that mess. That's more than likely where your issues with the other mentioned plugin came in. It will, however, continue to function as the state is specified, so it's not like it can only be a placeholder or anything.


    I hope it's still what you were looking for. ;)
     
    #9
  10. tevak

    tevak Kara Zor-El of Earth-23 Veteran

    Messages:
    27
    Likes Received:
    10
    First Language:
    English
    Primarily Uses:
    N/A
    Would it be possible to globally adjust a specific resource value with script calls? Like adding +1 for all battlers each turn with troop events, for example?
     
    #10
  11. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English


    Not globally with one call, but with a tiny bit of JS, absolutely. Something like this in a Script Command:


    var state = 123;
    for (var p = 0; p < $gameParty.members().length; p++)
    if ($gameParty.members()[p].isStateAffected(state))
    $gameParty.members()[p].adjustSR(state, 1);
    for(var e = 0; e < $gameTroop.members().length; e++)
    if ($gameTroop.members()[e].isStateAffected(state))
    $gameTroop.members()[e].adjustSR(state, 1);


    I might be able to add something like that in a utility method, but either way, that should get you what you need.


    I hope that helps!
     
    #11
  12. ToastyCheese

    ToastyCheese Villager Member

    Messages:
    10
    Likes Received:
    4
    First Language:
    English
    Hmm. The script does allow you get get the number of stacks though yes? I'm sure there's a way to assign that to a variable and write it into a DoT formula or something.

    Tell me I'm crazy if I am :p
     
    #12
  13. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English
    Absolutely! It can be used in formula boxes or damage phase notetags (like those provided by YEP - Skill Core). If you look to the "Step 3" section of the "Usage" listed above, you'll find many methods that can be used to get and set the stacks. For instance, in a damage formula you may have:

    Code:
    (a.atk*2)+(b.getSR(123)*10)
    In that example, the damage of the skill would be directed modified based on the amount of state 123 present on the target.


    You could also use it in things like custom conditions for YEP - Auto Passive States. In my project, I have a state that I have this on to turn off the state once I have no more charges.


    <Custom Passive Condition>
    condition = user.getSR(123) > 0;
    </Custom Passive Condition>


     I hope that helps answer your question. Let me know if it somehow did not, and I'll try to be more specific.
     
    #13
  14. Servidion

    Servidion Last Soul Keeper Veteran

    Messages:
    233
    Likes Received:
    26
    Location:
    Alberta, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    For use in a DoT formula I use Ellye's State Damage:


    You can use NeMV resource stacks (such as the example Neko game in the above post) in the formula to have the DoT deal extra damage each turn.
     
    Last edited by a moderator: May 4, 2016
    #14
    Nekoyoubi likes this.
  15. Tribaleyes

    Tribaleyes Villager Member

    Messages:
    10
    Likes Received:
    2
    First Language:
    English
    Could somebody post a Demo or a video tutorial just showing some of this stuff? I understand the general gist but I honestly don't understand how it's worded and I've ended up with multitudes of errors. At this point I'm close to scrapping an idea that is otherwise completely awesome. 
     
    #15
  16. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English
    Servidion posted three videos above. While not exactly tutorials, he did do a really good write up on each of the concepts he recorded (may just have to read a bit). Though, to be honest, I have no issue with working with you one-on-one to get you through it if you'd prefer. I'm sorry that I don't have my own demo of me setting these things up and everything. I just spend so much of my time working on the actual plugins, utilities, helping other makers with their games, (oh and my ~60hr./week day job) that I don't really have the time to sit and record videos personally. ;(  I'm trying to get there, but it will take me some time (believe it or not, this stuff takes a lot of work).
     
    #16
  17. Tribaleyes

    Tribaleyes Villager Member

    Messages:
    10
    Likes Received:
    2
    First Language:
    English
    Ah that's all-right mate, I'm sure I'll figure it out eventually. :)  
     
    #17
  18. Nekoyoubi

    Nekoyoubi Plugin & Utility Developer Veteran

    Messages:
    92
    Likes Received:
    69
    Location:
    Louisville, KY (US)
    First Language:
    English


    Well, the offer's there if you change your mind. After reading that you got...



    ... I was concerned. I'm not sure what may have gone wrong in your setup, but in general you shouldn't be getting any errors, and I don't want people skimming through the comments here and assuming that this plugin is broken.


    Can you maybe explain to me what it is you're trying to achieve? Maybe then I can show you how I would create it, or at least let you know if this plugin doesn't fit the need.
     
    #18
  19. Servidion

    Servidion Last Soul Keeper Veteran

    Messages:
    233
    Likes Received:
    26
    Location:
    Alberta, Canada
    First Language:
    English
    Primarily Uses:
    RMMV


    I'll do a very simplified tutorial on how I have AMMO for my Gunslinger class.


    1 - Obtain this plugin, as well as Yanfly's Auto Passive states and any plugins it requires.


    2 - Create a state called Ammo and give it an icon.


    3 - In the notebox of the Ammo state write this: <Resource 12, 12> this states that your character initializes with 12 ammo, and has a max of 12 ammo.


    4 - On the Gunslinger Class notebox write this: <Passive State: x> where x is the ID of the Ammo state.


    5 - Make a skill called "Reload" with this in the notebox:


    <Custom Execution>


    a.adjustSR(x, 12)           <======= x here is the ID of the Ammo state. 12 is the amount that will be reloaded.


    </Custom Execution>


    6 - Make a skill called "Shoot" and write this in the notebox: <SR x Cost: 1> where x is the state ID for ammo.


    7 - Test it in combat! Use reload to gain 12 ammo, then try using shoot and you'll lose 1 ammo. Reload any time you want, but if you run out of ammo you can't shoot again until you reload.
     
    Last edited by a moderator: May 10, 2016
    #19
  20. Tribaleyes

    Tribaleyes Villager Member

    Messages:
    10
    Likes Received:
    2
    First Language:
    English
    To make sure it wasn't my file. I created an entirely new project and only put 5 Plugins in it, all of which are fully updated; In this order


    YEP_CoreEngine


    YEP_BattleEngineCore


    YEP_SkillCore


    YEP_BuffsStatesCore


    YEP_AutoPassiveStates


    NeMV_StateResources


    I followed your instructions word-for-word and I've got the same problem still in that none of the skills are actually showing as costing anything.
     
    #20

Share This Page