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 ➜ SMAUG ➜ Running the server ➜ Skin code question

Skin code question

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


Posted by Travis   (8 posts)  Bio
Date Mon 04 Feb 2002 10:46 AM (UTC)
Message
hey all-

i'm trying to get the skin code to work. I'm having a fair amount of luck, but the one thing i can't figure out (do to my limited coding knowledge) is how to change how the object is described in my inventory. For example, with the following code chunk as it is, if i skin something, it appears in my inventory as

the skin of the corpse of a goblin

what i would like it to say is:

the skin of a goblin

any ideas on how to change it? the code is below.

void do_skin( CHAR_DATA *ch, char *argument)
{
OBJ_DATA *corpse;
OBJ_DATA *obj;
OBJ_DATA *skin;
bool found;
char *name;
char buf[MAX_STRING_LENGTH];
found = FALSE;

/* if ( !IS_PKILL(ch) && !IS_IMMORTAL(ch) )
{
send_to_char( "Leave the hideous defilings to the killers!\n", ch );
return;
} */
if ( argument[0] == '\0' )
{
send_to_char( "Whose corpse do you wish to skin?\n\r", ch );
return;
}
if ( (corpse=get_obj_here(ch, argument)) == NULL )
{
send_to_char( "You cannot find that here.\n\r", ch );
return;
}
/* if ( (obj=get_eq_char(ch, WEAR_WIELD)) == NULL )
{
send_to_char( "You have no weapon with which to perform this deed.\n\r", ch );
return;
}

if ( corpse->item_type != ITEM_CORPSE_PC )
{
send_to_char( "You can only skin the bodies of player characters.\n\r", ch);
return;
} */

/* if ( obj->value[3] != 1
&& obj->value[3] != 2
&& obj->value[3] != 3
&& obj->value[3] != 11 )
{
send_to_char( "There is nothing you can do with this corpse.\n\r", ch );
return;
} */
if ( get_obj_index( OBJ_VNUM_SKIN ) == NULL )
{
bug( "Vnum 23 (OBJ_VNUM_SKIN) not found for do_skin!", 0);
return;
}

skin = create_object(get_obj_index(OBJ_VNUM_SKIN), 0);
skin->level = number_range( 1, ch->level);
SET_BIT(skin->wear_flags,ITEM_WEAR_ABOUT);
SET_BIT(skin->wear_flags,ITEM_TAKE);


name = corpse->short_descr;
sprintf( buf, skin->short_descr, name );
STRFREE( skin->short_descr );
skin->short_descr = STRALLOC( buf );
sprintf( buf, skin->short_descr, name );
STRFREE( skin->description );
skin->description = STRALLOC( buf );
act( AT_BLOOD, "$n strips the skin from $p.", ch, corpse, NULL, TO_ROOM);
act( AT_BLOOD, "You strip the skin from $p.", ch, corpse, NULL, TO_CHAR);
act( AT_MAGIC, "\nThe skinless corpse is devoured by a horde of shadowy gerbils...", ch, corpse, NULL, TO_CHAR);
act( AT_MAGIC, "\nThe skinless corpse is devoured by a horde of shadowy gerbils...", ch, corpse, NULL, TO_ROOM);
extract_obj( corpse );
obj_to_char( skin, ch );
return;
}
Top

Posted by Epona   Denmark  (28 posts)  Bio
Date Reply #1 on Mon 04 Feb 2002 02:07 PM (UTC)
Message
Look up the vnum for OBJ_VNUM_SKIN and edit the object in game through olc or through an area editor, the text you need to change is the short description which look something like:

"the skin of the corpse of %s"
to
"the skin of %s"

If you have any problems, reply here and send me a email.

Epona
Goddess of Love
Founder of The Realms of Darkness MUD
(not open to the public yet)
Top

Posted by Travis   (8 posts)  Bio
Date Reply #2 on Mon 04 Feb 2002 07:15 PM (UTC)
Message
I tried that, but no luck. Now it shows up in my inventory
as "the skin of %s"

Top

Posted by Epona   Denmark  (28 posts)  Bio
Date Reply #3 on Mon 04 Feb 2002 11:08 PM (UTC)
Message
Did you see what kind of % character there was in the old short describtion ???

Try and check that and use that char, though i really think that it should be %s because that is what sprinf uses to identify strings with. :)


Epona
Goddess of Love
Founder of The Realms of Darkness MUD
(not open to the public yet)
Top

Posted by Travis   (8 posts)  Bio
Date Reply #4 on Tue 05 Feb 2002 04:51 AM (UTC)
Message
I tried it again, and i still come up with:

the skin of the corpse of a goblin

Hmm. Can't quite figure this one out.

Top

Posted by Epona   Denmark  (28 posts)  Bio
Date Reply #5 on Tue 05 Feb 2002 09:02 AM (UTC)
Message
What version of smaug are you trying to get to work, and on what operating system ??

I will try and download the smaug and see if i can get it to work, and post the result here.


Epona
Goddess of Love
Founder of The Realms of Darkness MUD
(not open to the public yet)
Top

Posted by Travis   (8 posts)  Bio
Date Reply #6 on Tue 05 Feb 2002 06:58 PM (UTC)
Message
I'm using the 1.4a_mxp source code from this site, and running it on a Windows ME machine through a cygwin shell.

Thanks for the help!
Top

Posted by Neves   USA  (78 posts)  Bio
Date Reply #7 on Wed 27 Feb 2002 08:08 PM (UTC)
Message
skin = create_object(get_obj_index(OBJ_VNUM_SKIN), 0);
skin->level = number_range( 1, ch->level);
SET_BIT(skin->wear_flags,ITEM_WEAR_ABOUT);
SET_BIT(skin->wear_flags,ITEM_TAKE);


name = corpse->short_descr;
sprintf( buf, skin->short_descr, name );
STRFREE( skin->short_descr );
skin->short_descr = STRALLOC( buf );
sprintf( buf, skin->short_descr, name );
STRFREE( skin->description );
skin->description = STRALLOC( buf );
------------------------------------------------------------
While looking at this part of the code, I think this is where the skin gets its name from, and it is taking it from corpse->short_descr which turns out to be 'corpse of a goblin'.

Although I do not know what to change it to, I am assuming you will have to somehow change it to the name of the MOB before death, so if you can find somewhere else that it tells you what it is called before death you can put that in instead of corpse->short_descr (might be victim->short_descr) but that is only my guess, fiddle around with it, and make sure to make a backup copy first.

Jay
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.


22,954 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.