How to bypass integer limit?

See now you are thinking right way
Stupid is forcing yourself into something you don’t understand
Where now you are trying approach you at least understand some part of it
And you now have chance of achieving what you want

Look in making games there will always be a moment where you need to do something the brute force your way
And in this case brute force is creating multiple events and well variables

Where your idea is kinda wrong cause of few reasons

1 - AGAIN do you allow to subtract from your number or not?
Cause that is crucial problem here
If yes then you need to keep track of actual number
If it just gonna expand then you do not need to track anything
You only need prefix variable number variable and suffix variable

2 - You want to create it dynamically where more sense would be to pre made it
Cause what is the point in dynamically adding something?
Where you can only manipulate what is displayed

3 - Array would be way to go for dynamic expansions but i would say that static (pre made setup like i mention in #2) expansion would make more sense

Look you could have 999 999 it gonna hit 1M if you add 1 to it
And as i understand you want to display now 1M

So why you wanna do it dynamically?
Where all you need is to set it up like this

Prefix() + Number() + Suffix()
And it would look like this
At 999 999
Prefix = “” + Number = 999 999 + Suffix = “”
NOW it hits 1M
What you do is
Prefix = “1” + Number = “” + Suffix = “M”

And you get 1M

NEXT
You ad 1 to score
What should happen?
That is part i DO NOT get cause i have no idea what is your goal
Would you want 1M 000 001 ?
Or what?
Or it do display 2M?

Now you see problem?
Or you have something else in mind which i did not understand
Anyway
I say you should have some static number that would go back to 0 if it reaches some numbers of digits
And each time it reaches some number of digits you simply change K to M to Q to T or whatever

Look if you have 999 then adding 1 would turn it into 1k so 1000
But you could display 1K
And for that you could have child vars in array
To add 1 to which child index display each time you reset 999 back to 0

But again what you want exactly to be displayed after number is converted?

Or do you want to display 1Q and nothing after it?

Or 1Q 45M 12K 452?

What will be a solution for you will very vary on what you want player to see
How to achieve it is not big of a deal
But 1st you need to determine some rules

I want the player to see a max of six numbers, and a minimum of 1.
A maximum of three for the first numbers before the suffix (E.g. 1M,10M, or 100M), and then a maximum of three for the first 3 decimal houses (E.g. 1.1M, 1.11M, or 1.111M). Another rule is I actually want to remove the “K” suffix, as it’d be the same as showing the number with no suffix.
If I were to show 100.001K, that’d be pointless.
Now for your question.
If you add one to the 1M it wouldn’t show.
1M + 1 is 1 000 001, and the max that would show for 1M is 1.001M.
That would be 1000, not 1.
If I had 1Q, it wouldn’t show anything until they had enough for 1.001Q, (which is a very large number to print out casually, but I’ll still do it.)
1 001 000 000 000 000 (1.001Q) Not more than one suffix.
Let’s think of it like this:
Each suffix adds a certain amount of 0s to a number.
Q adding a whopping 15,
T adding 12,
B adding 9,
M adding 6,
K adding 3,
and a number with no suffix adding 0 (obvious?).
Anyways, could you explain why exactly I would need a prefix, number, and suffix?
I don’t exactly understand what you mean when you say this.
Could you maybe make some events to help me get a better understanding?
Edit:
This reddit post is helping me a lot:
How do incremental game devs store absurdly huge numbers?
I think I can just use floats. I could test if the float is 10 and increase the exponent by one while also changing the float to a tenth of its value.
As for the suffix I could test for the value of the exponent and change the value of the suffix based on that.
E.g;
“Exponent” is > or = to 6
“Exponent” is < or = to 8
Change “Suffix” to “M”
And for subtracting-
When I subtract a number that is extremely small compared to the amount I have, let’s say I have 1 000 000 000 coins, and I’m buying something that costs only 1 000 000, that would subtract the amount to be 999 000 000, but if I was buying something that only costed 1 000, it would subtract to be 999 999 000, this would be excluded. I think I’ll make it so if a number’s exponent is 6 smaller than the exponent of the amount you have, you get it for “free.”
While accuracy is important, I guess I’m willing to get rid of ridiculously large amounts of it.

By this line i think you misuderstand me

I did not mean that if you have 313156561561 number
Then who cares if player see it or it will be 313156561000

NO
That is not stupid
Keeping track of actual number is not stupid

By accuracy IN THIS CASE i meant
IF you want to display 313156561561
Then you do not it is stupid to try reading accurate number or to be precise EXACT number
You could have
Var1 + Var 2
Where Var1(313156)+Var2(561561)
And when you combine them you get 313156 561561

To my understanding you were trying to display something based on actual number and that is stupid
Where you could use other means to display EXACT number without having it as that number like splitting it into variables
Just like you described it
And you would still be accurate to what number it have
Just calculations would be made on parts of this number

Like imagine if you have 4000 and want to add 22 to it to get 4022
You do not need to have one number with 4 digits
You can have 2 numbers with 2 digits each
And 1st would be 40 and second would be 00
Now all you need to do is add to second 22 and you would get 40 22
While you display both numbers at same time

So again what player would see would be 100% accurate
Just how you manage the number itself would be different

NOW
1st thing
Will it display K or not is up to you
Cause this does not exist you need to manually put there what to display
You could even go wit X Y Z or Bingo Bango Bongo it does not need to be K M Q T it can be anything you want and in order you want

2nd thing So you need 4 variables
1 for displaying number before dot
2 for dot . between 1st number and 2nd number
3 for displaying number after dot
4 for displaying suffix

So imagine this
Let’s name these vars like
Number1 + DotVar + Number2 + SuffixVar
And now you set
Number1 = 4
DotVar = “”
Number2 = “”
SuffixVar = “M”

And you get 4M from that

BUT if you set it to
Number1 = 4
DotVar = “.”
Number2 = “761”
SuffixVar = “M”
You get 4.761M

Maybe in fact they all should be text variables
And you need 2 more additional variables
RealNumber1 and RealNumber2

Because if you have 0 in Number1 you would actually see there 0 up front
But if RealNumber1 is greater than 0
You set it Number1 to RealNumber1
If it is equal to 0 (I mean RealNumber1) you would set it to “”
So it would display nothing

And now your only concern would be when to change suffix and pass value from Number2 to Number1

3 Now i understand your approach thx to how you explained 1m + 1 wound = 1m until someone reach 1.001M

Before we go further
Answer me this
When you have EXACTLY 1Q
And you are clicking wouldn’t it be stupid to constantly see 1Q and nothing changes?

I am like Keith not in favor of clicker games
But as much as i seen in few of them
Isn’t the point to lure player into clicking by constantly showing him that his actions takes effect by pumping score?

Before you answer imagine this
You attack boss you deal some damage
lets say even 99999 damage
What is the point of that damage if you need to deal it 1000 times before you see boss health bar even move?

That is demotivating
Player needs to see actual progress for it to make sense
Or am i missing something and your approach is different?

BTW just to be clear so far all you described is 100% doable
But again it will vary on your answer

And to answer your question about suffix and prefix
PREfix is something before actual text
SUFfix is something after actual text

For example
You seen it in games/forums/discord
[Admin]RisenTheFuriousMage

Your nickname is not Admin there
Admin is just PREfix

And same goes for SUFfix just after your nickname
So for example
[Admin]RisenTheFuriousMage(PlaingMario)

So in this case it would be
Prefix(Role) + Text(Nickname) + Suffix(CurrentActivity)

And why you need it?
Well this thing in the picture is called click counter


You see there 0006
You will click it once more and you get 0007

You know the idea

NOW it have only 4 digits as you see
BUUUUT consider this
You DO NOT want to have that click counter with 8 digits
NAH what you want is to have TWO click counters and put them right next to each other

Exactly like here

Why?
Cause right now you have 0006 on 1st and 0006 on 2nd
Imagine it as Number variables i mentioned before
Number1 and Number2

What will happen if you click the right one?
You will get 0006 0007
Exactly same way splitting your number into vars would work

NOW on right click counter you have 9999 on left 0006
So your number is 0006 9999
You click one more time on right click counter and what happens?
You get 0007 0000

In this case it was not automatic
You would need to set event like
IF click counter (Number2 var) = 9999
Button is pressed
Change click counter on right set to 0000
AND add 1 to click counter on the left

And that would be equivalent of
If Number2 = 9999 and button is pressed
Change Number2 set to 0000
Change Number1 add 1

And you get exact same result
NOW you can do as many Number1 Number2 Number3 and so go on … vars as you need

And you would never run out of numbers to count

Your only concern now would be to flip each var in each moment

BUT in reality you would only manipulate 2 or 3 at a time
Where rest would go to that text showing M or Q or whatever

BUUUUT that brings next issue
Your shop
Someone purchase something for idk 10000
It is expensive when game starts

But after i have 1Q then what is 10000? Like nothing
So in my eyes shop should sell stuff for % of your score

But that is for you to decide
But if you would go that route
Then you really do not need anything more than two number variables
And 2 text variables one for dot other for M Q T

Fak i am making to long wall of texts
You need to start trying to do anything
So this will not be just our theoretical talk

BTW you wanted example in events for suffix and prefix?

image

Looking at top line
TempResult is my Number1 var

Operator ParenthesesL are my PREFIXes

CurrentInput is my Number2 var

ParenthesesR is my SUFFIX

So i could have TempResult as 1
Operator as .
ParenthesesL as “”
CurrentInput as 47
And ParenthesesR as M

And i would get 1.47M

That is why you want to have suffix and prefix

It is just way to name something hat is before or after something

1 Like

The shop items start at a set price and go up the more you buy it.
The things you get in the shop increase the amount you get from clicking.
It doesn’t just go up by 1.
It could go up by 100 000.
I think I’ll try working on it and trying different things.

And nothing would stop you from even having 100 variables each holding 3 numbers or 4 or 6 whatever
And subtracting as much as something currently cost from each var

For example you have 1st var 9999 and 2nd var 9999
Item cost 25 4444
Noting would stop you from subtracting 4444 form 2nd var and 25 from 1st var
You would only need to manage it properly

Again this is not hard thing to do
It is only something you need to sit upon and do it (create logic for it)
Start doing it cause right now we are just talking

BUT as some practice and knowledge i would suggest you try to make timer or something idk some text splitting
Try using SubStr() try using StrFind() StrAt() StrRepeat()
Just literally play with it
Cause even if i tell/show you how to use it it won’t help you
You need practice to understand what is going on in your events
And then you will be able to make it display anything you want when you want
It took me few hours to figure them all out
And imagine i was able to do this

Just look at this blasphemy of a expression
Right now i have no idea how i made it work
But when i was trying to deduce how all these expressions work
It was pretty easy after some practice
Now i would just need to sit and read it few times to understand it again

I have an idea dumb enough it just might work.
I thought I could use one number variable and another variable for suffix.
I could use a number and test its value, less than 100 000 and it doesn’t have a suffix, but is separated by a comma.
For that I need to actually separate the numbers, though.
Easy enough.
Now the interesting part.
I don’t need anything else (if my theory works,) to make bigger numbers, all I need is the scientific notation.
I could remove the period from the notation, and do the same equation from before on the notation, except maybe a little different.
I wouldn’t be able to use StrLength, though.
my solution to this being fairly simple.
I could test the length of the number by getting the end of the notation and adding 1 (for the first digit).
Do you think this could work?

That is kinda something i was trying to explain to you at beginning

40,0805 + 2
Is same as
400805 + 2

As long as you can get rid of ,

Your issue is NOT with length of your number
Your issue is with length of integer
So moving part of your number to decimal would 100% fix your issue

AGAIN let me repeat
It DOES NOT matter how you made it
It only matters what player see
Imagine this 40,0805 this is your number right now
Easiest way to split it is
40 and 0805 and now combine it in text to display as 400805

And for that you could use
Just lets assume it is variable called MyNumber

SubStr( ToString(MyNumber) , 0 , StrFind(ToString(MyNumber),".")-1)

AND

SubStr( ToString(MyNumber) , StrFind(ToString(MyNumber),".")-1 , StrLength(StrFind(ToString(MyNumber),".") - StrFind(ToString(MyNumber),"."))

So you go with Change text SET TO SubStr( ToString(MyNumber) , 0 , StrFind(ToString(MyNumber),".")-1) + SubStr( ToString(MyNumber) , StrFind(ToString(MyNumber),".")-1 , StrLength(StrFind(ToString(MyNumber),".") - StrFind(ToString(MyNumber),"."))

And that will simply cut out what is before ,
And cut out what is after ,
And then combine it into ONE SINGLE STRING OF DIGITS

And that is all you would need
Now you could use another SubStr on that to display only 1st 3 or 4 or 6 digits
Where you could add Suffix at end like M Q T

Again start doing anything cause this conversation is not pushing you forward
You need to practice text manipulation

1 Like

I ended up doing this:
https://imgur.com/a/9pGTwVT
But when the number is perfectly 1e+(whatever) it does this:
https://imgur.com/a/ffjo0ie
Edit: I do think it would be nearly impossible to get that number normally, though, then again, it does do that for 1e, 2e, 3e, 4e, ect.
Edit, again: I forgot to include my events in case you needed them.
I did this:



And I do understand that the problem is happening because it’s getting the “1e+” part from the number and it just becomes “1,” but if it had a decimal there, like I did in the first video, it’d be a long number like “1.000000000001e+,” which makes the SubStr take the “100” part, but how would I fix it?

I just used here 3 variables

Each button 1 2 3 4 5 6 7 8
Adds 3 more digits
So if you press 1 you are adding constantly 111
And when 2 you add 111000

Where if you hold space you are subtracting same amount

As you see i have only 2 events to display text
One is if fakevar2 is is equal to 0 and then it is not displayed
and 2nd is if fakevar2 is not equal to 0 and if so it is displayed

Go press 1234 up to 8 and look what happens

Now imagine i could change text to WHATEVER depending on fakevar 1 and 2 value
Imagine i could have more fakevars

Imagine if fakevar1 = 9999 and add 1 to it
I could change fakevar1 to 0
And add 1 to fakevar2
A LOT of things i could od to achieve what you want

Really rethink are you willing to force your way trough the method you choose

All my events


My whole point and everything i am trying to explain to you
Is AVOID getting E+
ANY WAY POSSIBLE
It will take a bit more checking your logic
YET it is 100% doable

So really rethink your idea

On top of that IF each var would get back to 0
It would not display 0000 but 0
TO prevent that i could always have it at 10000
While i would be displaying everything behind 1 or right from 1
And that would be required only for right most variable that is displayed
Since for any on the left you would use like 1M 1Q 2452T and so go on

1 Like

I think I’ll try making an extension for this.
I need to be able to apply this easily to anything I want.
Price of something.
Amount of coins I have.
And other stuff.

Actually i would say extension would make most sense here
YET i have no knowledge over extensions so with that i am unable to help

1 Like

Would I do math on the actual number or the fake numbers?

I made that real number and fake number to show you difference
I personally would NOT even have that normal number and just go with fake vars and on them perform all calculations

1 Like

Thanks for that clarification.
I think I’ll change my number variables to strings and separate the strings into 15 digit numbers for each variable in the extension.
I think I’ll do variables going up to 300 digits total, that should be far more than enough.
If this extension ends up working I’ll release it.
I think it’d have tons of uses.

1 Like

For how long you’ve been on GDevelop I’m surprised you’ve never made an extension.
This is becoming very VERY complex, really quickly.
IDK how to do this properly.
I’ve spent the last two hours here thinking, barely doing anything.
I have an idea, I guess, but it’s just hard to make.
I need to make custom math, and I need to merge 20 different variables in a way it works as a displayable number that I can also break down and perform math and operations on.
Also adding suffixes to the end of the “number.”
The hardest part has to be working with a string, not a number.
I’ll start working on it more tomorrow, but I already tried testing on the variable as if it were a number, which it is not.
So I thought I might be able to merge the 20 variables together as a separate variable and test it that way, but that’d just be 300 different numbers in a variable (I did make it so if they were 0 they were just blank, and the first one is always just 0 if it’s nothing).
When I tried an addition operation on the variable as a simple test, that didn’t work either.
It might’ve just been a display problem, I didn’t check, though.

Over 2 years but i am like
Why to do something i can live without?
I am over 2 years here and i am perfectly fine WITHOUT learning how physics2 works
I did everything i ever wanted without it
Same with extensions

Case is i simply did not explore it

ANYWAY you have wrong idea about what you need to have as text and number variable

You will work with numbers
You only need string/text vars to display numbers as you want

And you only need to do it 4 times
After you get it right for 4 numbers
You will be able to just copy paste it more and more
So you need to just create pattern then keep duplicating it