RPG Maker MV

RPG Maker MV

Frito Aug 19, 2024 @ 8:35am
[SOLVED]Variable value limit >99.999.999? How to print dots any three digits?
Greetings :)

I'm trying to make a space exploration game where you can meet alien civilizations with a population count. As there are already more humans on earth than a variable in MV can store as a value I'm

- either looking for a way to increase that number or
- another elegant way to acomplish this AND being able to display that number

Another question would be about how to display dots any three digits, so an output in a message wouldn't come over like "43597325", but more like "43.597.325" for better understanding of the number.

Thanks in advance :)
Last edited by Frito; Aug 19, 2024 @ 10:11am
< >
Showing 1-4 of 4 comments
Frito Aug 19, 2024 @ 9:10am 
Alright, I just found out that it's very possible to store values higher than 99.999.999 in a variable via the math functions (combining the values of two variables into another one).

All that remains is the question about the dots every three digits if I want to put the value in a message...
Frito Aug 19, 2024 @ 10:11am 
Okay, after extended searching I found this code:

Window_Base.prototype.convertEscapeCharacters = function(text) { text = text.replace(/\\/g, '\x1b'); text = text.replace(/\x1b\x1b/g, '\\'); text = text.replace(/\x1bV\[(\d+)\]/gi, function() { return $gameVariables.value(parseInt(arguments[1])).toLocaleString(); }.bind(this)); text = text.replace(/\x1bV\[(\d+)\]/gi, function() { return $gameVariables.value(parseInt(arguments[1])).toLocaleString(); }.bind(this)); text = text.replace(/\x1bN\[(\d+)\]/gi, function() { return this.actorName(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1bP\[(\d+)\]/gi, function() { return this.partyMemberName(parseInt(arguments[1])); }.bind(this)); text = text.replace(/\x1bG/gi, TextManager.currencyUnit); return text; };

Simply put this into a .txt, save it as a .js, put it into the plugins folder and activate it.

Source: https://forums.rpgmakerweb.com/index.php?threads/is-it-possible-to-format-a-variable-to-separate-with-commas.162607/#post-1393885

Author: ATT_Turan
JohnDoeNews Aug 19, 2024 @ 2:04pm 
You can also store larger number than 99,999,999 if you use the script section, all the way at the bottom. If you just put a number there, any number, no matter how large, it will work as if you use the default way of entering numbers. You don't need to combine multiple variables.
Frito Aug 19, 2024 @ 2:18pm 
First to say: thank you for your reply, much appreciated :D

I've put up a dice system to determine a system of the population level (Level 1= 1 sole creature, Level 2=2 to 99 population, Level 2=100 to 999 etc.), a number that's getting stored in a 'Result' variable. If the dice hits the max. Level (Level 10: >99.999.999) a multiplier variable enters the game.

I don't see that getting stored in the script section of variables, but maybe I just misunderstood you...?!?
< >
Showing 1-4 of 4 comments
Per page: 1530 50