Register forum user name Search FAQ

Gammon Forum

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 ➜ Dawn of Time ➜ Administration ➜ Remort code question

Remort code question

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


Posted by Meerclar   USA  (733 posts)  Bio
Date Sun 30 Jun 2002 03:25 PM (UTC)
Message
This question is rather unusual in that it deals with moving eq across pfiles at remort. We at SB:R are interested in having any items flagged as quest objs "survive" the remort process as an inheritence of sorts and I personally am interested in avoiding a long and painful testing process to even find a way to accomplish this. The suggestion has been made that we could extract the items to a locker for the player but I personally feel it would be easier and safer to simply import them to the new pfile. What I'm looking for is suggestions on syntax for copying the objs from the old pfile and importing them to the new one. Any help would be massively appreciated.

Meerclar,
One of SB:R's overworked coders, but it's a labor of love so it's all good :)

Come visit us at
stormbringer.sytes.net:4500

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Kalahn   United Kingdom  (138 posts)  Bio
Date Reply #1 on Sun 30 Jun 2002 10:23 PM (UTC)
Message
Look in remort.cpp around line 81 for the comment:
// swap over the connection to the new character

At this point oc represents the 'old character', and ch represents the character which is just about to go thru creation.

5 or so lines of the right code here will achieve what you want, it should selectively copy objects from oc's inventory to ch's inventory with some recursion over the object list carried by oc. Could even look at using obj_from_char() and obj_to_char(). I would suggest that the new character is not wearing any objects during their new creation.

- Kal
Developer of the Dawn of Time Codebase
http://www.dawnoftime.org/

Kalahn
Developer of the Dawn of Time codebase
http://www.dawnoftime.org/
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #2 on Mon 01 Jul 2002 07:12 PM (UTC)
Message
We intend to dump the objs into the new chars inventory due to the wildly varying levels of the objs in question. Most of them wouldnt even be particularly useful until much later in life but all are impossible, or nearly enough so, to replace. Many thanks for the advice Kal, figured this would be a good place to hit for suggestions since you make infrequent appearances when I'm able to catch you on SB:R for comment. Guess I'll get started on some design stuff now since we have a few ppl about ready to do the remort thing.

Thanks Kal.

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Meerclar   USA  (733 posts)  Bio
Date Reply #3 on Sun 20 Oct 2002 11:21 PM (UTC)
Message
well, Ive done some work on this and its kickin my arse so Im gonna see if anyone else has any ideas. Heres what Im trying to add to the existing DoT begin_remort function before switching connection to the new char:

for (t_obj = ch->carrying; t_obj != NULL; t_obj = t_obj_next)
{
t_obj_next = t_obj->next_content;

// if this is a questitem, transfer to new char
if (IS_OBJ_STAT(t_obj,OBJEXTRA2_QUEST))
{
obj_from_char( obj );
obj_to_char( obj, ch );
return;
}
}

if (t_obj == NULL)
{
obj->next_content = ch->carrying;
ch->carrying = obj;
}
else
{
obj->next_content = t_obj->next_content;
t_obj->next_content = obj;
}

and OBJ_DATA *t_obj, *t_obj_next;
is added back up at the top of the file between
char_data *ch and
int stat

The errors at compile are:
remort.cpp:84: type `OBJ_DATA' is not a base type for type `char_data'
remort.cpp:85: type `OBJ_DATA' is not a base type for type `char_data'
remort.cpp: In function `void do_remort(char_data *, char *)':
remort.cpp:29: too few arguments to function `void begin_remort(char_data *, char_data *, OBJ_DATA *)'
remort.cpp:206: at this point in file
gmake: *** [remort.o] Error 1

Meerclar - Lord of Cats
Coder, Builder, and Tormenter of Mortals
Stormbringer: Rebirth
storm-bringer.org:4500
www.storm-bringer.org
Top

Posted by Kalahn   United Kingdom  (138 posts)  Bio
Date Reply #4 on Wed 23 Oct 2002 07:26 PM (UTC)
Message
I didn't get exactly the same errors you had, but putting the source you provided into the dawn code... so I expect you have something else in your source which you aren't aware of.

If you take a clean remort.cpp, and put this in:

for (t_obj = ch->carrying; t_obj; t_obj = t_obj_next)
{
    t_obj_next = t_obj->next_content;   
    // if this is a questitem, transfer to new char
    if (IS_OBJ_STAT(t_obj,OBJEXTRA2_QUEST)) {
        obj_from_char( t_obj );
        obj_to_char( t_obj, ch );
        continue;
    }
}


Add the data types you had from above, that should transfer the the objects you want. There are a few things in the logic which will need testing... e.g. if you have a container with the OBJEXTRA2_QUEST flag set, will it transfer everything it holds (even if they don't have the flag).

Note that you had a return instead of a continue... also you were refering obj in place of t_obj ... e.g. obj_from_char( obj );... unless of course these is some code we didn't see.

Please note I aren't saying this code is perfect, nor comprehensive... I haven't even tested it, but it will get rid of your compile errors.

Good luck,

- Kal

Kalahn
Developer of the Dawn of Time codebase
http://www.dawnoftime.org/
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.


21,291 views.

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

Go to topic:           Search the forum


[Go to top] top

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