I know it can be done in an ugly way with events, and I expect it can be done in a pretty way with a script, but I cannot do Javascript to save my life. What would the script be for adding several Variables together to make another Variable? Just a basic v[1]+v[2]+v[3]+v[4]=v[5] type of thing.
Script needed: Adding multiple variables to make another variable
RPG Maker MV Support@WaywardMartian Fancy-pants option :
Normal option :
Code:
$gameVariables.setValue(5, [1,2,3,4].reduce(function(a, v) { return a + $gameVariables.value(v); }, 0));
Normal option :
Code:
$gameVariables.setValue(5, $gameVariables.value(1) + $gameVariables.value(2) + $gameVariables.value(3) + $gameVariables.value(4));
This is a script call, not a request for a plugin.
Moved to: RPGMaker MV
Moved to: RPGMaker MV
Thread closed IgnoreMe
Original thread: https://forums.rpgmakerweb.com/threads/script-needed-adding-multiple-variables-to-make-another-variable.115753/