Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I'm trying to implement a simple hashcode formula, which results in this weird numbers: 4.788467514771005e+96
Is it possible to convert it to normal integer?
Develop games in your browser. Powerful, performant & highly capable.
Wouldn't round(x), floor(x), ceil(x) or int(x) do the trick?
Nope, tried that already. I want to use this hashcodes in a multiplayer game to check if grid state is in sync. The problem is when this number gets transmitted to another client it changes slightly, may be it is getting converted to a string.
You can't do this in C2 as is. C2 uses floats internally, but a hash calculation must use integers. There is a hash plugin. See if that is sufficient. Otherwise you need this written in your own plugin.
You can either store it as a string, or attempt to convert it to an integer, but it looks like you'll lose some precision when you do that.
Thanks guys, I will try this CB Hash plugin.