[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Max skill level
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Max skill level

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Rendo   (2 posts)  [Biography] bio
Date Tue 05 Oct 2004 08:21 PM (UTC)  quote  ]
Message
I'm a retard, I can barely code and I'm getting the frustrated :(. The max skill level for any skill is 2^31, and I'm wondering how in the hell can I make it more than that so I can have skills going past 2.137billion. It'd really help develop the MUD I'm working on and I'm just a halfwit. Thanks.
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio   Moderator
Date Reply #1 on Wed 06 Oct 2004 01:18 AM (UTC)  quote  ]
Message
You could use 64-bit unsigned integers but frankly you might want to think of alternate solutions e.g. three 'tiers' of skill levels - 0, 0, 0 is the minimum, then 0, 0, 1, and so on, until 10000, 10000, 10000 or whatever.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 06 Oct 2004 07:05 AM (UTC)  quote  ]
Message
Ah, at the rate of obtaining a skill every 5 minutes, for 2^31 skills, it will already take 20,428 years to get them all. :)

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Zeno   USA  (2,871 posts)  [Biography] bio   Moderator
Date Reply #3 on Wed 06 Oct 2004 04:03 PM (UTC)  quote  ]
Message
I think he is talking about the required level to practice the skill, rather than the max amount of skills. Or is it not that?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
[Go to top] top

Posted by Rendo   (2 posts)  [Biography] bio
Date Reply #4 on Wed 06 Oct 2004 04:57 PM (UTC)  quote  ]
Message
Yes, the required character level, since the game uses a powerlevel system. I feel so stupid, it's probably so simple but it just won't work. For instance, if I make the skill required at 20b, the skill will show up as -1,437,363,737 or something like that, as if it loops or something. I just want to make it work :( Help me please.
[Go to top] top

Posted by Nick Gammon   Australia  (19,180 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 07 Oct 2004 09:47 PM (UTC)  quote  ]
Message
It's a reasonable question. You need to look in the file limits.h, this defines, amongst other things, the max for a long:

#define LONG_MAX 2147483647

(which, as you correctly point out, is 2^31).

However under many compilers you can now use 64-bit integers, which might be:

long long (gcc)

or

__int64 (Microsoft).


That's two underscores before the int64.

If you change the relevant parts of your code and recompile, then it should work.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Meerclar   USA  (554 posts)  [Biography] bio
Date Reply #6 on Fri 08 Oct 2004 05:55 AM (UTC)  quote  ]
Message
There is also the option of unsigned long/int/whatever to double your effective range without having to adopt a new number size.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


2,509 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]