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 ➜ SMAUG coding ➜ what a player is wearing

what a player is wearing

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


Posted by Taebryn   (58 posts)  Bio
Date Tue 24 Feb 2004 04:42 AM (UTC)
Message
is there a way to show what a player is wielding
like when another player is in the room it says
Test the Druid is here.

i want to make it say
Test the Druid wielding a small ax is here.

how would i do this

Arthurian MUD in development.

Reign of Arthur
http://arthur.vze.com
Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Wed 25 Feb 2004 05:39 AM (UTC)
Message
it would be in the do_look function

look for "stands here" or something like that, then you would need to put it like stands here wielding a %s or something. and code out what that would be. look in the look "player" section of it for that. so it's something like that. hope that helps.
Top

Posted by Typhon   USA  (112 posts)  Bio
Date Reply #2 on Sat 28 Feb 2004 02:20 PM (UTC)
Message
in act_info.c search for

void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch )

that is the function that shows characters in the room if you type look

there are alot of different statements that show people in the room.. about halfdway throught the function you'll see
Quote:

switch ( victim->position )
{
case POS_DEAD: strcat( buf, " is DEAD!!" ); break;
case POS_MORTAL: strcat( buf, " is mortally wounded." ); break;
case POS_INCAP: strcat( buf, " is incapacitated." ); break;
case POS_STUNNED: strcat( buf, " is lying here stunned." ); break;
case POS_SLEEPING:
if (ch->position == POS_SITTING
|| ch->position == POS_RESTING )
strcat( buf, " is sleeping nearby." );
else
strcat( buf, " is deep in slumber here." );
break;
case POS_RESTING:
if (ch->position == POS_RESTING)
strcat ( buf, " is sprawled out alongside you." );
else
if (ch->position == POS_MOUNTED)
strcat ( buf, " is sprawled out at the foot of your mount." );
else
strcat (buf, " is sprawled out here." );
break;
case POS_SITTING:
if (ch->position == POS_SITTING)
strcat( buf, " sits here with you." );
else
if (ch->position == POS_RESTING)
strcat( buf, " sits nearby as you lie around." );
else
strcat( buf, " sits upright here." );
break;
case POS_STANDING:
if ( IS_IMMORTAL(victim) )
strcat( buf, " is here before you." );
else
if ( ( victim->in_room->sector_type == SECT_UNDERWATER )
&& !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
strcat( buf, " is drowning here." );
else
if ( victim->in_room->sector_type == SECT_UNDERWATER )
strcat( buf, " is here in the water." );
else
if ( ( victim->in_room->sector_type == SECT_OCEANFLOOR )
&& !IS_AFFECTED(victim, AFF_AQUA_BREATH) && !IS_NPC(victim) )
strcat( buf, " is drowning here." );
else
if ( victim->in_room->sector_type == SECT_OCEANFLOOR )
strcat( buf, " is standing here in the water." );
else
if ( IS_AFFECTED(victim, AFF_FLOATING)
|| IS_AFFECTED(victim, AFF_FLYING) )
strcat( buf, " is hovering here." );
else
strcat( buf, " is standing here." );
break;
case POS_SHOVE: strcat( buf, " is being shoved around." ); break;
case POS_DRAG: strcat( buf, " is being dragged around." ); break;
case POS_MOUNTED:
strcat( buf, " is here, upon " );
if ( !victim->mount )
strcat( buf, "thin air???" );
else
if ( victim->mount == ch )
strcat( buf, "your back." );
else
if ( victim->in_room == victim->mount->in_room )
{
strcat( buf, PERS( victim->mount, ch ) );
strcat( buf, "." );
}
else
strcat( buf, "someone who left??" );
break;
case POS_FIGHTING:
case POS_EVASIVE:
case POS_DEFENSIVE:
case POS_AGGRESSIVE:
case POS_BERSERK:
strcat( buf, " is here, fighting " );
if ( !victim->fighting )
{
strcat( buf, "thin air???" );

/* some bug somewhere.... kinda hackey fix -h */
if(! victim->mount)
victim->position = POS_STANDING;
else
victim->position = POS_MOUNTED;
}
else if ( who_fighting( victim ) == ch )
strcat( buf, "YOU!" );
else if ( victim->in_room == victim->fighting->who->in_room )
{
strcat( buf, PERS( victim->fighting->who, ch ) );
strcat( buf, "." );
}
else
strcat( buf, "someone who left??" );
break;

you'll have to change any of the cases that you want to display the name of the weapon. if you just want "standing here"
you'd change that strcat(buf, " is standing here." );
to
Quote:

{
wield = get_eq_char( ch, WEAR_WIELD );
if (wield)
sprintf(buf, " is standing here, wielding %s", weild->short_descr );
else
strcat(buf, " is standing here." );
}

and add
OBJ_DATA *wield;
to the top of the function.
this is just something to go by.. it doesnt including dual wielding or anything.. have fun :)
Top

Posted by Taebryn   (58 posts)  Bio
Date Reply #3 on Sat 28 Feb 2004 05:02 PM (UTC)
Message
thanks a bunch, i can work off this

Arthurian MUD in development.

Reign of Arthur
http://arthur.vze.com
Top

Posted by Taebryn   (58 posts)  Bio
Date Reply #4 on Tue 02 Mar 2004 02:00 AM (UTC)
Message
i tried what you said, but it is not recognizing
OBJ_DATA *wield;

cant find "wield"

Arthurian MUD in development.

Reign of Arthur
http://arthur.vze.com
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #5 on Tue 02 Mar 2004 06:09 AM (UTC)
Message
If it can't find wield, then its likely declared in the wrong place. Go to the top of the function, where the other declarations are, and add it with those. If you add it below an instruction, then it will not work.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Taebryn   (58 posts)  Bio
Date Reply #6 on Wed 03 Mar 2004 02:02 AM (UTC)

Amended on Wed 03 Mar 2004 02:06 AM (UTC) by Taebryn

Message
void show_char_to_char_0( CHAR_DATA *victim, CHAR_DATA *ch )
{
OBJ_DATA *wield;
char buf[MAX_STRING_LENGTH];
char buf1[MAX_STRING_LENGTH];

............

else
//strcat( buf, " is standing here." );
{
wield = get_eq_char( ch, WEAR_WIELD );
if (wield)
sprintf(buf, " is standing here, wielding %s", weild->short_descr );
else
strcat(buf, " is standing here." );
}


and i get the errors:
C:\Documents and Settings\Sam\My Documents\MUDs\reign of arthur\source\act_info.c(671) : error C2065: 'weild' : undeclared identifier
C:\Documents and Settings\Sam\My Documents\MUDs\reign of arthur\source\act_info.c(671) : error C2223: left of '->short_descr' must point to struct/union

Arthurian MUD in development.

Reign of Arthur
http://arthur.vze.com
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #7 on Wed 03 Mar 2004 05:06 AM (UTC)
Message
if you look at the error, you'll notice "error C2065: 'weild' : ". You've spelt wield wrong.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by Taebryn   (58 posts)  Bio
Date Reply #8 on Wed 03 Mar 2004 10:57 PM (UTC)
Message
hahahah, I knew that! :X
thx

Arthurian MUD in development.

Reign of Arthur
http://arthur.vze.com
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.


28,937 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.