Adding to a variable through script call

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
Is it possible to add or subtract from a variable through script calling? I am using Yanfly's Buff and States Core plugin to try and count how many characters in a battle have the state isDead. I found the script call $gameVariables.setValue(var, value); but it only seems to set the vaariable to a specific number or another variable which if I use another variable then I end up in an infinite loop causing my game to freeze.


problem 2.png


Long story short is there a way to add to a variable through script call instead of just setting it?


Yanfly's Buff and States Core: http://yanfly.moe/2015/12/25/yep-50-buffs-states-core/
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,076
First Language
English
Logic: get original variable, add to it, then put it back in.

Code:
$gameVariables.setValue(11, $gameVariables.value(11) + 1);
 

KeenWolf

Amateur Game Creator
Member
Joined
Mar 14, 2014
Messages
18
Reaction score
0
First Language
English
Primarily Uses
Haha thank you didn't think of that. I only thought of the whole setValue thing.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Is it okay to hug a tree? :/
The new intro Logo for my videos.

I speed it up, the one I use to use was to long.
The workweek is now over. Now I can work on my GamZzzzzZzzzzZzzzZzzZz....
Just watched Onward with the family. One of the best movies I've ever seen. <3

Forum statistics

Threads
95,824
Messages
932,212
Members
126,259
Latest member
Illuminachos
Top