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
➜ Bandage
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Halomantis
(27 posts) Bio
|
Date
| Tue 01 Jul 2003 05:49 PM (UTC) |
Message
| I have added the bandage code from http://ftp.kyndig.com/diku/merc/smaug/snippets/bandage.txt
It works just fine what I need help with is how to allow me to bandage other players and I need to run a check to see if the Actor and the Victim are both sitting or laying down.
Thanks before hand | Top |
|
Posted by
| Rob Harper
(108 posts) Bio
|
Date
| Reply #1 on Tue 01 Jul 2003 06:28 PM (UTC) |
Message
| Would a if check on position work? | Top |
|
Posted by
| Celestine
(29 posts) Bio
|
Date
| Reply #2 on Wed 02 Jul 2003 12:57 AM (UTC) |
Message
| For the character who applies the bandage, when you add the skill in the skilltable, you can set the minpos. If you don't want to do that, you can do what you said--run position checks. | Top |
|
Posted by
| Halomantis
(27 posts) Bio
|
Date
| Reply #3 on Wed 02 Jul 2003 01:53 AM (UTC) |
Message
| cool I still have the problem that I am not able to direct this towards a victim.
Thanks with the answers so far they are helping me!! | Top |
|
Posted by
| Celestine
(29 posts) Bio
|
Date
| Reply #4 on Wed 02 Jul 2003 03:20 AM (UTC) |
Message
| Aren't you passing in the victim as part of the argument? I mean take the name of the victim, convert it to CHAR_DATA, then use the position check on that. | Top |
|
Posted by
| Halomantis
(27 posts) Bio
|
Date
| Reply #5 on Wed 02 Jul 2003 06:03 AM (UTC) |
Message
| no I mean I am trying to change the code. As it sets now you cannot bandage someone other than yourself. I am still learning how to program so I am not totally understanding how to set it up so that it looks at the victim to apply the bandage to and stop the bleeding.
Thanks beforehand! | Top |
|
Posted by
| Ithildin
USA (262 posts) Bio
|
Date
| Reply #6 on Wed 02 Jul 2003 04:42 PM (UTC) |
Message
| find another peice of code in your code that uses the ability to do something to another player. just copy and paste and then change a few things here and there. | Top |
|
Posted by
| Halomantis
(27 posts) Bio
|
Date
| Reply #7 on Wed 02 Jul 2003 05:48 PM (UTC) |
Message
| I would love to thank all who helped me.... here is the altered code that works just like it I wanted. Thanks again!!!!
void do_bandage( CHAR_DATA *ch, char *argument )
{
char arg1 [MAX_INPUT_LENGTH];
CHAR_DATA *victim;
/* OBJ_DATA *obj; This is commented out in case I want make them carry bandages later */
argument = one_argument( argument, arg1 );
if ( ch->mount )
{
send_to_char( "You can't do that while mounted.\n\r", ch );
return;
}
if ( arg1[0] == '\0')
{
send_to_char( "Bandage whom?\n\r", ch );
return;
}
if ( ( victim = get_char_room( ch, arg1 ) ) == NULL )
{
send_to_char( "They aren't here.\n\r", ch );
return;
}
if ( victim->pcdata->condition[COND_BLEEDING] <= 0)
{
send_to_char( "How can you bandage that which is not bleeding? \n\r", ch );
return;
}
if ( victim->position == POS_SITTING || victim->position == POS_RESTING )
{
if(can_use_skill(ch, number_percent(), gsn_bleeding))
{
gain_condition(victim, COND_BLEEDING, -1);
act( AT_SKILL, "You place a bandage over $N's wound trying to help the bleeding!", ch, NULL, victim, TO_CHAR );
act( AT_SKILL, "$n places a bandage over your wound to help stop the bleeding!", ch, NULL, victim, TO_VICT );
act( AT_SKILL, "$n places a bandage over $N's wound to help stop the bleeding!", ch, NULL, victim, TO_NOTVICT );
learn_from_success( ch, gsn_bleeding );
return;
}
}
else
{
if ( victim == ch )
{
send_to_char( "You need to sit still to bandage yourself.\n\r", ch );
return;
}
else
{
send_to_char( "How can you bandage anyone if they won't sit still. /n/r", ch );
return;
}
return;
}
} | 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.
25,010 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top