Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ More Vnums for SWR
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Destiny
(14 posts) Bio
|
| Date
| Sun 12 Jan 2003 11:07 PM (UTC) |
| Message
| | how do i go about adding in many more vnums for SWR 1.0? If anyone could point me to a place where i can find a guide or a patch, i would be most grateful. | | Top |
|
| Posted by
| Shadoan
Canada (21 posts) Bio
|
| Date
| Reply #1 on Mon 13 Jan 2003 02:33 AM (UTC) |
| Message
| | Theres lots of information on how to do this online, but to do it you'd have to switch all the references to VNUMs from 'int' to 'double' (or to 'long' i forgot exactly which, it was 2 years ago that i did this) that should give you a few million vnums to work with. |
Edge of Darkness MUD and Hosting Service,
Head Administrator(Retired)
All your SWR needs, right here, right now.
| | Top |
|
| Posted by
| Nick Cash
USA (626 posts) Bio
|
| Date
| Reply #2 on Mon 13 Jan 2003 02:38 AM (UTC) |
| Message
| I just did this to my own mud recently and I found that there aren't any patches or guides to for adding to SWR 1.0. So I just tried to do it myself and I finally figured it all out, but there's a lot of stuff that needs to be changed. I'd almost have to do it for you but I can do my best to explain. E-mail me at huhahua@yahoo.com or reply here if you want me to help you with it or do it for you..
Step 1:
In mud.h find struct mob_index_data. Go down and change sh_int vnum to long vnum or long int vnum. Dot he same thing for struct obj_index_data and room_index_data.
Second of all go under struct pc_data and find r_range_lo and all the stuff down to o_range_hi;. Change all of the sh_int's and int's (if there are any, I don't quite remember) to long's or long ints (same thing).
Then find struct exit_data. Go down to vnum; and rvnum;. Change both to longs/long ints.
After that go and find struct area_data. Go down to low_r_vnum and change everything on the left side down to hi_m_vnum; to longs/long ints.
Then go find struct godlist_data. Go down to the low_r_vnum and down to the hi_m_vnum change all the things on the lefe to longs/long ints.
Now comes some more confusing stuff. Search for this:
ED * get_exit_to args( ( ROOM_INDEX_DATA *room, sh_int dir, int vnum ) ); and change the int vnum to long int vnum or just long vnum.
Find this:
SPACE_DATA * starsystem_from_vnum args( ( int vnum ) );
change that and everything down to ship_from_engine to long int vnum or long vnum.
Find this:
bool ship_to_room args( ( SHIP_DATA *ship , int vnum ) );
change the int vnum to long int vnum or long vnum.
Find these (they should be right on top of eachother):
MID * get_mob_index args( ( sh_int vnum ) );
OID * get_obj_index args( ( sh_int vnum ) );
RID * get_room_index args( ( int vnum ) );
Change both sh_ints and the int to long or long int.
Getting tired yet? Still more to do in mud.h...
Find this:
RID * make_room args( ( int vnum ) );
Change that to long int or long. The next to lines will be the same except change the vnum to long/long int and the cvnum to long/long int.
Thats all there is to do in mud.h.
Now depending on how many vnums your want, and with long int you can go up to 2 billion some or so, I only went to 5 million vnums. So I will use 5 million for this example.
Step 2:
Go into act_move.c and find anything that says 32676 or something like that. There should be 4 of them. For my MUD I changed them to 5 million, so its up to you. Once you change them they should look like (I was lazy and just use grep to find all the places I put 5 million in, so these won't be the entire sections of code):
1.if ( in_room->vnum > 5000000 ) /* room is virtual */
2.if ( (serial & 5000000) != orig_exit->vnum )
3. brvnum = serial & 5000000
4.if ( (serial & 5000000) != orig_exit->vnum )
Thats all for act_move.c
In act_wiz.c there is one. It should look like this when you are done with it if you are changing it to 5 million:
if ( Start < 1 || End < Start || Start > End || Start == End > 5000000 )
In build.c there are 5 you need to change. Find them and get them too look like this:
if ( evnum < 1 || evnum > 5000000 )
if ( evnum < 1 || evnum > 5000000 ) there are two of them...
if ( vnum < 1 || vnum > 5000000 )
if ( vnum < 1 || vnum > 5000000 ) there are two of those...
if ( val1 < 1 || val1 > 5000000 )
Thats all on build.c
In db.c there are 5. Get them to look like this:
low = 0; high = 5000000;
low = 0; high = 5000000;
low = 0; high = 5000000; There are 3 of them
if (low_range < 1 || low_range > 5000000 )
if (high_range < 1 || high_range > 5000000 )
Thats all for db.c
Last file you need to do this on is mud_prog.c. there are 6 of them but they all look the same with grep so just find 6 different ones or search for them 6 different times. They will end up all looking like this:
if ( vnum < 1 || vnum > 5000000 )
Remember, there are 6 of those.
Take a break, next comes the long hard part.
Step 3:
Now you need to go in and find all the things you changed. The easiest way to do this is to hit make clean and make. There should be loads of errors. Just fix them one by one, a lot will say something like predefined value or reference to function. Just go in and find get_mob_index, get_room_index, and get_obj_index and change the value of the vnums to long. I don't remember where they are so you will have to find them, I think they are in db.c. Then go to act_wiz.c and change the do_oassign, do_rassign, do_massign to longs. Change do_vassign also. Then go in a and change do_checkvnums and all of that related stuff. Don't forget do_goto because you'll want to be able to "goto" the room. I'm sure I'm probably forgetting something here but I'm really hungry and tired.
Step 4:
Now with all of that stuff fixed hit make clean and make again. Now it should have a lot of warnings. It will still compile, but then you MUD will crash every few minutes so you should fix them. All you have to do is go the line it specifies for you and fix the variable so instead of %d its %ld. It takes some trial and error, but you should get it eventually.
Hope this helpped in some way. Again, if you need my help just e-mail me at huhahua@yahoo.com or just post here. |
~Nick Cash
http://www.nick-cash.com | | Top |
|
| Posted by
| Destiny
(14 posts) Bio
|
| Date
| Reply #3 on Mon 13 Jan 2003 06:20 AM (UTC) |
| Message
| Whiteknight, i swear with the info you have, you are someone i worship in my sleep (i dream about code).
Thanks (both of you)
-David Rocco | | 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.
15,566 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top