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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  SMAUG coding
. . -> [Subject]  Max skill level

Max skill level

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Rendo   (2 posts)  [Biography] bio
Date Tue 05 Oct 2004 08:21 PM (UTC)
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
Date Reply #1 on Wed 06 Oct 2004 01:18 AM (UTC)
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  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Wed 06 Oct 2004 07:05 AM (UTC)
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
Date Reply #3 on Wed 06 Oct 2004 04:03 PM (UTC)
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)
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  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 07 Oct 2004 09:47 PM (UTC)
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  (733 posts)  [Biography] bio
Date Reply #6 on Fri 08 Oct 2004 05:55 AM (UTC)
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.


17,666 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]