|
1. Dystopia EXP
|
|
Tue Aug 1, 2006 [7:31 PM]
|
HexOxide
Hex.Oxide@gmai.com
member since: Dec 31, 2004
|
Reply
|
|
Just wondering if anyone knows where about's in the Dystopia code Experience is defined, so that I can increase the maximum EXP to more than 2.14billion or whatever it is. Also any suggestions about how to do so would be appreciated. But where to look would be just fine. Thanks.
|
|
|
|
|
2. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [8:07 PM]
|
Gatz
Email not supplied
member since: Jun 9, 2004
|
In Reply To
Reply
|
|
If you wanna raise it and it is just an int value, assuming it is ANSI C, then just change the type from int to long.
So, it'll be something like:
int experience;
.
.
.
long experience;
Or, if you plan on never having experience go negative do:
unsigned int experience;
It'll knock out your negative range but in affect double what number you can go to, similarly you can do that with long.
unsigned long expeirence;
|
|
|
|
|
3. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [8:40 PM]
|
HexOxide
hex.Oxide@gmai.com
member since: Dec 31, 2004
|
In Reply To
Reply
|
|
Thanks, any idea as to where abouts that would be though? my greps are bringing hundreds of pages of results.
|
|
|
|
|
4. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [9:30 PM]
|
mann_jess
Email not supplied
member since: Dec 10, 2005
|
In Reply To
Reply
|
|
A grep for "long experience;" shouldn't return too many results... Regardless, it's defined wherever your character data is defined... for Rom, it's in merc.h... not sure about Godwars. Grepping for the structure definition would also do it... for example, if when you call a pointer to a character do "CharData *ch", then search for something like "struct CharData" or "char_data".
...
Another thing... it should probably be in a .h file. There shouldn't be too many of those. (Possibly telnet.h, interp.h, tables.h, mud.h - in which case it would probably be in mud.h)
Hope that helps, -Jess
(Comment added by mann_jess on Tue Aug 1 22:32:27 2006)
As well, following from the last paragraph, when you grep, constrain it to *.h. For example:
grep char_data *.h
Good Luck, -Jess
(Comment added by mann_jess on Tue Aug 1 22:40:44 2006)
I obviously have some life, right? Two edits to a single post.
Anyway... the experience definition will already be a long, so as stated by the other poster, you'll want to change it to an unsigned long... A double would be after that. -Jess
|
|
|
|
|
5. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [9:59 PM]
|
HexOxide
Hex.Oxide
member since: Dec 31, 2004
|
In Reply To
Reply
|
|
Yeah I've found the Char_Data struct, but I can't fidn where EXP is defined
|
|
|
|
|
6. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [10:45 PM]
|
Tyche
Email not supplied
member since: Apr 4, 2000
|
In Reply To
Reply
|
If you wanna raise it and it is just an int value, assuming it is ANSI C, then just change the type from int to long.
$ cat testsize.c
main(){if (sizeof(int) == sizeof(long)) printf("true");}
$ gcc testsize.c ; ./a.out
true
|
|
|
|
|
7. RE: Dystopia EXP
|
|
Tue Aug 1, 2006 [11:37 PM]
|
Gatz
Email not supplied
member since: Jun 9, 2004
|
In Reply To
Reply
|
|
Quote from the book "The C Programming Language" by Brian W. Kerninghan and Dennis M. Ritchie
"short is often 16 bits, long 32 bits, and int either 16 or 32 bits. Each compiler is free to choose appropriate sizes for its own hardware, subject only to the restriction that shorts and ints are at least 16 bits, longs are at least 32 bits, and short is no longer than int, which is no longer than long."
Thanks for the 1337 observation Tyche. However, what I said about unsigned will work too.
Also, back on point, check out the long long type, it'll help if you want really really big int values. A google search will help turn up some nice info on it.
|
|
|
|
|
8. RE: Dystopia EXP
|
|
Wed Aug 2, 2006 [12:48 AM]
|
HexOxide
hex.oxide@gmail.com
member since: Dec 31, 2004
|
In Reply To
Reply
|
|
Ok, so I found exp, and tried changing it from int ot long, etc, and got no results. Are there other places I need to change as well? Septimus on omen.genesismuds.com 1130 or Hex.Oxide@gmail.com or SepSpt on aim if anyone is able to help
|
|
|
|
|
9. RE: Dystopia EXP
|
|
Wed Aug 2, 2006 [12:00 PM]
|
mann_jess
Email not supplied
member since: Dec 10, 2005
|
In Reply To
Reply
|
|
It depends on what "I got no results" means... When a signed number goes above it's maximum value, it reverts to a negative value. Thus...
If the experience goes negative after exceeding 2 billion something, then no, you just need to increase it again so it has a higher maximum value. Try a long long as the previous poster suggested.
If it maxes out at a specific number, and won't go any higher, then there's somewhere else in the code that keeps your experience from going higher than what an int would allow (and thus prevents it from reverting to a negative value). That peice of code would be wherever the rest of the code is for giving experience to a character (probably called gain_exp or something similar, and likely in the file governing combat, or the file governing updates: combat.c or update.c perhaps).
To find it quickly, do a grep on the maximum value your experience is going to, and one less than that... for example, if your experience caps at 2,140,000,000 then do:
grep 2140000000 *
grep 2139999999 *
You'll find some if statement, or a max() function... simply change the 2.14 billion value to whatever new cap you want (within the limitations of the type definition you have on experience). --- The last part is actually important, otherwise you'll have problems when someone surpasses that value.
Good Luck,
-Jess
|
|
|
|
|