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 ➜ do_disguise

do_disguise

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


Posted by Ithildin   USA  (262 posts)  Bio
Date Sat 18 Sep 2004 07:34 PM (UTC)
Message
Alright, now i'm in the middle of making a disguise for thieves. what it does, it sets their long description to a predefined long. example, a character is disguised, another character looks and sees:

Forest
blah blah blah desc
blah blah blah desc
exits
A man stands here with a cloak on.

instead of the normal:
(race) *name* is standing here.

i'm getting weird errors that i'm not sure why.


void do_disguise ( CHAR_DATA *ch, char *argument )
{
        char arg1(MAX_INPUT_LENGTH); <--4419
        char arg2(MAX_INPUT_LENGTH); <--4420

        argument = one_argument(argument, arg1);  <--4422
        argument = one_argument(argument, arg2);  <--4423

        if ( IS_NPC(ch) )
        return;

        if (arg1[0] == '\0' || arg2[0] == '\0' )  <--4428

        {

                send_to_char( "Disguise <kind> < number>\n\r", ch );
                send_to_char( "Help Disguise\n\r", ch );
                return;

        }


        if ( !str_cmp(arg1, "evil"))     <--4438
        {
         if (!str_cmp (arg2, "1"))        <--4440
             {
                 free_string (ch->long_descr);
                 ch->long_descr = str_dup ("^PA dark man stands here.^w\n\r");
//               return;
             }
        }

        {
                AFFECT_DATA     af;
                ZeroMemory(&af, sizeof(AFFECT_DATA) );

                af.type = skill_lookup("disguise");
                af.duration = 2;
                af.bDispel = DISPEL_NEVER;
                af.location = APPLY_NONE;
                af.bvAff = meb(AFFX_DISGUISE);
                affect_to_char (ch, &af);
        }
return;
}


here are the errors:

act_obj.c: In function `do_disguise':
act_obj.c:4419: parse error before `160'
act_obj.c:4420: parse error before `160'
act_obj.c:4422: warning: passing arg 2 of `one_argument' from incompatible pointer type
act_obj.c:4423: warning: passing arg 2 of `one_argument' from incompatible pointer type
act_obj.c:4428: subscripted value is neither array nor pointer
act_obj.c:4428: subscripted value is neither array nor pointer
act_obj.c:4438: warning: passing arg 1 of `str_cmp' from incompatible pointer type
act_obj.c:4440: warning: passing arg 1 of `str_cmp' from incompatible pointer type
act_obj.c:4456: `XBIT62' undeclared (first use in this function)
act_obj.c:4456: (Each undeclared identifier is reported only once
act_obj.c:4456: for each function it appears in.)


lines 419 and 420, the max length is 160, but i dont' know why it's erroring. the exbit62, i'm not sure why that's erroring as well. it's defined and did a make clean.

any thoughts?

Top

Posted by Ithildin   USA  (262 posts)  Bio
Date Reply #1 on Sat 18 Sep 2004 07:57 PM (UTC)
Message
ok, got the xbit 62 working. just had to define another spot.
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #2 on Sat 18 Sep 2004 10:03 PM (UTC)
Message
Line 4419 and 4420, those should be brackets and not parentheses, like so:


char arg1[MAX_INPUT_LENGTH]; <--4419
char arg2[MAX_INPUT_LENGTH]; <--4420
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.


13,892 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.