I want to make an extension to make it easy for me to make numbers that are ridiculously large, but I’m having some trouble.
Been stuck for a couple weeks now on the integer limit, so I decided to make an extension, and so far it’s been pretty rough, with me never making an extension in my life and all.
I made 20 different text variables to store a total of 300 digits of a number inside of (15 digits per variables, picked 15 because it’s close to the 64-bit integer, is a multiple of 3, and reaches 300 easily (300 is also close to the maximum JavaScript integer)), and I figured out how to use parameters and all that, too.
I’ve been trying to get the math system working (because obviously I can’t just do operations on a 300 digit number, that’d be insanity), and so far I’ve settled on making the number parameter add to the string parameter.
The string parameter gets separated back into its first 15 digits, which is then operated on by the addition, it’s then added back into the variable and returned. Easy, right? WRONG (at least for me ).
See while adding all of that stuff together might be easy, there are tons of problems I have to fix as well (welcome to the wonderful world of coding), see when the player reaches the number over the variables intended limit (15 digits), it’s intended to go to 000000000000000 + however much over the limit it was, and add the digit that was taken to the child after. And then I need to make it so the variable goes back to its 15 digits, which means if the variable is 0 it becomes 15 zeroes, and if it is 1 it becomes 1e+14 (the full number of course).
And because I need to break the string into two separate parts, I have to test if the string is long enough to be broken down, meaning I need to repeat this TWICE.
I hope I broke this down well enough.
Here are the events I used for the entirety of the function I was explaining:
(Ignore this little repeat part.)
Honestly it could’ve just been the slightest mistake with a ToNumber, or a while statement or something.