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
➜ Corpse making
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
3
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Thu 06 Jul 2006 04:08 AM (UTC) |
Message
| I looked around the forums and couldn't find any on the topic but maybe i just didn't see it. When a player dies it moves there items to the corpse right, inv, and everything they are wearing... now what I want it to do is not to take woren items just items you were holding... how would I do this? |
Everything turns around in the end | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #1 on Thu 06 Jul 2006 04:28 AM (UTC) |
Message
| In make_corpse (I think), just have an ifcheck if the item is being worn, then put the item into the corpse. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #2 on Thu 06 Jul 2006 05:14 AM (UTC) |
Message
| I was looking at like th dbsc source and found this.
for ( obj = ch->first_carrying; obj; obj = obj_next )
{
obj_next = obj->next_content;
if (!IS_NPC(ch) && obj->wear_loc != -1)
continue;
obj_from_char( obj );
if( obj->item_type == ITEM_DRAGONBALL )
{
obj_to_room(obj,ch->in_room);
continue;
}
if ( (!IS_NPC(ch) && IS_OBJ_STAT( obj, ITEM_INVENTORY ))
|| IS_OBJ_STAT( obj, ITEM_DEATHROT ) )
extract_obj( obj );
else
obj_to_obj( obj, corpse );
}
but in dbsc they only use inv like I want... however trying to use the obj->wear_loc != -1 only seems to create a problem where the item is removed from you, and is just deleted or lost somewhere. |
Everything turns around in the end | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #3 on Thu 06 Jul 2006 11:48 PM (UTC) |
Message
| But I cant really figure out how to even try, because looking around to me it seems wear_loc is always -1.. and the check still removes its from the player so I am at a loss |
Everything turns around in the end | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #4 on Thu 06 Jul 2006 11:54 PM (UTC) |
Message
| You'll need to make sure you're doing obj_to_char or obj_to_obj. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #5 on Fri 07 Jul 2006 12:18 AM (UTC) |
Message
| but if you look at the example given it does both obj_from_char and obj_to_obj already. so the problem is finding out if its worn or in the inventory. |
Everything turns around in the end | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #6 on Sat 08 Jul 2006 03:08 AM (UTC) |
Message
| I really cant figure this out... *sigh* |
Everything turns around in the end | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #7 on Sat 08 Jul 2006 04:13 AM (UTC) |
Message
| Could you explain the problem again, in more detail? It's just lost "somewhere"? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #8 on Sat 08 Jul 2006 04:52 AM (UTC) |
Message
| alright adding the if check in the example still seems to remove your eq, the only difference is that it doesn't put it in the corpse. |
Everything turns around in the end | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #9 on Sat 08 Jul 2006 04:57 AM (UTC) |
Message
| Could you post the code you have so that we know exactly what we're working with? You're probably calling obj_from_obj and removing the object from the corpse, then leaving the function with the if-check before putting the object somewhere. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #10 on Sat 08 Jul 2006 05:04 AM (UTC) Amended on Sat 08 Jul 2006 06:43 PM (UTC) by Metsuro
|
Message
| for ( obj = ch->first_carrying; obj; obj = obj_next )
{
obj_next = obj->next_content;
obj_from_char( obj );
if ( (!IS_NPC(ch) && IS_OBJ_STAT( obj, ITEM_INVENTORY )) || IS_OBJ_STAT( obj, ITEM_DEATHROT ) )
extract_obj( obj );
else
obj_to_obj( obj, corpse );
}
the only change I could find is
if (!IS_NPC(ch) && obj->wear_loc != -1)
continue;
but I could just be wrong in the whole thing
|
Everything turns around in the end | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #11 on Sat 08 Jul 2006 07:00 AM (UTC) |
Message
| How did you make that change? Did you add lines? Remove lines? Where? Please try hard to be specific when talking about code and the like, little details are critical. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #12 on Sat 08 Jul 2006 06:45 PM (UTC) |
Message
| for ( obj = ch->first_carrying; obj; obj = obj_next )
{
obj_next = obj->next_content;
if (!IS_NPC(ch) && obj->wear_loc != -1)
continue;
obj_from_char( obj );
if ( (!IS_NPC(ch) && IS_OBJ_STAT( obj, ITEM_INVENTORY )) || IS_OBJ_STAT( obj, ITEM_DEATHROT ) )
extract_obj( obj );
else
obj_to_obj( obj, corpse );
}
this is how it looked when I tested it. I tried to make it like the dbsc copy. Placing it where it was there as well. |
Everything turns around in the end | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #13 on Sat 08 Jul 2006 06:50 PM (UTC) |
Message
| The continue is probably skipping over doing anything to the obj. Move the continue down, so the ifcheck moves the obj to the corpse and then does a continue. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Metsuro
USA (389 posts) Bio
|
Date
| Reply #14 on Sat 08 Jul 2006 07:15 PM (UTC) |
Message
| Why would I want that? I want the obj to stay on the players and not takken off to begin with? I only want it to remove items from the inventory. Doing what you suggested will remove all things from the player and they will just be gone. |
Everything turns around in the end | 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.
88,646 views.
This is page 1, subject is 3 pages long: 1 2
3
It is now over 60 days since the last post. This thread is closed.
Refresh page
top