Common Sense for anyone that's played rs or rsps.
|
This is manually a basic thread to just explain some stuff, This is common sense for the most of you, but might be informative for the others.
So, some people were asking(I noticed I seen several threads asking) if you could change the max amount of cash. simply said: No you can't.
Explaining why you can't do it: The max integer value java supports is 2,147,483,647. As you can see that's the max cash on RuneScape/anything related to it.
Conclusion: A int will not go < -2,147,483,647 or > 2,147,483,647. (Once it's > 2,147,483,647 it will simply return in -2,147,483,647(-value).
BESIDES:
using the long primitive data type to load your items. But that would be a waste really.
Common Sense for anyone that's played rs or rsps.
True, but like you said, the only way to go above (2^31)-1 [max int value] would be to go to a long data type. Which gives you 9,223,372,036,854,775,807 as a max amount. But I don't see anyone being able to use that much lol. So, if I were you, I would simply keep the int, then use a command or have a person who would trade tickets (or some other form of currency) for 1 billion coins. I've seen this used on a few servers. Thank you for providing the information, I'm surprised it hasn't been posted on here yet, unless it has?
EDIT: I have a question, you know how our character saves use ints, could we use bytes for certain ones? Like player rights? I believe it would save memory, wouldn't it? Or would it not make much of a difference? Or could you not use this approach?
Or you can make it support multiple stacks of cash. Already been done.
I think you mean "an int", and "will not go < -2,147,483,648".
Yes you can, you even said so right at the end of your post. The "simply said" is "yes you can, with a little bit of effort."
P.S. - Welcome to Lesson 2 of the Java tutorials. Nobody reads these anymore?
If you really need to go over max cash stack (which means your overall economy is horrible),
just implement the money pouch with long value and get rid of "item" type coins.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |