NeMV - State Resources

1. Create a state. Lets say its id 12. Call it Chi. No restrictions. Untick remove at battle end / remove by restriction
2. In the notetag box, add: <Resource 0, 100, Chi> 0 means the player starts with 0 Chi and Max Chi value is 100 (change to your liking)
3. Apply this state to your players. I use Yanfly Autopassivestates to do this (you can use whatever method you want to)
4. Using Yanfly's custom requirements for skills, for each skill using Chi, you will need to add the following to the skill notebox:

<Custom Requirement>
if (user.getSR(12) > 5) {
value = true;
} else {
value = false;
}
</Custom Requirement>
//If state resource id 12 of user is above 5, this skill is usable

<Custom Execution>
user.adjustSR(12) -= 5;
</Custom Execution>
//user loses 5 Chi when skill is used

Requires Yanfly State core / skill core
Okay thank you. Any reason why I need to use script commands and not the notetag that determines how much a skill costs? I also noticed if I just make my resource for example "<Resource 50, 50, Chi> That has the character starting with that amount which I didn't understand after reading the thread until you explained it to me, I have comprehension issues with how things are explained. So after I changed my tag to that, I also removed the notetag that gives the character 50 chi at battle start and noticed that the plugin stores the current amount on it's own.
Okay thank you. Any reason why I need to use script commands and not the notetag that determines how much a skill costs? I also noticed if I just make my resource for example "<Resource 50, 50, Chi> That has the character starting with that amount which I didn't understand after reading the thread until you explained it to me, I have comprehension issues with how things are explained. So after I changed my tag to that, I also removed the notetag that gives the character 50 chi at battle start and noticed that the plugin stores the current amount on it's own.

You need to use a notetag for skill costs because how else are you going to get a skill to use "Chi"? It's not like MP/TP where you can just plug it into the database and it's clunky to use it in the battle formula.

Not sure what you are on about with "noticed the plugin stores the current amount on its own" but if you have further questions, feel free to ask
Is there a way to make it so when you equip a certain weapon or armor it adds a certain amount to the max SR but removes that same amount upon unequpping the weapon or armor? I know there are script commands that change the max SR, not sure if I'm able to use it in the way I want to though.
I really want to use this but I'm having trouble: nothing is happening at all. These are my tags below.
The state is number 288

My skill looks like this:
<SR 288 Cost: 1>

State Looks This:
<Resource 1, 7, Spirit Bonds>

<Resource BattleStart: 1>

<Resource BattleEnd: 0>

<Resource BattleStart: +1>

I am using ATB, so I'm not sure if that's an issue. Also, I can use teh skill without using a resource and it does not appear any resource is generating.
I really want to use this but I'm having trouble: nothing is happening at all. These are my tags below.
The state is number 288

My skill looks like this:
<SR 288 Cost: 1>

State Looks This:
<Resource 1, 7, Spirit Bonds>

<Resource BattleStart: 1>

<Resource BattleEnd: 0>

<Resource BattleStart: +1>

I am using ATB, so I'm not sure if that's an issue. Also, I can use teh skill without using a resource and it does not appear any resource is generating.

Not sure if you know but state resources seem to only work properly when testing in-game and not via the battle test menu (database)
Anyone have the links to those videos? I'd love to see this in action but the videos aren't showing up for me. 🙁
Not sure if you know but state resources seem to only work properly when testing in-game and not via the battle test menu (database)

I checked through in game testing. I have a test map set up. I'll check it out again, however, to see. Thanks a bunch for telling me!
@ashikai



Servidion is an active member of our forum; he is the creator of such videos
Yeah, the above fix didn't work. still does not work.
Yeah, the above fix didn't work. still does not work.

I spent the past hour playing around with your problem and I'm not sure what the problem is but I can report that <Resource BattleStart> is bugged with current Yanfly plugins. I'm not javascript expert but this would be something that @Nekoyoubi would have to address.

My workaround would involve using Yanfly's Troop Event plugin and running the following script turn 1 in every battle:

var state = 288; //your spirit bonds state
for (var p = 0; p < $gameParty.members().length; p++) //checks all party members
if ($gameParty.members()[p].isStateAffected(state)) //if party member is afflicted with spirit bonds state then...
$gameParty.members()[p].adjustSR(state, 1); //this adds 1 resource to your spirit bonds state; adjust accordingly

Other checklist:

Note sure if important but maybe change the name of the resource to 1 word; eg: <Resource 1, 7, Spirit Bonds> to <Resource 1, 7, Spirit>
Remove all instances of battlestart
Disable Yanfly Battle Status Window
Make sure that the state is applied to the character (eg. use yanfly autopasivestates)
Hi there, can anyone can confirm whether this plugin is compatible with current versions of MV and Yanfly? I'm having roughly the same "everything should be working but isn't" problems I'm seeing upstream.
I know no one uses this plugin anymore but I fixed a bug in this plugin:
Originally this script only works if the game title is loaded as it uses the following code:
Code:
NeMV.SR.Scene_Boot_terminate = Scene_Boot.prototype.terminate;
Scene_Boot.prototype.terminate = function() {
    NeMV.SR.Scene_Boot_terminate.call(this);
    NeMV.SR.init();
};
Which is kind of clunky and means any scripts that skip the title screen will result in this script not working properly. Whilst a lot of the scripting methodology is similar to Yanfly's, Nekoyoubi did not copy Yanfly's method of running initialization methods using Datamanager and thus I have found a replacement for NeMV.SR.Scene_Boot_terminate with the following:


Code:
NeMV.SR.DataManager_isDatabaseLoaded = DataManager.isDatabaseLoaded;
DataManager.isDatabaseLoaded = function() {
  if (!NeMV.SR.DataManager_isDatabaseLoaded.call(this)) return false;
  if (!NeMV._SRLoaded) {
      NeMV.SR.init();
      NeMV._SRLoaded = true;
  }
  return true;
};
This allows this script to work all the time including battle play testing and where the title screen is skipped

This is still a really good script with decent compatability and really useful for extending the functionality of RMMV, whether its introducing an ammo system, allowing skills to stack or tracking how much damage a unit has taken throughout battle.

Original thread: https://forums.rpgmakerweb.com/threads/nemv-state-resources.61070/