NeMV - State Resources

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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:

Ilan14

Veteran
Veteran
Joined
Nov 28, 2015
Messages
220
Reaction score
69
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:

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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
 

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
Updating Xsplit and I should have a video/screenshots for you this morning or after work this evening.
 

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
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:

ToastyCheese

Villager
Member
Joined
Jul 30, 2013
Messages
10
Reaction score
4
First Language
English
Primarily Uses
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.
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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.


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. ;)
 

tevak

Kara Zor-El of Earth-23
Veteran
Joined
Jun 26, 2012
Messages
27
Reaction score
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?
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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?


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!
 

ToastyCheese

Villager
Member
Joined
Jul 30, 2013
Messages
10
Reaction score
4
First Language
English
Primarily Uses
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. ;)
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
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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.
 

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
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
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:

Tribaleyes

Villager
Member
Joined
Sep 13, 2015
Messages
10
Reaction score
2
First Language
English
Primarily Uses
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. 
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
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).
 

Tribaleyes

Villager
Member
Joined
Sep 13, 2015
Messages
10
Reaction score
2
First Language
English
Primarily Uses
Ah that's all-right mate, I'm sure I'll figure it out eventually. :)  
 

Nekoyoubi

Plugin & Utility Developer
Veteran
Joined
May 2, 2013
Messages
92
Reaction score
70
First Language
English
Primarily Uses
Ah that's all-right mate, I'm sure I'll figure it out eventually. :)  


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

multitudes of errors


... 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.
 

Servidion

Last Soul Keeper
Veteran
Joined
Mar 15, 2015
Messages
233
Reaction score
27
First Language
English
Primarily Uses
RMMV
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. 


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:

Tribaleyes

Villager
Member
Joined
Sep 13, 2015
Messages
10
Reaction score
2
First Language
English
Primarily Uses
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

In the strangest turn of events, my animations now live in the characters folder, and my character images now live in the pictures folder. It's a complicated world, but weirdly a more resource efficient one. :LZSexcite:
Did you know that we use robotic spy animals to learn about how different species behave in the wild? We're only a step away from robotic spy humans, and then Terminator. :p
Not being able to do a commission/request after all and having to give back the money is so heartbreaking.

Sometimes I'm just way too eager to help people out and suddenly find myself in a very deep hole because I'm not gonna be able to finish it. I really hope I don't come across as unprofessional to these people and in general. =n="
Learning Action Sequences!

Forum statistics

Threads
98,046
Messages
948,817
Members
129,310
Latest member
eillajones309
Top