Having a state increase a variable when applied?

Rekkid

Villager
Member
Joined
Jan 3, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
Basically what I want to do is have variable X increase whenever State Y is applied and decrease when State Y is removed. I have tried using Yanfly's state core plugin but it doesn't seem to work, maybe because it doesn't happen in combat. Is there any other way to achieve this effect?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
679
Reaction score
375
First Language
Poland
Primarily Uses
RMMV
You need a plugin Yanfly's Buff States Core.
Install it and in your custom state's field type:
Code:
<Custom Apply Effect>
$gameVariables.setValue(id, $gameVariables.value(id) + 1);
</Custom Apply Effect>

<Custom Remove Effect>
$gameVariables.setValue(id, $gameVariables.value(id) - 1);
</Custom Remove Effect>
Edit: in place of ID type a number representing your variable you wish to alter
 

Rekkid

Villager
Member
Joined
Jan 3, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
You need a plugin Yanfly's Buff States Core.
Install it and in your custom state's field type:
Code:
<Custom Apply Effect>
$gameVariables.setValue(id, $gameVariables.value(id) + 1);
</Custom Apply Effect>

<Custom Remove Effect>
$gameVariables.setValue(id, $gameVariables.value(id) - 1);
</Custom Remove Effect>
Edit: in place of ID type a number representing your variable you wish to alter
I have tried this already and it did not work.

This is what I have written in the state's note box:
<Custom Apply Effect>
$gameVariables.setValue(4, $gameVariables.value(4) + 5);
$gameVariables.setValue(5, $gameVariables.value(5) + 10);
</Custom Apply Effect>

<Custom Remove Effect>
$gameVariables.setValue(4, $gameVariables.value(4) - 5);
$gameVariables.setValue(5, $gameVariables.value(5) - 10);
</Custom Remove Effect>

I don't think Yanfly's plugin will work here either because my game doesn't actually enter combat or maybe theres an incompatibility with another plugin.
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,933
First Language
English
Primarily Uses
RMMV
I have tried this already and it did not work.

This is what I have written in the state's note box:
<Custom Apply Effect>
$gameVariables.setValue(4, $gameVariables.value(4) + 5);
$gameVariables.setValue(5, $gameVariables.value(5) + 10);
</Custom Apply Effect>

<Custom Remove Effect>
$gameVariables.setValue(4, $gameVariables.value(4) - 5);
$gameVariables.setValue(5, $gameVariables.value(5) - 10);
</Custom Remove Effect>

I don't think Yanfly's plugin will work here either because my game doesn't actually enter combat or maybe theres an incompatibility with another plugin.
Custom Apply Effect will still trigger if the state is applied outside of combat.

Your effects work fine on my end so if they're not working for you it must be a compatibility issue with another plugin. I can't imagine what would interfere with this though.
 

Rekkid

Villager
Member
Joined
Jan 3, 2014
Messages
8
Reaction score
0
First Language
English
Primarily Uses
I guess I'll need to troubleshoot to find out which plugins are making it not work properly. Thank you for confirming.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
2,602
Reaction score
1,933
First Language
English
Primarily Uses
RMMV
What plugins are you using?
 

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

Latest Threads

Latest Posts

Latest Profile Posts

12 done, 4-5 started. Now that the weekend is over, things will sloooowwwww down again proabably.
when you're completely done with someone's crap lol...
Ami
--- Survival For RPGist Part 3 ---

F.Healer: Here it is,I made the Simple Sandwich
Survivalist
: it's so Delicious!
Chef: Here you Go! My Gourmet Steak.
Survivalist: It's Super Delicious,Too!
F.Mage: I Made it for you!
F.Healer: Uhh...Charcoal?
F.Mage No,It's a Toast!
Chef: Did you Let it in 10 Minutes?
F.Mage: Maybe?

Forum statistics

Threads
103,033
Messages
996,817
Members
134,507
Latest member
juegostudios
Top