I’m making a number system and I’m having a LOT of trouble.
I can’t find the mistake I’ve made.
I think it might be a problem with the equations.
Do you know if something like this would work?
I’m trying to make it so if the child after the one being called is more than 1, it makes the previous child 15 digits long (Ex: If I have “1e+16” coins, I’d have 1 in the second variable, and 0e+15 in the first), the point of this being so if something is a number like 12 or 1212, it doesn’t only show 1,1212, but instead 100000…1212.
It seems to be breaking, though.
The second condition I’m pretty sure is always returning true.
When I click, the numbers just add a bunch of zeroes to the end/beginning.
And I know it’s this event because I disabled it and it works perfectly.
There might also be something wrong with the equation itself.
I will appreciate the help in advance.
I’m not sure I understand your methodology.
One issue is it’s checking for the index after the current index. When it gets to the last index it will check for an index after the last index which will cause an new index to be created. The first condition should be something like
ChlidName is less than number of children of stringDigitsArray.
Why are you converting strings into a number and then back to a string? If it’s already a string then that seems unnecessary.
It also look like it’s checking the string length of the text at the indexName times 2.
I’m sure I did what I did for a specific reason.
Let me break it down.
I did realize this, but I figured it wouldn’t be a problem because I haven’t really reached that index yet.
I’ve only tried testing it on the first and second because it never worked.
It never impacted it so I didn’t do anything, but thanks for the solution.
So basically (and I might be wrong about how this works), if you convert a string like “001” to a number it becomes 1, and then back to a string because the parameters require a string. Although I don’t actually know if that works how I intend it to (if it doesn’t PLEASE tell me).
I do understand if this part doesn’t work it’d completely break the system, because it’s creating duplicate 0s (in theory).
I don’t understand what you mean by this…
If you may, please elaborate?
I thought you were appending the array element twice with in the string length but I guess you’re appending the text to the other text.
I think I understand now. You’re converting it to a number to remove any leading zeros.
Let me test your concept and I’ll get back to you.
I just wanted to test ToNumber() to make sure it didn’t add a decimal and zero like 1.0 It doesn’t.
I can’t still understand your need. Is there always going to be a pair of numbers. If so, it might be better to use a repeat event.
I just added placeholder conditions.
If the numbers are in pairs then maybe it’s taking things out of context.
The 1st time it uses 0 and 1
The 2nd time it uses 1 and 2
When it would be
0 and 1
2 and 3
And so on…
I want to make it so if any child after the one being called has multiple 0s or is more than 1, than the previous child had 0s added to add to ALWAYS be 15 digits long, because the number system is using text variables that are a maximum of 15 digits long and a minimum of 0.
In the equation I was adding the needed 0s to the string, but adding it to the string without the 0s in case it would make the number more than 15 digits long.
As far as making sure the string has 15 characters both of these seem to work. I used a slider to test the value and a text object to display it.
Repeat a text or StrRepeat is easier than subStr
Either one of these mixed with my previous example of using a repeat should work if my understanding is right.
1 Like
So here’s my extension.
I know it’s a long image, but that’s all the code, and so far it’s working decently.
It completely breaks at “quadrillion,” though.
Let me show you:
Problem (Imgur gif, doesn’t preview, sorry, IDK why.)
I honestly have no idea what’s wrong.
I don’t think I made any code that does that, yet it does.
I’m not sure if it’s because of the event at the beginning and it’s removing a zero at the beginning or something, but I doubt this would be true because the zero is ACTUALLY getting removed from in between the two numbers (what should be 1.050… is turned into 150…).
Although I haven’t added code to transfer it from one string to another, it still seems like it should at least work during the first quadrillion.
If I were to gain another quadrillion (if it was actually working properly,) it’d most likely just display 11.05… because it counted the previous one for the second variable but the new one is just adding to the start of the first.
The only relation is the fact that quadrillion is 16 digits long, which just so happens to be my intended limit, which leads me to think it IS the code.
I think this is out of my scope. I don’t think I can help you with this. I know there are people who worked on similar concepts. I wish you luck.
Well that’s depressing.
Do you think you could tell me about these people so I might be able to reach out to them?
Some of them replied to your other post. People here don’t like to be at-ed.
1 Like