Welcome to the Builder Academy

Question Comma Question

More
05 Apr 2014 05:33 #4800 by Liko
Comma Question was created by Liko
Hello,

I've been using this comma snippet for awhile now and the only thing I notice is when it comes to a number larger then 2.14 billion it sends it to negative and can't read it. Is there a way to modify the current comma snippet so it can read numbers as big as 1,000,000,000,000,000,000,000,000...just throwing it out there.

Randian(0.0.0)
Owner/Developer

Please Log in or Create an account to join the conversation.

More
05 Apr 2014 13:33 #4801 by rudeboyrave
Replied by rudeboyrave on topic Comma Question
Im not so sure its the comma snippet that is your problem. It is the size of integers? I do not know much about these or the repercussions of changing them but i think what you're looking for is in structs.h

if you look for "int exp"
Code:
int exp; /**< The experience points, or value, of the character. */

this is what we are needing to change. The int is a 16 bit integer. i think it is possible to convert it to a 64 bit integer by changing it to "long long int" but i am not too sure. it may also require a pwipe on your server.

Like i said i do not know if this is right but it is what i have come to understand. more info is below!




en.cppreference.com/w/cpp/language/types

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
05 Apr 2014 20:00 #4803 by thomas
Replied by thomas on topic Comma Question
You're spot on about the cause of the problem.

However, using ASCII pfiles would mean you don't need a pwipe - just read and write the correct size numbers..

But, and this is something that's hard to get right - since this number is used lots and lots of places in the code, you'd need to make small changes many places. If you switgch it in the headers, start looking at the warnings it generates. Those are the places you need to look.

Please Log in or Create an account to join the conversation.

More
05 Apr 2014 21:20 - 05 Apr 2014 21:21 #4805 by Liko
Replied by Liko on topic Comma Question

thomas wrote: You're spot on about the cause of the problem.

However, using ASCII pfiles would mean you don't need a pwipe - just read and write the correct size numbers..

But, and this is something that's hard to get right - since this number is used lots and lots of places in the code, you'd need to make small changes many places. If you switgch it in the headers, start looking at the warnings it generates. Those are the places you need to look.


Using the above comma. snippet it wont display anything over 2,147,483,647.

Currently my mud character as
You have 7000000 exp, 8589934588 gold coins, and 0 questpoints.(score) which doesn't use the comma code for testing reasons, but when I type gold which uses the comma code:

You have -4 gold coins.

Seems the comma code wont read over a long int..

Randian(0.0.0)
Owner/Developer
Last edit: 05 Apr 2014 21:21 by Liko.

Please Log in or Create an account to join the conversation.

More
05 Apr 2014 21:58 - 05 Apr 2014 22:00 #4806 by Liko
Replied by Liko on topic Comma Question
Fixed:

You have 1,038,000,000,000 gold coins.

Now commas can support this high..will have a patch for the comma snippet soon. It was with the comma code itself.


Tho the game reverts it back to the 2.147b.

Randian(0.0.0)
Owner/Developer
Last edit: 05 Apr 2014 22:00 by Liko.

Please Log in or Create an account to join the conversation.

Time to create page: 0.206 seconds