Running into issues with large floats?
So I have my game hooked up to a server and I'm working on an inventory system. Basically each item is saved as a 13 digit code, where each number defines a parameter of the item that's being stored. Then that number gets uploaded, and then called when the player accesses their inventory. However, I'm running into some weird issues.
I've been trying to use modulo to isolate each section of the number, and it's been working for the most part, but towards the end when I try to do, say 1123334445566 % 10000, i should be getting 5566, but UE4 is getting 0. Similarly, if I try to do say 1123334445566 % 100, it should be 66, but the engine ends up with a ridiculously large negative number.
I thought it might have something to do with floats, but when I tried to convert the "code" to an integer, it once again turns into a massive negative number out of the blue? Is my number too big for UE4 to handle? And if so, what should I do to get around this?
asked Mar 07 '19 at 05:04 AM in Blueprint Scripting
UE4 uses 32 bits for an integer / float, so there is no way you're gonna have a 13 digit number.
What is the reason behind using numbers at all? Why not structs? What data are you trying to store?
answered Mar 07 '19 at 10:09 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here