- Joined
- Apr 24, 2021
- Messages
- 231
- Reaction score
- 58
- First Language
- English
- Primarily Uses
- RMMV
Hello I'd like to show a percentage result from a weighted calculation of variables.
100% should be the total sum of variable 1, 2, 3 and 4 weighted by different % each.
Let's say:
variable 1 value is 10, weight is 20%
variable 2 value is 3, weight is 33%
variable 3 value is 50, weight is 10%
variable 4 value is 20, weight is 37%
How can I make these calcs on a script call?
tried: but doesn't work -->
$gameVariables.setValue(5, $gameVariables.value($gameVariables.value(1)/20*100+ $gameVariables.value(2)/33*100 + $gameVariables.value(3)/10*100 + $gameVariables.value(4)/20*100))
100% should be the total sum of variable 1, 2, 3 and 4 weighted by different % each.
Let's say:
variable 1 value is 10, weight is 20%
variable 2 value is 3, weight is 33%
variable 3 value is 50, weight is 10%
variable 4 value is 20, weight is 37%
How can I make these calcs on a script call?
tried: but doesn't work -->
$gameVariables.setValue(5, $gameVariables.value($gameVariables.value(1)/20*100+ $gameVariables.value(2)/33*100 + $gameVariables.value(3)/10*100 + $gameVariables.value(4)/20*100))